[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - connectivity/source

Julien Nabet serval2412 at yahoo.fr
Thu May 4 02:54:16 UTC 2017


 connectivity/source/drivers/firebird/DatabaseMetaData.cxx |   24 +++++++-------
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit dfb7ee83299606f7c46bc175bc47710ee887009c
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Tue Apr 18 15:14:31 2017 +0200

    tdf#107196: fix firebird relationship
    
    Let's spread string sanitizing
    see https://bugs.documentfoundation.org/show_bug.cgi?id=107196#c3
    
    Furthermore, in example file from the bugtracker,
    relationship between f2 fields were present several times.
    So I had to delete it several times to really remove it.
    
    Change-Id: I4fbe10c479af3d4fa5ccfb290f128fdd2a6d49a9
    (cherry picked from commit d499cb3bd585e9fcc21bc586cad3d2ad2487a451)
    Reviewed-on: https://gerrit.libreoffice.org/37218
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>
    Tested-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index 4c2e3934e735..9e6d095ab6ff 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -1121,8 +1121,8 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumnPrivileges(
         aCurrentRow[3] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(1)));
         // 4. COLUMN_NAME
         aCurrentRow[4] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(6)));
-        aCurrentRow[5] = new ORowSetValueDecorator(xRow->getString(2)); // 5. GRANTOR
-        aCurrentRow[6] = new ORowSetValueDecorator(xRow->getString(3)); // 6. GRANTEE
+        aCurrentRow[5] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(2))); // 5. GRANTOR
+        aCurrentRow[6] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(3))); // 6. GRANTEE
         aCurrentRow[7] = new ORowSetValueDecorator(xRow->getString(4)); // 7. Privilege
         aCurrentRow[7] = new ORowSetValueDecorator(xRow->getBoolean(5)); // 8. Grantable
 
@@ -1565,17 +1565,17 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getImportedKeys(
 
     while(rs->next())
     {
-        aCurrentRow[3] = new ORowSetValueDecorator(xRow->getString(7)); // PK table
-        aCurrentRow[4] = new ORowSetValueDecorator(xRow->getString(8)); // PK column
-        aCurrentRow[7] = new ORowSetValueDecorator(xRow->getString(10)); // FK table
-        aCurrentRow[8] = new ORowSetValueDecorator(xRow->getString(11)); // FK column
+        aCurrentRow[3] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(7))); // PK table
+        aCurrentRow[4] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(8))); // PK column
+        aCurrentRow[7] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(10))); // FK table
+        aCurrentRow[8] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(11))); // FK column
 
         aCurrentRow[9] = new ORowSetValueDecorator(xRow->getShort(9)); // PK sequence number
-        aCurrentRow[10] = new ORowSetValueDecorator(aRuleMap[xRow->getString(1)]); // update role
-        aCurrentRow[11] = new ORowSetValueDecorator(aRuleMap[xRow->getString(2)]); // delete role
+        aCurrentRow[10] = new ORowSetValueDecorator(aRuleMap[sanitizeIdentifier(xRow->getString(1))]); // update role
+        aCurrentRow[11] = new ORowSetValueDecorator(aRuleMap[sanitizeIdentifier(xRow->getString(2))]); // delete role
 
-        aCurrentRow[12] = new ORowSetValueDecorator(xRow->getString(4)); // FK name
-        aCurrentRow[13] = new ORowSetValueDecorator(xRow->getString(3)); // PK name
+        aCurrentRow[12] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(4))); // FK name
+        aCurrentRow[13] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(3))); // PK name
 
         aCurrentRow[14] = new ORowSetValueDecorator(Deferrability::NONE); // deferrability
 
@@ -1819,8 +1819,8 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getTablePrivileges(
     {
         // 3. TABLE_NAME
         aRow[3] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(1)));
-        aRow[4] = new ORowSetValueDecorator(xRow->getString(2)); // 4. GRANTOR
-        aRow[5] = new ORowSetValueDecorator(xRow->getString(3)); // 5. GRANTEE
+        aRow[4] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(2))); // 4. GRANTOR
+        aRow[5] = new ORowSetValueDecorator(sanitizeIdentifier(xRow->getString(3))); // 5. GRANTEE
         aRow[6] = new ORowSetValueDecorator(xRow->getString(4)); // 6. Privilege
         aRow[7] = new ORowSetValueDecorator(xRow->getBoolean(5)); // 7. Is Grantable
 


More information about the Libreoffice-commits mailing list