Kaydet (Commit) 2481e7dd authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Lionel Elie Mamane

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

(cherry picked from commit 2711f763)

Change-Id: I966b08ad4049c46f4a77812c48ff651b13ea7493
Reviewed-on: https://gerrit.libreoffice.org/47745Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarLionel Elie Mamane <lionel@mamane.lu>
üst d4563131
...@@ -774,6 +774,10 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos) ...@@ -774,6 +774,10 @@ bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos)
{ {
if ( m_bAddPKFirstTime ) 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(); OFieldDescription* pField = new OFieldDescription();
pField->SetName(m_aKeyName); pField->SetName(m_aKeyName);
pField->FillFromTypeInfo(pTypeInfo,true,true); pField->FillFromTypeInfo(pTypeInfo,true,true);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment