This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch hsqldb2
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 9b68da4e8f762358dd25eb8a39d657718cb6676e
Author: Pedro Giffuni <=>
AuthorDate: Wed Oct 28 21:57:00 2026 -0500
Fix HSQLDB 1.8.0 database conversion: remove overly strict shutdown check
The bModified && bAskUser check blocked conversion of 1.8.0 databases
that had 'modified=yes' in their properties file. AOO does not perform
a clean HSQLDB SHUTDOWN when closing embedded connections (it only
closes the connection), so modified=yes is the normal state for these
databases. This created a catch-22: the database could not be opened
for conversion because it was not shut down cleanly, but it could not be
shut down cleanly because it could not be opened.
HSQLDB 2.5.0 automatically recovers databases that were not cleanly shut
down, so this check is unnecessary. The version detection and conversion
prompt now work as intended.
---
.../connectivity/source/drivers/hsqldb/HDriver.cxx | 38 +++++++---------------
1 file changed, 11 insertions(+), 27 deletions(-)
diff --git a/main/connectivity/source/drivers/hsqldb/HDriver.cxx
b/main/connectivity/source/drivers/hsqldb/HDriver.cxx
index 9537b25777..d7af4fadba 100644
--- a/main/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/main/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -271,7 +271,7 @@ namespace connectivity
aProperties.put( "jdbc.interval_as_varchar",
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
aProperties.put( "get_column_name",
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) ) );
- bool bAskUser = false,bModified = false;
+ bool bAskUser = false;
::rtl::OUString sMessage;
::rtl::OUString sProperties( RTL_CONSTASCII_USTRINGPARAM(
"properties" ) );
try
@@ -292,25 +292,16 @@ namespace connectivity
continue;
const ByteString sIniKey = sLine.GetToken(
0, '=' );
const ByteString sValue = sLine.GetToken(
1, '=' );
- if ( sIniKey.Equals(
"hsqldb.compatible_version" ) )
- {
- sVersionString = sValue;
- }
- else if
( sLine.Equals("modified=yes",0,sizeof("modified=yes")-1) )
- {
-
bModified = true;
- }
- else
- {
- if ( ( sVersionString.Len() == 0 )
-
&& sIniKey.Equals( "version" )
- )
- {
- sVersionString = sValue;
- }
- }
- }
- if ( sVersionString.Len() )
+ if ( sIniKey.Equals(
"hsqldb.compatible_version" ) )
+ {
+ sVersionString = sValue;
+ }
+ else if ( sVersionString.Len() == 0 &&
sIniKey.Equals( "version" ) )
+ {
+ sVersionString = sValue;
+ }
+ }
+ if ( sVersionString.Len() )
{
const
sal_Int32 nMajor = sVersionString.GetToken(0,'.').ToInt32();
const
sal_Int32 nMinor = sVersionString.GetToken(1,'.').ToInt32();
@@ -337,13 +328,6 @@ namespace connectivity
{
::dbtools::throwGenericSQLException(sMessage ,*this);
}
- // check if database was shutdown correctly
before converting to new a version
- if ( bModified && bAskUser )
- {
- ::connectivity::SharedResources
aResources;
- const ::rtl::OUString sShutdownMessage
= aResources.getResourceString(STR_SHUTDOWN_REQUIRED);
-
::dbtools::throwGenericSQLException(sShutdownMessage ,*this);
- }
// need to convert file, ask for user
approvement
if ( xInteraction.is() && bAskUser )
{