connectivity/source/drivers/mysqlc/mysqlc_tables.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit bf2c4cead1980c2e36fa9d51b704d2753e517edf
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Sun Aug 4 10:21:40 2024 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Sun Aug 4 14:43:47 2024 +0200

    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 <serval2...@yahoo.fr>
    Tested-by: Jenkins

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: */

Reply via email to