summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-04-19 11:50:35 +0200
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-04-19 11:50:35 +0200
commit99671d27b08076d2dabfbb989003970c3ed42bd3 (patch)
tree268cf448c590f4dd72f0fc9c76c66cf6c6c1dde5
parent21ae32549e5640e23e289ee3269d3f8d312838b0 (diff)
dba321b: #i110942# use default if key columsn are unknown
-rw-r--r--dbaccess/source/core/api/KeySet.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 581af61c8..f277179f8 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -367,15 +367,17 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O
}
Sequence< ::rtl::OUString> aBestColumnNames;
- if ( aBestRowColumnNames.empty() )
+ if ( !aBestRowColumnNames.empty() )
{
- if ( xKeyColumns.is() )
- aBestColumnNames = xKeyColumns->getElementNames();
- }
- else
aBestColumnNames = Sequence< ::rtl::OUString>(&aBestRowColumnNames[0],aBestRowColumnNames.size());
-
- ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames));
+ ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames));
+ }
+
+ if (m_pKeyColumnNames->empty() && xKeyColumns.is())
+ {
+ aBestColumnNames = xKeyColumns->getElementNames();
+ ::dbaccess::getColumnPositions(xSup->getColumns(),aBestColumnNames,m_sUpdateTableName,(*m_pKeyColumnNames));
+ }
::dbaccess::getColumnPositions(xSup->getColumns(),xSourceColumns->getElementNames(),m_sUpdateTableName,(*m_pColumnNames));
::dbaccess::getColumnPositions(xSup->getColumns(),aParameterColumns,m_sUpdateTableName,(*m_pParameterNames));