diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-06-21 15:24:15 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-06-24 13:14:51 +0000 |
commit | 002c79346c69c0b7f4953daec7377e71660ae306 (patch) | |
tree | c93051366b2741d47c942c800e93a6a8abff0b84 | |
parent | bf69b76ee8e16069ca6d6a1782e7610ef784aa4b (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/4431
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
-rw-r--r-- | connectivity/source/commontools/TTableHelper.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index 8442a2619930..3e29b7bbd524 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); } |