summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-05-30 23:26:31 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2017-06-02 14:44:26 +0200
commitf883a6b420efa7ed099448f7e6e5cadaa3bb275b (patch)
tree9857fcaa29548fcf004f455cd683d4421f56a3ea /connectivity
parentc855400e9686ddd8bcba5691393f839f6f52c966 (diff)
Cleaning in table.cxx of firebird
- Replace nNullabble by nNullable - Replace wrong var name sNewTableName by sNewColName Change-Id: Ib10de7057c0d131f8504e8387721a05bd9e4434f Reviewed-on: https://gerrit.libreoffice.org/38251 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Table.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/connectivity/source/drivers/firebird/Table.cxx b/connectivity/source/drivers/firebird/Table.cxx
index eefcc9698e99..bf441792555d 100644
--- a/connectivity/source/drivers/firebird/Table.cxx
+++ b/connectivity/source/drivers/firebird/Table.cxx
@@ -127,6 +127,7 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
const bool bScaleChanged = xColumn->getPropertyValue("Scale") != rDescriptor->getPropertyValue("Scale");
const bool bIsNullableChanged = xColumn->getPropertyValue("IsNullable") != rDescriptor->getPropertyValue("IsNullable");
const bool bIsAutoIncrementChanged = xColumn->getPropertyValue("IsAutoIncrement") != rDescriptor->getPropertyValue("IsAutoIncrement");
+
// TODO: remainder -- these are all "optional" so have to detect presence and change.
bool bDefaultChanged = xColumn->getPropertyValue("DefaultValue")
@@ -146,22 +147,22 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
if (bIsNullableChanged)
{
- sal_Int32 nNullabble = 0;
- rDescriptor->getPropertyValue("IsNullable") >>= nNullabble;
+ sal_Int32 nNullable = 0;
+ rDescriptor->getPropertyValue("IsNullable") >>= nNullable;
- if (nNullabble != ColumnValue::NULLABLE_UNKNOWN)
+ if (nNullable != ColumnValue::NULLABLE_UNKNOWN)
{
OUString sSql;
// Dirty hack: can't change null directly in sql, we have to fiddle
// the system tables manually.
- if (nNullabble == ColumnValue::NULLABLE)
+ if (nNullable == ColumnValue::NULLABLE)
{
sSql = "UPDATE RDB$RELATION_FIELDS SET RDB$NULL_FLAG = NULL "
"WHERE RDB$FIELD_NAME = '" + rColName + "' "
"AND RDB$RELATION_NAME = '" + getName() + "'";
}
- else if (nNullabble == ColumnValue::NO_NULLS)
+ else if (nNullable == ColumnValue::NO_NULLS)
{
// And if we are making NOT NULL then we have to make sure we have
// no nulls left in the column.
@@ -208,10 +209,10 @@ void SAL_CALL Table::alterColumnByName(const OUString& rColName,
// TODO: quote identifiers as needed.
if (bNameChanged)
{
- OUString sNewTableName;
- rDescriptor->getPropertyValue("Name") >>= sNewTableName;
+ OUString sNewColName;
+ rDescriptor->getPropertyValue("Name") >>= sNewColName;
OUString sSql(getAlterTableColumn(rColName)
- + " TO \"" + sNewTableName + "\"");
+ + " TO \"" + sNewColName + "\"");
getConnection()->createStatement()->execute(sSql);
}