Opened 5 years ago

Closed 5 years ago

#907 closed defect (fixed)

SQLite provider m_nTotalProps is not initialized when select aggregates

Reported by: christinebao Owned by: christine bao
Priority: major Milestone: 4.1.0
Component: SQLite Provider Version: 4.0.0
Severity: 3 Keywords:
Cc: External ID: DE22147


Reported from Autodesk QA.

  1. In mapguide, load attached sqlite Hawaii_N83_4.sqlite.
  2. In mapagent, execute Feature->SelectAggregates?, Class nam = lulc_n83, Computed Properties = CeilPerim?;Ceil(PERIMETER).
  3. Report error:
An exception occurred in FDO component. Property index '0' is out of bounds. (Cause: , Root Cause: Property index '0' is out of bounds.)

Attachments (1)

Fix907.patch (492 bytes) - added by christinebao 5 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 5 years ago by christinebao

The sqlite file is 9M, too large to attach.

comment:2 Changed 5 years ago by christinebao

This exception happen in

void SltReader::ValidateIndex(sqlite3_stmt *pStmt, int index)
    if (index < 0 || index >= m_nTotalProps)
		wchar_t tmp[15];
		swprintf(tmp, 15, L"%d", index);
        throw FdoCommandException::Create((std::wstring(L"Property index \'") + tmp + L"\' is out of bounds.").c_str());

m_nTotalProps is a memory cache to indicate how many columns the table has. It is initialized in each constructor, but forget to initialize in one constructor SltReader::SltReader(SltConnection* connection, FdoIdentifierCollection* props, FdoParameterValueCollection* parmValues, const char* fcname, const char* sql) in case props->GetCount() is 0.

Changed 5 years ago by christinebao

Attachment: Fix907.patch added

comment:3 Changed 5 years ago by christinebao

Submit to trunk at r7217, and Autodesk 4.0 branch at r7218.

comment:4 Changed 5 years ago by christinebao

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.