diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2024-08-04 10:21:40 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2024-08-04 14:43:47 +0200 |
commit | bf2c4cead1980c2e36fa9d51b704d2753e517edf (patch) | |
tree | 1214f3ea589f0a2d97c0bab623543cc3f9028684 /connectivity | |
parent | 5850b22e04a7a055e5b4c6b23a1d32d74270506d (diff) |
tdf#162339: MariaDB: Table with spaces in table name couldn't be deleted by GUI
Use ::dbtools::qualifiedNameComponents to retrieve elements of table name (catalog/schema/table)
Use ::dbtools::composeTableName to compose the full table name
Change-Id: Ia6ebc1a46a4222315e43909356fb8c1d36990419
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171457
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_tables.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx index 1504fd1b5bad..61293664d5ba 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx @@ -151,7 +151,14 @@ void connectivity::mysqlc::Tables::dropObject(sal_Int32 nPosition, const OUStrin OUString sType; xTable->getPropertyValue(u"Type"_ustr) >>= sType; - m_xMetaData->getConnection()->createStatement()->execute("DROP " + sType + " " + sName); + OUString sCatalog, sSchema, sTable; + ::dbtools::qualifiedNameComponents(m_xMetaData, sName, sCatalog, sSchema, sTable, + ::dbtools::EComposeRule::InDataManipulation); + + OUString sComposedName(::dbtools::composeTableName( + m_xMetaData, sCatalog, sSchema, sTable, true, ::dbtools::EComposeRule::InDataManipulation)); + + m_xMetaData->getConnection()->createStatement()->execute("DROP " + sType + " " + sComposedName); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |