[fdo-internals] SQLite select ordering not working
Traian Stanev
traian.stanev at autodesk.com
Fri Jul 16 20:34:00 EDT 2010
Hi Haris,
SltExtendedSelect already implements GetOrderingOption and SetOrderingOption. Can you show a code snippet that triggers the problem?
Traian
-----Original Message-----
From: fdo-internals-bounces at lists.osgeo.org [mailto:fdo-internals-bounces at lists.osgeo.org] On Behalf Of Haris Kurtagic
Sent: Friday, July 16, 2010 5:55 PM
To: FDO Internals Mail List
Subject: [fdo-internals] SQLite select ordering not working
Hi,
I haven't tried myself but heard from colleagues that SQLite ordering
is not working for FdoSelect command.
I looked at SQLite code and there is SltExtendedSelect which
surpassingly implement both FdoSelect and FdoExtendedSelect.
I believe bug comes from function (SltCommands.h line 116)
//Regular select -- not scrollable
virtual FdoIFeatureReader* Execute()
{
std::vector<NameOrderingPair> ordering;
if (m_orderingProps)
{
for (int i=0; i<m_orderingProps->GetCount(); i++)
{
FdoPtr<FdoIdentifier> id = m_orderingProps->GetItem(i);
ordering.push_back(NameOrderingPair(id.p,
m_orderingOptions[id->GetName()]));
}
}
return m_connection->Select(m_className, m_filter,
m_properties, false, ordering);
}
which is using m_orderingOptions. Those properties are only set trough
FdoExtendedSelect interface not for FdoSelect.
So if I am right then fix is to change line to:
ordering.push_back(NameOrderingPair(id.p, GetOrderingOption());
and also to implement GetOrderingOption() and SetOrderingOption() functions.
This bug would not happened if select and extendedselect would be
implemented in their own separate implementations.
In general I would consider problematic that extended select
implementation is returned for select interface too.
Haris
_______________________________________________
fdo-internals mailing list
fdo-internals at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/fdo-internals
More information about the fdo-internals
mailing list