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

New commits:
commit d499cb3bd585e9fcc21bc586cad3d2ad2487a451
Author: Julien Nabet <[email protected]>
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
    Reviewed-on: https://gerrit.libreoffice.org/36642
    Tested-by: Jenkins <[email protected]>
    Reviewed-by: Julien Nabet <[email protected]>
    Tested-by: Julien Nabet <[email protected]>

diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx 
b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index 9f44363427a5..d456f5efcdaa 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -1086,8 +1086,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->getShort(5) == 1 ) 
?
                     OUString("YES") : OUString("NO")); // 8. Grantable
@@ -1531,17 +1531,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
 
@@ -1782,8 +1782,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(bool(xRow->getBoolean(5))); // 7. 
Is Grantable
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to