summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-06-21 15:24:15 +0200
committerMichael Stahl <mstahl@redhat.com>2013-06-24 21:52:48 +0000
commit8a6df1a62ded3b6da47022a5b7eec2ba6e81112c (patch)
tree502220a98efcc4bd15f999670d5e8fe5cf80f2a6
parentd4f3a3dc266ec299153058fa002857e4c242763b (diff)
fdo#49708 when there is no Primary Key, there is no Primay Key
As opposed to a primary key with empty name and no columns (!) Change-Id: I78ca185947a0e8d37bac64bd50add155afaeed47 Reviewed-on: https://gerrit.libreoffice.org/4432 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--connectivity/source/commontools/TTableHelper.cxx11
-rw-r--r--sal/inc/sal/log-areas.dox1
2 files changed, 10 insertions, 2 deletions
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index 6a5ad878f004..863938eed1d4 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -339,12 +339,19 @@ void OTableHelper::refreshPrimaryKeys(TStringVector& _rNames)
if ( !bAlreadyFetched )
{
aPkName = xRow->getString(6);
+ SAL_WARN_IF(xRow->wasNull(),"connectivity.commontools", "NULL Primary Key name");
+ SAL_WARN_IF(aPkName.isEmpty(),"connectivity.commontools", "empty Primary Key name");
bAlreadyFetched = true;
}
}
- m_pImpl->m_aKeys.insert(TKeyMap::value_type(aPkName,pKeyProps));
- _rNames.push_back(aPkName);
+ if(bAlreadyFetched)
+ {
+ SAL_WARN_IF(aPkName.isEmpty(),"connectivity.commontools", "empty Primary Key name");
+ SAL_WARN_IF(pKeyProps->m_aKeyColumnNames.size() == 0,"connectivity.commontools", "Primary Key has no columns");
+ m_pImpl->m_aKeys.insert(TKeyMap::value_type(aPkName,pKeyProps));
+ _rNames.push_back(aPkName);
+ }
} // if ( xResult.is() && xResult->next() )
::comphelper::disposeComponent(xResult);
}
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index d94370319b86..12cc4c7bc6c0 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -36,6 +36,7 @@ certain functionality.
@section connectivity
+@li @c connectivity.commontools
@li @c connectivity.mork
@li @c connectivity.parse