empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele (JIRA) <empire-db-...@incubator.apache.org>
Subject [jira] [Resolved] (EMPIREDB-155) DDL Generation for dropping a database not working with HSQL
Date Mon, 04 Feb 2013 13:50:12 GMT

     [ https://issues.apache.org/jira/browse/EMPIREDB-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Rainer Döbele resolved EMPIREDB-155.

    Resolution: Fixed
      Assignee: Rainer Döbele

new property 'databaseObjectName' in DBDDLGenerator.java.
Default is: 'DATABASE' (like e.g. for SQL Server)
Oracle = "USER"

> DDL Generation for dropping a database not working with HSQL
> ------------------------------------------------------------
>                 Key: EMPIREDB-155
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-155
>             Project: Empire-DB
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: empire-db-2.4.0
>            Reporter: Eike Kettner
>            Assignee: Rainer Döbele
> When dropping a whole database a SQL script can be generated like this
>     driver.getDDLScript(DBCmdType.DROP, db, script); // db is a DBDatabase
> In case for HSQL the script 
>     DROP USER <schema>
> is created. If no schema has been provided to the DBDatabase, an IllegalArgumentException
is thrown because the scheman name is missing. This is probably doing something else than
dropping a database, but syntactically correct as HSQL doesn't complain if the schema name
is valid.
> The correct way to drop a database in HSQL is
>     DROP SCHEMA <schema> CASCADE
> Refer to the following thread on the user mailing list:
> http://mail-archives.apache.org/mod_mbox/empire-user/201208.mbox/<03E491A3-CDB3-4079-97A1-85334256C945%40j-b-s.de>
> The wrong script is created on DBDDLGenerator:219 (v2.4.0). 
> I suppose that needs to be fixed in either the HSqlDDLGenerator or DBDDLGenerator. I'm
not quite sure what to do, but I found some "inconsistencies":
> * DBDDLGenerator has a protected method "dropDatabase" that is unused (as reported by
IDEA) but overriden in OracleDDLGenerator. So maybe line 219 in DBDDLGenerator should call
"dropDatabase" instead? This could then be overriden in HSqlDDLGenerator.
> * right now line 219 in DBDDLGenerator says 
>       dropObject(((DBDatabase) dbo).getSchema(), "USER", script);
>   which is exactly how the "dropDatabase" method is overriden in OracleDDLGenerator.
I suspect this is the correct way to drop a database for Oracle dbs?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message