summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-01-23 11:45:27 +0100
committerJulien Nabet <serval2412@yahoo.fr>2022-01-23 20:42:06 +0100
commit3366b529bbb51de725d5341bf25f9ea961fd0c0b (patch)
treec79e4490cc2dc28409279424a383f5cf65a085d4
parent133b5010c5580d564a87df6f36ead48120167716 (diff)
Mysql/MariaDB: Fix slight bug in Tables::createObject:
unescape scatalog before converting it in aCatalog In Views, remove connectivity::mysqlc::Views::disposing which seems more cargo cult Remove useless XConnection.hpp in tables (how come I didn't spot it in cleaning process?) Change-Id: I28863dcd93baae923877dbd431b6807226c0a548 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128799 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_tables.cxx2
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_tables.hxx1
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_views.cxx16
-rw-r--r--connectivity/source/drivers/mysqlc/mysqlc_views.hxx10
4 files changed, 7 insertions, 22 deletions
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx
index f30c5316036f..eb3995160422 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.cxx
@@ -54,8 +54,8 @@ connectivity::sdbcx::ObjectType connectivity::mysqlc::Tables::createObject(const
css::uno::Any aCatalog;
if (!sCatalog.isEmpty())
{
- aCatalog <<= sCatalog;
lcl_unescape(sCatalog);
+ aCatalog <<= sCatalog;
}
lcl_unescape(sSchema);
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx
index a49138be31bf..42723659d91c 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_tables.hxx
@@ -9,7 +9,6 @@
#pragma once
-#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
#include <connectivity/sdbcx/VCollection.hxx>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_views.cxx b/connectivity/source/drivers/mysqlc/mysqlc_views.cxx
index 53d23235ea29..a75a25317f8d 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_views.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_views.cxx
@@ -47,12 +47,6 @@ void connectivity::mysqlc::Views::impl_refresh()
static_cast<Catalog&>(m_rParent).refreshViews();
}
-void connectivity::mysqlc::Views::disposing()
-{
- m_xMetaData.clear();
- OCollection::disposing();
-}
-
css::uno::Reference<css::beans::XPropertySet> connectivity::mysqlc::Views::createDescriptor()
{
return new connectivity::sdbcx::OView(true, m_xMetaData);
@@ -116,15 +110,7 @@ void connectivity::mysqlc::Views::createView(
xStmt->execute(aSql);
::comphelper::disposeComponent(xStmt);
}
- /* TODO find a way to refresh view to make the new one appear right away
- // insert the new view also in the tables collection
- Tables* pTables = static_cast<Tables*>(static_cast<Catalog&>(m_rParent).getPrivateTables());
- if ( pTables)
- {
- OUString sName = ::dbtools::composeTableName( m_xMetaData, descriptor, ::dbtools::EComposeRule::InDataManipulation, false );
- pTables->appendNew(sName);
- }
-*/
+ // TODO find a way to refresh view to make the new one appear right away
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_views.hxx b/connectivity/source/drivers/mysqlc/mysqlc_views.hxx
index 708e1b24eec5..2924111284bf 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_views.hxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_views.hxx
@@ -22,19 +22,19 @@
#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
namespace connectivity::mysqlc
{
-class Views final : public sdbcx::OCollection
+class Views final : public connectivity::sdbcx::OCollection
{
css::uno::Reference<css::sdbc::XConnection> m_xConnection;
css::uno::Reference<css::sdbc::XDatabaseMetaData> m_xMetaData;
bool m_bInDrop;
- virtual sdbcx::ObjectType createObject(const OUString& _rName) override;
+ // OCollection
+ virtual connectivity::sdbcx::ObjectType createObject(const OUString& _rName) override;
virtual void impl_refresh() override;
virtual css::uno::Reference<css::beans::XPropertySet> createDescriptor() override;
virtual sdbcx::ObjectType
appendObject(const OUString& _rForName,
const css::uno::Reference<css::beans::XPropertySet>& descriptor) override;
- virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override;
void createView(const css::uno::Reference<css::beans::XPropertySet>& descriptor);
@@ -43,8 +43,8 @@ public:
::cppu::OWeakObject& _rParent, ::osl::Mutex& _rMutex,
const ::std::vector<OUString>& _rVector);
- // only the name is identical to ::cppu::OComponentHelper
- virtual void disposing() override;
+ // XDrop
+ virtual void dropObject(sal_Int32 _nPos, const OUString& _sElementName) override;
void dropByNameImpl(const OUString& elementName);
};