Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9139 from elpaso/bugfix-21176-spatialite-text-pk
Fix spatialite text PKs
  • Loading branch information
elpaso committed Feb 10, 2019
2 parents 3ae5038 + 3736fc0 commit e6cce10
Show file tree
Hide file tree
Showing 4 changed files with 291 additions and 177 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 e6cce10

Please sign in to comment.