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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 21 06:36:40 UTC 2018


 connectivity/source/commontools/TPrivilegesResultSet.cxx |    2 +-
 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx |    5 ++---
 connectivity/source/drivers/file/FDatabaseMetaData.cxx   |    2 +-
 connectivity/source/drivers/mork/MDatabaseMetaData.cxx   |    5 ++---
 connectivity/source/drivers/mork/MDatabaseMetaData.hxx   |    2 +-
 5 files changed, 7 insertions(+), 9 deletions(-)

New commits:
commit 457aba546f43a4117c5c263028e35c8aaf9bc7f6
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Nov 20 12:29:55 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Nov 21 07:36:17 2018 +0100

    fix some dodgy static vars in connectivity
    
    no good reason for these to be static, and likely they will cause
    trouble if this code is ever touched from multiple threads at the same
    time
    
    Change-Id: I3f29d3795bd1a059a75d0d1ab64b25478fd60121
    Reviewed-on: https://gerrit.libreoffice.org/63662
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/connectivity/source/commontools/TPrivilegesResultSet.cxx b/connectivity/source/commontools/TPrivilegesResultSet.cxx
index 02a51bd39b05..bb4f92397056 100644
--- a/connectivity/source/commontools/TPrivilegesResultSet.cxx
+++ b/connectivity/source/commontools/TPrivilegesResultSet.cxx
@@ -55,7 +55,7 @@ OResultSetPrivileges::OResultSetPrivileges( const Reference< XDatabaseMetaData>&
         }
 
         ODatabaseMetaDataResultSet::ORows aRows;
-        static ODatabaseMetaDataResultSet::ORow aRow(8);
+        ODatabaseMetaDataResultSet::ORow aRow(8);
         aRow[5] = new ORowSetValueDecorator(sUserWorkingFor);
         aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
         aRow[7] = new ORowSetValueDecorator(OUString("YES"));
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 671bb230b60c..ff48493e1f20 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -257,11 +257,10 @@ OEvoabDatabaseMetaData::~OEvoabDatabaseMetaData()
 }
 
 
-ODatabaseMetaDataResultSet::ORows& OEvoabDatabaseMetaData::getColumnRows( const OUString& columnNamePattern )
+ODatabaseMetaDataResultSet::ORows OEvoabDatabaseMetaData::getColumnRows( const OUString& columnNamePattern )
 {
-    static ODatabaseMetaDataResultSet::ORows aRows;
+    ODatabaseMetaDataResultSet::ORows aRows;
     ODatabaseMetaDataResultSet::ORow  aRow(19);
-    aRows.clear();
 
     // ****************************************************
     // Some entries in a row never change, so set them now
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 14b37131b679..1f44f23f1fe4 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -390,7 +390,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
         {
             if(match(tableNamePattern,*pBegin,'\0'))
             {
-                static ODatabaseMetaDataResultSet::ORow aRow(8);
+                ODatabaseMetaDataResultSet::ORow aRow(8);
 
                 aRow[2] = new ORowSetValueDecorator(*pBegin);
                 aRow[6] = ODatabaseMetaDataResultSet::getSelectValue();
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
index 50b9347d642f..0ce5c3e856ca 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
@@ -50,7 +50,7 @@ ODatabaseMetaData::~ODatabaseMetaData()
 }
 
 
-ODatabaseMetaDataResultSet::ORows& ODatabaseMetaData::getColumnRows(
+ODatabaseMetaDataResultSet::ORows ODatabaseMetaData::getColumnRows(
         const OUString& tableNamePattern,
         const OUString& columnNamePattern )
 {
@@ -58,9 +58,8 @@ ODatabaseMetaDataResultSet::ORows& ODatabaseMetaData::getColumnRows(
     SAL_INFO("connectivity.mork", "tableNamePattern: " << tableNamePattern);
     SAL_INFO("connectivity.mork", "columnNamePattern: " << columnNamePattern);
 
-    static ODatabaseMetaDataResultSet::ORows aRows;
+    ODatabaseMetaDataResultSet::ORows aRows;
     ODatabaseMetaDataResultSet::ORow aRow(19);
-    aRows.clear();
 
     ::osl::MutexGuard aGuard( m_aMutex );
     std::vector< OUString > tables;
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.hxx b/connectivity/source/drivers/mork/MDatabaseMetaData.hxx
index edad3a74aeaf..f3a16a566ec1 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaData.hxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaData.hxx
@@ -29,7 +29,7 @@ namespace connectivity
                                        m_pMetaDataHelper;
 
             /// @throws css::sdbc::SQLException
-            ODatabaseMetaDataResultSet::ORows& getColumnRows( const OUString& tableNamePattern, const OUString& columnNamePattern );
+            ODatabaseMetaDataResultSet::ORows getColumnRows( const OUString& tableNamePattern, const OUString& columnNamePattern );
 
         protected:
             virtual ~ODatabaseMetaData() override;


More information about the Libreoffice-commits mailing list