[Libreoffice-commits] core.git: connectivity/source

Lionel Elie Mamane lionel at mamane.lu
Fri Jun 21 06:42:21 PDT 2013


 connectivity/source/commontools/TTableHelper.cxx |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 2741cb8685b28a4454b456b24c1545858fca52e8
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Jun 21 15:24:15 2013 +0200

    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

diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index 8442a26..d833e62 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);
 }


More information about the Libreoffice-commits mailing list