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

Julien Nabet serval2412 at yahoo.fr
Thu May 25 11:02:48 UTC 2017


 connectivity/source/drivers/firebird/Table.cxx |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit c751318868f3f0082b2c86df493216d452b8ecc5
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Thu May 25 10:14:30 2017 +0200

    Related tdf#108068: Use new name of column when it's been changed
    
    First fix simple case, the rename of a column which is not a primary key
    
    Change-Id: Ia0de8e531021cbec0409408008c541c25a4bcd85
    Reviewed-on: https://gerrit.libreoffice.org/38014
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index 7f71d1ebfbac..eefcc9698e99 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -132,17 +132,6 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
     bool bDefaultChanged = xColumn->getPropertyValue("DefaultValue")
                                      != rDescriptor->getPropertyValue("DefaultValue");
 
-    // TODO: quote identifiers as needed.
-    if (bNameChanged)
-    {
-        OUString sNewTableName;
-        rDescriptor->getPropertyValue("Name") >>= sNewTableName;
-        OUString sSql(getAlterTableColumn(rColName)
-                                            + " TO \"" + sNewTableName + "\"");
-
-        getConnection()->createStatement()->execute(sSql);
-    }
-
     if (bTypeChanged || bTypeNameChanged || bPrecisionChanged || bScaleChanged)
     {
         // If bPrecisionChanged this will only succeed if we have increased the
@@ -216,6 +205,17 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
 
         getConnection()->createStatement()->execute(sSql);
     }
+    // TODO: quote identifiers as needed.
+    if (bNameChanged)
+    {
+        OUString sNewTableName;
+        rDescriptor->getPropertyValue("Name") >>= sNewTableName;
+        OUString sSql(getAlterTableColumn(rColName)
+                                            + " TO \"" + sNewTableName + "\"");
+
+        getConnection()->createStatement()->execute(sSql);
+    }
+
 
     m_pColumns->refresh();
 }


More information about the Libreoffice-commits mailing list