summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-15 10:15:09 +0100
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2013-08-19 10:17:39 +0100
commit0d6d62a559e02c7468040dafc432c419e8fb7228 (patch)
tree798889f064f5856faba2bd184687fa04e889ed66
parent3bd7d5520fc15ee0e0cf930e73041ce6a18cb619 (diff)
Implement column-type alteration. (firebird-sdbc)
Change-Id: Id192bd7d62d0ce9d5abc04390670cb277c6ec755
-rw-r--r--connectivity/source/drivers/firebird/Table.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index d32066f91d2b..3f999177561e 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