From 33d24b08677ef45ea7525d8f7f762f152988ea8e Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Thu, 20 Jan 2022 20:45:56 +0100 Subject: Mysql/MariaDB: allow View renaming Strange bug the renamed view appears like a table but when closing and reopening the file, the view is indeed there as a view (and not as a table) and renamed Change-Id: I0f26fca66ffb0785ece6223df623845c5e015c93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128707 Reviewed-by: Julien Nabet Tested-by: Jenkins --- connectivity/source/drivers/mysqlc/mysqlc_table.cxx | 2 ++ connectivity/source/drivers/mysqlc/mysqlc_table.hxx | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/connectivity/source/drivers/mysqlc/mysqlc_table.cxx b/connectivity/source/drivers/mysqlc/mysqlc_table.cxx index 69b566bb3945..a85618aa3605 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_table.cxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_table.cxx @@ -163,4 +163,6 @@ void SAL_CALL Table::alterColumnByIndex( descriptor); } +OUString Table::getRenameStart() const { return "RENAME TABLE "; } + /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/connectivity/source/drivers/mysqlc/mysqlc_table.hxx b/connectivity/source/drivers/mysqlc/mysqlc_table.hxx index 4942ecfe36a6..31cdc055911b 100644 --- a/connectivity/source/drivers/mysqlc/mysqlc_table.hxx +++ b/connectivity/source/drivers/mysqlc/mysqlc_table.hxx @@ -44,6 +44,13 @@ public: virtual ::connectivity::sdbcx::OCollection* createIndexes(const ::std::vector& rNames) override; + /** Returns always "RENAME TABLE " even for views. + * + * \return The start of the rename statement. + * @see http://dev.mysql.com/doc/refman/5.1/de/rename-table.html + */ + virtual OUString getRenameStart() const override; + // XAlterTable /** * See css::sdbcx::ColumnDescriptor for details of -- cgit