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

Andrzej J.R. Hunt andrzej at ahunt.org
Mon Aug 19 02:20:52 PDT 2013


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

New commits:
commit 0d6d62a559e02c7468040dafc432c419e8fb7228
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Thu Aug 15 10:15:09 2013 +0100

    Implement column-type alteration. (firebird-sdbc)
    
    Change-Id: Id192bd7d62d0ce9d5abc04390670cb277c6ec755

diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index d32066f..3f99917 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -11,6 +11,7 @@
 #include "Table.hxx"
 
 #include <comphelper/sequence.hxx>
+#include <connectivity/dbtools.hxx>
 #include <connectivity/TIndexes.hxx>
 #include <connectivity/TKeys.hxx>
 
@@ -115,7 +116,16 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
         getConnection()->createStatement()->execute(sSql);
     }
 
-    if (bTypeChanged || bTypeNameChanged || bPrecisionChanged || bScaleChanged
+    if (bTypeChanged || bTypeNameChanged)
+    {
+        OUString sSql(getAlterTableColumn(rColName) + "TYPE " +
+                ::dbtools::createStandardTypePart(rDescriptor, getConnection()));
+        getConnection()->createStatement()->execute(sSql);
+        // TODO: could cause errors e.g. if incompatible types, deal with them here as appropriate.
+        // possibly we have to wrap things in Util::evaluateStatusVector.
+    }
+
+    if (bPrecisionChanged || bScaleChanged
         || bIsNullableChanged || bIsAutoIncrementChanged)
     {
         // TODO: changeType


More information about the Libreoffice-commits mailing list