Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HammerDB 4.7 fails to start on Windows if 4.6 SQLite files present #512

Closed
sm-shaw opened this issue Feb 18, 2023 · 1 comment · Fixed by #513
Closed

HammerDB 4.7 fails to start on Windows if 4.6 SQLite files present #512

sm-shaw opened this issue Feb 18, 2023 · 1 comment · Fixed by #513
Assignees
Labels
bug Something isn't working

Comments

@sm-shaw
Copy link
Contributor

sm-shaw commented Feb 18, 2023

HammerDB checks version number against the SQLite files and deletes and recreates them in case of mismatch. To check the version it opens the generic.db file. On Linux we can delete a file open for read, on Windows we get permission denied, this is not caught on startup and stops HammerDB starting on Windows.

The GUI, CLI and WS init files need updating to close SQLite before deleting the files and also to catch any error messages when trying to delete.

Example as follows:

#SQLite found, check whether the schema versions from SQLite and XML are consistent
if { $sqlite_hdb_version ne $hdb_version } {
puts "The existing SQLite DBs are from version $sqlite_hdb_version. SQLite DBs will be reset to $hdb_version."
# Close SQLite before deleting else get permission denied on Windows
if { [catch {hdb close} message]} { puts "Failed to close SQLite file: $message" }
foreach { dbname } { generic database db2 mariadb mssqlserver mysql oracle postgresql } {
set dbfile [ CheckSQLiteDB $dbname ]
if { [catch {file delete $dbfile} message]} { puts "Error deleting SQLite file from $sqlite_hdb_version: $message" }
}

@sm-shaw
Copy link
Contributor Author

sm-shaw commented Feb 20, 2023

Bug also exists in v4.6 so if v4.7 has already been run and then v4.6 started it will show the same symptoms and not start.
Manual workaround is to remove the SQLite files manually from the defined directory (by default TEMP) before starting.

abondvt89 added a commit that referenced this issue Feb 21, 2023
Fix fails to delete if SQLite file open for read on Windows closes #512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant