Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1993 from manisandro/fldidx
Fix primary key search uniqueness

Duplicate suffix `_0` has not been detected previously
  • Loading branch information
m-kuhn committed Apr 20, 2015
2 parents d78bc7d + 265c253 commit 634641a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2979,7 +2979,7 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
{
// it already exists, try again with a new name
primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ );
fldIdx = 0;
fldIdx = -1; // it is incremented in the for loop, i.e. restarts at 0
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -157,7 +157,7 @@ QgsSpatiaLiteProvider::createEmptyLayer(
{
// it already exists, try again with a new name
primaryKey = QString( "%1_%2" ).arg( pk ).arg( index++ );
fldIdx = 0;
fldIdx = -1; // it is incremented in the for loop, i.e. restarts at 0
}
}
}
Expand Down

0 comments on commit 634641a

Please sign in to comment.