[Fdo-trac] [fdo-trac] #906: SdfIndexedScrollableFeatureReader::ReadNext() return true again after read finish

FDO trac_fdo at osgeo.org
Tue Apr 28 19:21:12 PDT 2015


#906: SdfIndexedScrollableFeatureReader::ReadNext() return true again after read
finish
--------------------------+-----------------------------
 Reporter:  christinebao  |        Owner:  christine bao
     Type:  defect        |       Status:  new
 Priority:  major         |    Milestone:  4.1.0
Component:  FDO API       |      Version:  4.0.0
 Severity:  3             |   Resolution:
 Keywords:                |  External ID:  DE22116
--------------------------+-----------------------------

Comment (by christinebao):

 There are 3 features in this SDF data source, because order by FeatId
 `SdfIndexedScrollableFeatureReader` is used.

 Check `ReadNext` function:

 {{{
 bool SdfIndexedScrollableFeatureReader::ReadNext()
 {
         m_CurrentIndex++;
         if( m_CurrentIndex >= m_TableSize )
         {
                 m_CurrentIndex = -1;
                 return false;
         }

         InitCurrentKey();

         if( m_Sourcedata->GetFeatureAt( m_currentKey, m_currentData ) !=
 SQLiteDB_OK )
                 return false;

         InitDataReader();

         return true;
 }
 }}}

 `m_CurrentIndex` is cursor move forward, once it exceed SDF total feature
 `m_TableSize` `ReadNext()` return false, this is correct. However MapGuide
 will read again by calling `ReadNext()`, it expects return false, however
 as `m_CurrentIndex = -1;`, next check will start from beginning.

 Fix it by not set `m_CurrentIndex = -1;` after read finish.

--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/906#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list