diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2022-03-12 13:59:48 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2022-03-12 17:52:27 +0100 |
commit | eff9dc65b88ca48171e9e6ab51f1e2ec8d0f436d (patch) | |
tree | de098c4af5eb0f3420667ab5162a35a47447df8f /connectivity | |
parent | 5c532b42fb3f61257bf8edce4b3dcb21810f780e (diff) |
tdf#147309: Recreating a view with same name and in the same session fails (FB)
Since HSQLDB already worked, just do the same.
Change-Id: I44929cf36179cc3cdff6e61f05899c9a913c78b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131442
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/firebird/Catalog.hxx | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Tables.cxx | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/connectivity/source/drivers/firebird/Catalog.hxx b/connectivity/source/drivers/firebird/Catalog.hxx index b6bf02f6b69d..3ffb9238eda7 100644 --- a/connectivity/source/drivers/firebird/Catalog.hxx +++ b/connectivity/source/drivers/firebird/Catalog.hxx @@ -32,6 +32,7 @@ namespace connectivity::firebird virtual void refreshUsers() override; sdbcx::OCollection* getPrivateTables() const { return m_pTables.get(); } + sdbcx::OCollection* getPrivateViews() const { return m_pViews.get(); } }; } // namespace connectivity::firebird diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx index 9c59f65f436c..6914a2faf847 100644 --- a/connectivity/source/drivers/firebird/Tables.cxx +++ b/connectivity/source/drivers/firebird/Tables.cxx @@ -9,6 +9,7 @@ #include "Table.hxx" #include "Tables.hxx" +#include "Views.hxx" #include "Catalog.hxx" #include <TConnection.hxx> @@ -202,6 +203,13 @@ void Tables::dropObject(sal_Int32 nPosition, const OUString& sName) m_xMetaData->getConnection()->createStatement()->execute( "DROP " + sType + " " + ::dbtools::quoteName(sQuoteString,sName)); + + if (sType == "VIEW") + { + Views* pViews = static_cast<Views*>(static_cast<Catalog&>(m_rParent).getPrivateViews()); + if ( pViews && pViews->hasByName(sName) ) + pViews->dropByNameImpl(sName); + } } void connectivity::firebird::Tables::appendNew(const OUString& _rsNewTable) |