dbaccess/source/core/dataaccess/datasource.cxx | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+)
New commits: commit 0b3ee8ffbb6b33827c17af56c62dc5285f3ba258 Author: Xisco FaulĂ <xiscofa...@libreoffice.org> AuthorDate: Mon Jul 16 18:18:12 2018 +0200 Commit: Miklos Vajna <vmik...@collabora.co.uk> CommitDate: Wed Jul 18 09:13:42 2018 +0200 tdf#118752: Enable firebird migration in experimental mode Only in 6.1 Revert "Disable migration in this release" This reverts commit 443da1959d02569c59d064748a06d39c6dbb2f64. Change-Id: Ib3286b01205ac5360aa299346ee524825e739167 Reviewed-on: https://gerrit.libreoffice.org/57508 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 4689d2594773..22c7f6685d1a 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -27,6 +27,7 @@ #include "SharedConnection.hxx" #include "databasedocument.hxx" #include <OAuthenticationContinuation.hxx> +#include <svtools/miscopt.hxx> #include <hsqlimport.hxx> #include <migrwarndlg.hxx> @@ -583,6 +584,27 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString Reference< XDriverManager > xManager; +#if ENABLE_FIREBIRD_SDBC + bool bNeedMigration = false; + SvtMiscOptions aMiscOptions; + + if( aMiscOptions.IsExperimentalMode() && m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb" ) + { + OUString sMigrEnvVal; + osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData, + &sMigrEnvVal.pData); + if(!sMigrEnvVal.isEmpty()) + bNeedMigration = true; + else + { + MigrationWarnDialog aWarnDlg{nullptr}; + bNeedMigration = aWarnDlg.run() == RET_OK; + } + if (bNeedMigration) + m_pImpl->m_sConnectURL = "sdbc:embedded:firebird"; + } +#endif + try { xManager.set( ConnectionPool::create( m_pImpl->m_aContext ), UNO_QUERY_THROW ); } catch( const Exception& ) { } @@ -694,6 +716,17 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) ); } +#if ENABLE_FIREBIRD_SDBC + if( bNeedMigration ) + { + Reference< css::document::XDocumentSubStorageSupplier> xDocSup( + m_pImpl->getDocumentSubStorageSupplier() ); + dbahsql::HsqlImporter importer(xReturn, + xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE) ); + importer.importHsqlDatabase(); + } +#endif + return xReturn; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits