summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2018-01-10 23:24:01 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2018-01-11 11:05:51 +0100
commit2711f7639811929fc9ea8dc168ea28f1c5545e67 (patch)
tree113b8f8a20fb11c9b24ed4f3e74f570071d0a083
parent29d57a3f0c60afc1bd3a79a01e18e99bf4e8edcb (diff)
tdf#114955: Fix primary key management in copy table
When we chose to create a primary key, be sure the other existing columns won't be in primary key Change-Id: I523f1b3a4b56c92d48b65cb3d83793b5459c630c Reviewed-on: https://gerrit.libreoffice.org/47732 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 2bc3a85a00d8..f6f21d745dbd 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -774,6 +774,10 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos)
{
if ( m_bAddPKFirstTime )
{
+ // tdf#114955: since we chose to create a primary key
+ // be sure all other columns won't be in primary key
+ for (auto const& elem : m_vDestColumns)
+ elem.second->SetPrimaryKey(false);
OFieldDescription* pField = new OFieldDescription();
pField->SetName(m_aKeyName);
pField->FillFromTypeInfo(pTypeInfo,true,true);