[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - connectivity/source
Julien Nabet (via logerrit)
logerrit at kemper.freedesktop.org
Fri Oct 30 05:51:47 UTC 2020
connectivity/source/drivers/firebird/Util.cxx | 92 ++++++++++++++------------
1 file changed, 52 insertions(+), 40 deletions(-)
New commits:
commit 698d5809ea237c78bbbd4e85aa4f73685a4db025
Author: Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Oct 28 22:38:28 2020 +0100
Commit: Lionel Mamane <lionel at mamane.lu>
CommitDate: Fri Oct 30 06:51:13 2020 +0100
tdf#137801: Firebird fix warn when changing a table having a field type BLOB
OTableController::alterColumns() from dbaccess/source/ui/tabledesign/TableController.cxx
checks if a column changes with:
if((nType != pField->GetType() ||
sTypeName != pField->GetTypeName() ||
etc
See https://opengrok.libreoffice.org/xref/core/dbaccess/source/ui/tabledesign/TableController.cxx?r=585cefd1#1002
So for example for "BLOB" field, LO was comparing "SQL_BLOB" from "sTypeName" with "BLOB" from "pField->GetTypeName()"
In the same way, LO was comparing "SQL_LONG" from "sTypeName" with "INTEGER" from "pField->GetTypeName()"
or "SQL_VARYING" from "sTypeName" with "VARCHAR" from "pField->GetTypeName()"
Change-Id: I3632f3ee5845b4f07d606fddd586951a3deea67f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104979
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
(cherry picked from commit 5b33b1a6b0f251202e89cef436efd4719c3fc0c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104963
Reviewed-by: Lionel Mamane <lionel at mamane.lu>
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index 7befd4b99014..7bdb12b8eb29 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -181,47 +181,59 @@ sal_Int32 firebird::ColumnTypeInfo::getSdbcType() const
OUString firebird::ColumnTypeInfo::getColumnTypeName() const
{
- short aType = m_aType & ~1; // Remove last bit -- it is used to denote whether column
- // can store Null, not needed for type determination
-
- switch (aType)
+ sal_Int32 nDataType = this->getSdbcType();
+ switch (nDataType)
{
- case SQL_TEXT:
- return "SQL_TEXT";
- case SQL_VARYING:
- return "SQL_VARYING";
- case SQL_SHORT:
- return "SQL_SHORT";
- case SQL_LONG:
- return "SQL_LONG";
- case SQL_FLOAT:
- return "SQL_FLOAT";
- case SQL_DOUBLE:
- return "SQL_DOUBLE";
- case SQL_D_FLOAT:
- return "SQL_D_FLOAT";
- case SQL_TIMESTAMP:
- return "SQL_TIMESTAMP";
- case SQL_BLOB:
- return "SQL_BLOB";
- case SQL_ARRAY:
- return "SQL_ARRAY";
- case SQL_TYPE_TIME:
- return "SQL_TYPE_TIME";
- case SQL_TYPE_DATE:
- return "SQL_TYPE_DATE";
- case SQL_INT64:
- return "SQL_INT64";
- case SQL_NULL:
- return "SQL_NULL";
- case SQL_QUAD:
- return "SQL_QUAD";
- case SQL_BOOLEAN:
- return "SQL_BOOLEAN";
- default:
- assert(false); // Should never happen
- return OUString();
- }
+ case DataType::BIT:
+ return "BIT";
+ case DataType::TINYINT:
+ return "TINYINT";
+ case DataType::SMALLINT:
+ return "SMALLINT";
+ case DataType::INTEGER:
+ return "INTEGER";
+ case DataType::BIGINT:
+ return "BIGINT";
+ case DataType::FLOAT:
+ return "FLOAT";
+ case DataType::REAL:
+ return "REAL";
+ case DataType::DOUBLE:
+ return "DOUBLE";
+ case DataType::NUMERIC:
+ return "NUMERIC";
+ case DataType::DECIMAL:
+ return "DECIMAL";
+ case DataType::CHAR:
+ return "CHAR";
+ case DataType::VARCHAR:
+ return "VARCHAR";
+ case DataType::LONGVARCHAR:
+ return "LONGVARCHAR";
+ case DataType::DATE:
+ return "DATE";
+ case DataType::TIME:
+ return "TIME";
+ case DataType::TIMESTAMP:
+ return "TIMESTAMP";
+ case DataType::BINARY:
+ return "BINARY";
+ case DataType::LONGVARBINARY:
+ return "LONGVARBINARY";
+ case DataType::ARRAY:
+ return "ARRAY";
+ case DataType::BLOB:
+ return "BLOB";
+ case DataType::CLOB:
+ return "CLOB";
+ case DataType::BOOLEAN:
+ return "BOOLEAN";
+ case DataType::SQLNULL:
+ return "NULL";
+ default:
+ assert(false); // Should never happen
+ return OUString();
+ }
}
short firebird::getFBTypeFromBlrType(short blrType)
More information about the Libreoffice-commits
mailing list