diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-11-17 22:03:24 +0100 |
---|---|---|
committer | Lionel Mamane <lionel@mamane.lu> | 2021-11-18 10:47:43 +0100 |
commit | 6bb6e59ca2b40958504ac176cab448de3fe0a2a9 (patch) | |
tree | e73d1f4a5512e67815fc1dc8264f24d70ef59e7f /connectivity | |
parent | dd8b064af0b4cb44575eb4f3482db18485bfc8d3 (diff) |
tdf#145205: Mysql/MariaDB, display BIT instead of DATE when its a BIT field
Beware, we just want to display the right info here, BIT management in Mysql/MariaDB
needs some work
There are 2 parts in this patch:
1)
- if (sType.equalsIgnoreAsciiCase("bit") || sType.equalsIgnoreAsciiCase("bool")
- || sType.equalsIgnoreAsciiCase("boolean"))
+ if (sType.equalsIgnoreAsciiCase("bit"))
+ return css::sdbc::DataType::BIT;
+ if (sType.equalsIgnoreAsciiCase("bool") || sType.equalsIgnoreAsciiCase("boolean"))
allows to display BIT instead of DATE when editing the table
2)
- return css::sdbc::DataType::VARCHAR;
+ return css::sdbc::DataType::BIT;
allows to show a checkbox instead of a field where you can type anything when opening the table
Change-Id: Id50882bfab97cc43a1904bfc6eb7256904732bba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125429
Tested-by: Jenkins
Reviewed-by: Lionel Mamane <lionel@mamane.lu>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_general.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_general.cxx b/connectivity/source/drivers/mysqlc/mysqlc_general.cxx index 878efdc3be24..e4b9040b8a1e 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_general.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_general.cxx @@ -125,7 +125,7 @@ sal_Int32 mysqlToOOOType(int eType, int charsetnr) noexcept switch (eType) { case MYSQL_TYPE_BIT: - return css::sdbc::DataType::VARCHAR; + return css::sdbc::DataType::BIT; case MYSQL_TYPE_TINY: return css::sdbc::DataType::TINYINT; @@ -226,8 +226,9 @@ sal_Int32 mysqlStrToOOOType(const OUString& sType) return css::sdbc::DataType::REAL; if (sType.equalsIgnoreAsciiCase("double")) return css::sdbc::DataType::DOUBLE; - if (sType.equalsIgnoreAsciiCase("bit") || sType.equalsIgnoreAsciiCase("bool") - || sType.equalsIgnoreAsciiCase("boolean")) + if (sType.equalsIgnoreAsciiCase("bit")) + return css::sdbc::DataType::BIT; + if (sType.equalsIgnoreAsciiCase("bool") || sType.equalsIgnoreAsciiCase("boolean")) return css::sdbc::DataType::BOOLEAN; OSL_FAIL("Unknown type name from string, failing back to varchar."); return css::sdbc::DataType::VARCHAR; |