Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#906 closed defect (wontfix)

SdfIndexedScrollableFeatureReader::ReadNext() return true again after read finish

Reported by: christinebao Owned by: christine bao
Priority: major Milestone: 4.1.0
Component: FDO API Version: 4.0.0
Severity: 3 Keywords:
Cc: External ID: DE22116

Description

Reported by Autodesk QA:

Steps to reproduce:

  1. load the attached mgp to your map server site
  2. put the attached rest.conf file to folder ..Autodesk Infrastructure Web Server Extension 2016\www\GeoREST\conf (need to update the server IP to yours and the port number to server matching port)
  3. in browser, input URL http://[your server ip]:99/rest/data/hotel/.xml?orderfields=FeatId

result: the hotel feature class has only 3 features. but the result of step3 has many times more than 3 records.

Attachments (2)

sherrycity_forGeoREST.mgp (17.9 KB ) - added by christinebao 9 years ago.
Fix960.patch (457 bytes ) - added by christinebao 9 years ago.

Download all attachments as: .zip

Change History (6)

by christinebao, 9 years ago

Attachment: sherrycity_forGeoREST.mgp added

comment:1 by christinebao, 9 years ago

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.

by christinebao, 9 years ago

Attachment: Fix960.patch added

comment:2 by christinebao, 9 years ago

Discussed with Andy, this patch will not be submitted. As FDO not specifically define what ReadNext() should behave after read finish, it's better to fix it in MapGuide side.

comment:3 by christinebao, 9 years ago

Resolution: wontfix
Status: newclosed

comment:4 by christinebao, 9 years ago

commit in FDO branch at r7216.

Note: See TracTickets for help on using tickets.