[Libreoffice-commits] core.git: connectivity/source
Julien Nabet
serval2412 at yahoo.fr
Fri Jun 2 12:45:27 UTC 2017
connectivity/source/drivers/firebird/Table.cxx | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
New commits:
commit f883a6b420efa7ed099448f7e6e5cadaa3bb275b
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue May 30 23:26:31 2017 +0200
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 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 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);
}
More information about the Libreoffice-commits
mailing list