summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/source/ui/uno/copytablewizard.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx
index dfc179ff367c..4404c9595c1d 100644
--- a/dbaccess/source/ui/uno/copytablewizard.cxx
+++ b/dbaccess/source/ui/uno/copytablewizard.cxx
@@ -1380,7 +1380,9 @@ void CopyTableWizard::impl_doCopy_nothrow()
}
}
- if (!sPKCL.isEmpty())
+ // If we created a new primary key, then it won't necessarily be an IDENTITY column
+ const bool bShouldCreatePrimaryKey = rWizard.shouldCreatePrimaryKey();
+ if (!bShouldCreatePrimaryKey && !sPKCL.isEmpty())
{
OUString strSql = "SELECT MAX(\"" + sPKCL + "\") FROM " + sComposedTableName;