Changeset 23946
- Timestamp:
- Feb 11, 2012, 7:55:25 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gdal/ogr/ogrsf_frmts/sqlite/ogrsqlitedatasource.cpp
r23945 r23946 1225 1225 sqlite3_stmt *hSQLStmt = NULL; 1226 1226 1227 rc = sqlite3_prepare( GetDB(), pszSQLCommand, strlen(pszSQLCommand), 1227 CPLString osSQLCommand = pszSQLCommand; 1228 1229 /* This will speed-up layer creation */ 1230 /* ORDER BY are costly to evaluate and are not necessary to establish */ 1231 /* the layer definition. */ 1232 if( osSQLCommand.ifind("SELECT ") == 0 && 1233 osSQLCommand.ifind(" UNION ") == std::string::npos && 1234 osSQLCommand.ifind(" INTERSECT ") == std::string::npos && 1235 osSQLCommand.ifind(" EXCEPT ") == std::string::npos ) 1236 { 1237 size_t nOrderByPos = osSQLCommand.ifind(" ORDER BY "); 1238 if( nOrderByPos != std::string::npos ) 1239 osSQLCommand.resize(nOrderByPos); 1240 } 1241 1242 rc = sqlite3_prepare( GetDB(), osSQLCommand.c_str(), osSQLCommand.size(), 1228 1243 &hSQLStmt, NULL ); 1229 1244
Note:
See TracChangeset
for help on using the changeset viewer.
