[fdo-internals] SQLite select ordering not working

Haris Kurtagic haris at sl-king.com
Fri Jul 16 17:54:34 EDT 2010


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


More information about the fdo-internals mailing list