Fix primary key search

This commit is contained in:
Sandro Mani 2015-04-14 17:02:44 +02:00
parent cfe397e718
commit 265c253995
2 changed files with 2 additions and 2 deletions

View File

@ -2979,7 +2979,7 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
{ {
// it already exists, try again with a new name // it already exists, try again with a new name
primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ ); primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ );
fldIdx = 0; fldIdx = -1; // it is incremented in the for loop, i.e. restarts at 0
} }
} }
} }

View File

@ -157,7 +157,7 @@ QgsSpatiaLiteProvider::createEmptyLayer(
{ {
// it already exists, try again with a new name // it already exists, try again with a new name
primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ ); primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ );
fldIdx = 0; fldIdx = -1; // it is incremented in the for loop, i.e. restarts at 0
} }
} }
} }