Skip to content
Permalink
Browse files

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 7f61dc495491752fd26c7f3bad56adc1f8950e3f
@@ -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 )
{
@@ -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 );

0 comments on commit 7f61dc4

Please sign in to comment.
You can’t perform that action at this time.