summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2018-06-26 13:45:40 +0200
committerTamás Bunth <btomi96@gmail.com>2018-07-06 13:56:58 +0200
commit9ceeb4619ba762c47589023d99c43c774caab441 (patch)
tree389c9153582052f1f24c3029f510ac5fc3d1f38e /dbaccess
parent9eb929aa8cb3f5b0fee1264119a55cdd8cbe8f0e (diff)
HSQLDB Migration: overwrite backup xml
Change-Id: I080568f2d278e8a7153188497e3987217d9d188f Reviewed-on: https://gerrit.libreoffice.org/56464 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 29d5816bc043..597c5a6d560b 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -599,8 +599,12 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
{
// back up content xml file if migration was successful
Reference<XStorage> xRootStorage = m_pImpl->getOrCreateRootStorage();
+
+ constexpr char BACKUP_XML_NAME[] = "content_before_migration.xml";
+ if(xRootStorage->isStreamElement(BACKUP_XML_NAME))
+ xRootStorage->removeElement(BACKUP_XML_NAME);
xRootStorage->copyElementTo("content.xml", xRootStorage,
- "content_before_migration.xml");
+ BACKUP_XML_NAME);
m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
}