Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix spatialite text pks and other issues
... also fixes the geometry information query
when spatialite version is >= 4

Fixes #21176

With tests
  • Loading branch information
elpaso committed Feb 8, 2019
1 parent 7e106ef commit 7f61dc4
Show file tree
Hide file tree
Showing 4 changed files with 284 additions and 168 deletions.
3 changes: 2 additions & 1 deletion src/providers/spatialite/qgsspatialitefeatureiterator.cpp
Expand Up @@ -355,7 +355,7 @@ bool QgsSpatiaLiteFeatureIterator::prepareStatement( const QString &whereClause,
if ( limit >= 0 )
sql += QStringLiteral( " LIMIT %1" ).arg( limit );

// qDebug() << sql;
QgsDebugMsgLevel( sql, 4 );

if ( sqlite3_prepare_v2( mHandle->handle(), sql.toUtf8().constData(), -1, &sqliteStatement, nullptr ) != SQLITE_OK )
{
Expand Down Expand Up @@ -515,6 +515,7 @@ bool QgsSpatiaLiteFeatureIterator::getFeature( sqlite3_stmt *stmt, QgsFeature &f
}
else
{
QgsDebugMsgLevel( QStringLiteral( "Primary key is not an integer field: setting autoincrement fid" ), 3 );
// autoincrement a row number
mRowNumber++;
feature.setId( mRowNumber );
Expand Down

0 comments on commit 7f61dc4

Please sign in to comment.