Return-Path: X-Original-To: apmail-empire-db-commits-archive@www.apache.org Delivered-To: apmail-empire-db-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B5AE3DFFE for ; Thu, 9 Aug 2012 15:40:19 +0000 (UTC) Received: (qmail 29068 invoked by uid 500); 9 Aug 2012 15:40:19 -0000 Delivered-To: apmail-empire-db-commits-archive@empire-db.apache.org Received: (qmail 28979 invoked by uid 500); 9 Aug 2012 15:40:19 -0000 Mailing-List: contact commits-help@empire-db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-dev@empire-db.apache.org Delivered-To: mailing list commits@empire-db.apache.org Received: (qmail 28894 invoked by uid 500); 9 Aug 2012 15:40:19 -0000 Delivered-To: apmail-incubator-empire-db-commits@incubator.apache.org Received: (qmail 28751 invoked by uid 99); 9 Aug 2012 15:40:19 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Aug 2012 15:40:19 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 368D6142820 for ; Thu, 9 Aug 2012 15:40:19 +0000 (UTC) Date: Thu, 9 Aug 2012 15:40:19 +0000 (UTC) From: "Eike Kettner (JIRA)" To: empire-db-commits@incubator.apache.org Message-ID: <1063298342.2125.1344526819225.JavaMail.jiratomcat@issues-vm> In-Reply-To: <874335785.2075.1344526339022.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (EMPIREDB-155) DDL Generation for dropping a database not working with HSQL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/EMPIREDB-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Eike Kettner updated EMPIREDB-155: ---------------------------------- Description: 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 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 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? was: 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 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 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? > 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 > > 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 > 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 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira