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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036226
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2017-06-12 13:172018-03-14 04:59
ReportershuehnerView Statuspublic 
Assigned ToAugustoMauch 
PriorityurgentResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revision15559dddfaad
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tocaristu
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036226: On first install.source don't show SQLException when 'drop role' tries to delete a role which does not exist

DescriptionIn 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.

Steps To Reproducerun 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
Proposed SolutionAvoid the exception by using 'not exists' form of drop commands which does not error out if the db object does not exist.
TagsNo tags attached.
Attached Filespatch file icon 32514.patch [^] (2,434 bytes) 2017-07-27 12:39 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
blocks design defect 0036162 acknowledgedTriage Platform Base clean up openbravo.log 

-  Notes
(0102400)
hgbot (developer)
2018-02-14 13:37

Repository: erp/devel/pi
Changeset: 15559dddfaad50d6fe3ff863ee8df2a362f7fc02
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Wed Feb 14 13:35:37 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/15559dddfaad50d6fe3ff863ee8df2a362f7fc02 [^]

Fixes issue 36226: No error is shown on install.source if role does not exist

Now if the role/user does not exist in postgresql/oracle when invoking install.source, no error message will be shown:
- In postgresql, the role is only dropped if exists
- Oracle does not have the IF EXISTS clause, so the dba_users table is queried to check if a user with the given name exists.

---
M src-db/database/build-create.xml
---
(0102758)
hudsonbot (developer)
2018-02-22 18:19

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/980a6ad5bbf5 [^]
Maturity status: Test
(0103181)
hgbot (developer)
2018-03-13 10:29

Repository: erp/devel/pi
Changeset: a3ad3bc6723d0d1636f397a4dd30a92305615db4
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Mar 13 10:28:31 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a3ad3bc6723d0d1636f397a4dd30a92305615db4 [^]

Related with issue 36226: Be coherent when querying users in dba_users

The query done to the dba_users table in clean.database.ORACLE is case insensitive, the query done to the
same table in ORACLE.structure should be case insensitive too.

---
M src-db/database/build-create.xml
---
(0103182)
caristu (developer)
2018-03-13 10:59

Code reviewed + tested OK both in PG and ORA.
(0103221)
hudsonbot (developer)
2018-03-14 04:59

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b735f51dc9bc [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-06-12 13:17 shuehner New Issue
2017-06-12 13:17 shuehner Assigned To => platform
2017-06-12 13:17 shuehner Modules => Core
2017-06-12 13:17 shuehner Triggers an Emergency Pack => No
2017-06-12 13:33 shuehner Steps to Reproduce Updated View Revisions
2017-06-16 11:26 alostale Relationship added blocks 0036162
2017-06-16 11:26 alostale Status new => acknowledged
2017-06-28 07:30 hgbot Checkin
2017-06-28 07:30 hgbot Note Added: 0097728
2017-06-28 07:30 hgbot Status acknowledged => resolved
2017-06-28 07:30 hgbot Resolution open => fixed
2017-06-28 07:30 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d39f80176463d1f9beeec3720e9d980121265d97 [^]
2017-06-28 13:48 asiermartirena Status resolved => new
2017-06-28 13:48 asiermartirena Resolution fixed => open
2017-06-28 13:48 asiermartirena Status new => acknowledged
2017-06-28 13:49 asiermartirena Note Added: 0097738
2017-06-28 18:24 asiermartirena Note Edited: 0097738 View Revisions
2017-07-27 12:39 staffrm File Added: 32514.patch
2018-02-14 10:19 alostale Priority normal => urgent
2018-02-14 10:38 AugustoMauch Note Deleted: 0097728
2018-02-14 10:38 AugustoMauch Note Deleted: 0097738
2018-02-14 12:00 AugustoMauch Description Updated View Revisions
2018-02-14 13:36 AugustoMauch Review Assigned To => caristu
2018-02-14 13:37 hgbot Checkin
2018-02-14 13:37 hgbot Note Added: 0102400
2018-02-14 13:37 hgbot Status acknowledged => resolved
2018-02-14 13:37 hgbot Resolution open => fixed
2018-02-14 13:37 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/d39f80176463d1f9beeec3720e9d980121265d97 [^] => http://code.openbravo.com/erp/devel/pi/rev/15559dddfaad50d6fe3ff863ee8df2a362f7fc02 [^]
2018-02-22 18:19 hudsonbot Checkin
2018-02-22 18:19 hudsonbot Note Added: 0102758
2018-02-28 16:23 caristu Assigned To platform => AugustoMauch
2018-03-13 10:29 hgbot Checkin
2018-03-13 10:29 hgbot Note Added: 0103181
2018-03-13 10:59 caristu Note Added: 0103182
2018-03-13 10:59 caristu Status resolved => closed
2018-03-13 10:59 caristu Fixed in Version => 3.0PR18Q2
2018-03-14 04:59 hudsonbot Checkin
2018-03-14 04:59 hudsonbot Note Added: 0103221


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker