fix: Inaccurate drop database statement in Oracle #1807
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following test fails when run locally with Oracle:
CreateDatabaseTest/'create database test'()
The first failure
ORA-01501: CREATE DATABASE failed, ORA-01100: database already mounted
occurs because the create statement is executed while a database already exists. This occurs because thedropDatabase()
statement executed in the try block fails as the syntax is not correct.Once the syntax is fixed, the test still fails with error
ORA-65040: operation not allowed from within a pluggable database
because certain operations, including dropping the DB, need to be performed only at the root container level.Attempting to fix this with
exec("ALTER SESSION SET CONTAINER=CDB\$ROOT")
then fails with errorORA-01031: insufficient privileges
. This is in spite of the test container connection being setup usingsys as sysdba
and granting all privileges to user.The documentation confirms that dropping a database requires certain conditions:
Attempting to execute variants of the following statements doesn't work either (most likely because they are SQL*PLUS CLI commands):
Oracle has been excluded from this test.