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

make the "create database" feature in the schema build an option instead of a default/mandatory action #548

Closed
guidoverbraak opened this issue Apr 25, 2023 · 2 comments · Fixed by #560
Assignees

Comments

@guidoverbraak
Copy link

When using the "schema build" for a Db2 database, using an existing database or cataloged remote database is no longer default and will return an error if the database already exists. It used to work like this without a problem in earlier releases.

Since there are no options to manipulate the create database command or have a database created remotely, this option is not really helping to set up a database which has some special needs.

If the database already exists, the schema build code should not end with an error but use the current existing database or ask for a drop/recreate action.

@memmertoIBM
Copy link
Contributor

This is a byproduct of the recent change to create a DB2 database automatically (in HammerDB 4.7, IIRC) as a result of adding missing pieces to the db2tcl interface.

Prior to this, Db2 users always had to create their database explicitly, and then point HammerDB at it.

The ability to "use existing database" would be a useful enhancement, as there are some database creation modes that are not covered by the C / TCL "create database" API, and there are scenarios (ie, cloud) where the (empty) database is pre-created for you.

@sm-shaw
Copy link
Contributor

sm-shaw commented Apr 26, 2023

Many thanks @memmertoIBM for the additional explanation, now I understand. Yes, we introduced changes in v4.7 so we could have a single script for all the supported databases that would do build, run and delete without additional steps being required. So you can just grab the Docker image and then run the test as described here (although for Db2 this licensing issue #404 means you have to install the Db2 driver manually as it is not clear whether it is redistributable or not).

So hopefully it should be straightforward to add a check to see if the database already exists and make sure it is empty and skip the creation step if it does, as we already do this for some of the other databases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants