connectivity/source/drivers/mysqlc/mysqlc_table.cxx |    2 ++
 connectivity/source/drivers/mysqlc/mysqlc_table.hxx |    7 +++++++
 2 files changed, 9 insertions(+)

New commits:
commit 33d24b08677ef45ea7525d8f7f762f152988ea8e
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Thu Jan 20 20:45:56 2022 +0100
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Thu Jan 20 23:40:14 2022 +0100

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

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<OUString>& 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

Reply via email to