Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #36226 Back to Issue ]
Summary 0036226: On first install.source don't show SQLException when 'drop role' tries to delete a role which does not exist
Revision 2018-02-14 12:00 by AugustoMauch
Description In short:
Some SQL commands at start of create.database are allowed to fail with the process continuing. However SQLException are shown which are confusing + annoying to log-checking and should be avoided.

First part of create.database (and indirectly install.source) is to delete + recreate the role + database by doing:

1.) drop database if not exists
2.) drop role

3.) create role
4.) create database

Config is that steps 1-3 can fail but step 4 must suceed.

Failure of 1+2 can be because first install and both user+role do not exist

Failure of 2+3 are possible (at least on postgres) by sharing a user for >=2 databases. Then while dropping db1 + then trying to drop the user this will fail as the 2nd database still exists. Consequently then the create role will also fail as the 'old' role still exists. The error messages shown in this case are acceptable.

However all that above are issues which are already 'correctly' ignored as if the main database in step 4 is created + owned by the role all is fine.

Revision 2018-02-14 10:19 by AugustoMauch
Description In short:
Some SQL commands at start of create.database are allowed to fail with the process continuing. However SQLException are shown which are confusing + annoying to log-checking and should be avoided.

First part of create.database (and indirectly install.source) is to delete + recreate the role + database by doing:

1.) drop database if not exists
2.) drop role

3.) create role
4.) create database

Config is that steps 1-3 can fail but step 4 must suceed.

Failure of 1+2 can be because first install and both user+role do not exist
Failure of 2+3 are possible (at least on postgres) by sharing a user for >=2 databases. Then while dropping db1 + then trying to drop the user this will fail as the 2nd database still exists. Consequently then the create role will also fail as the 'old' role still exists.

However all that above are issues which are already 'correctly' ignored as if the main database in step 4 is created + owned by the role all is fine.

Revision 2017-06-12 13:33 by shuehner
Steps To Reproduce run create.database with user+database name used first ever.
Observe SQLExceptions shown during:
- clean.database.*
- *.structure

with * being either POSTGRE or ORACLE:

Example error output:
a.) postgres
clean.database.POSTGRE:
      [sql] Executing commands
      [sql] 1 of 1 SQL statements executed successfully
      [sql] Executing commands
      [sql] Failed to execute: DROP ROLE tadpi
      [sql] org.postgresql.util.PSQLException: ERROR: role "tadpi" does not exist
      [sql] 0 of 1 SQL statements executed successfully

b.) oracle
clean.database.ORACLE:
      [sql] Executing commands
      [sql] Failed to execute: DROP USER tadpiora CASCADE
      [sql] java.sql.SQLSyntaxErrorException: ORA-01918: user 'TADPIORA' does not exist
      [sql] 0 of 1 SQL statements executed successfully
Revision 2017-06-12 13:17 by shuehner
Steps To Reproduce run create.database with user+database name used first ever.
Observe SQLExceptions shown during:
- clean.database.*
- *.structure

with * being either POSTGRE or ORACLE


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker