Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 7147 invoked from network); 7 Sep 2006 20:06:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 7 Sep 2006 20:06:03 -0000 Received: (qmail 13911 invoked by uid 500); 7 Sep 2006 20:06:02 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 13690 invoked by uid 500); 7 Sep 2006 20:06:02 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 13680 invoked by uid 99); 7 Sep 2006 20:06:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 13:06:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 13:06:01 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3C43C7142FD for ; Thu, 7 Sep 2006 20:02:23 +0000 (GMT) Message-ID: <18322728.1157659343220.JavaMail.jira@brutus> Date: Thu, 7 Sep 2006 13:02:22 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Commented: (DERBY-1589) CREATE TABLE throws NullPointerException in Derby SQL Standard Authorization after DROPs and REVOKES In-Reply-To: <33506101.1153859293897.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-1589?page=comments#action_12433215 ] Mamta A. Satoor commented on DERBY-1589: ---------------------------------------- I noticed that the stack trace for null pointer exception was not included in this jira entry. So, I ran the following sql script using ij in the trunk connect 'jdbc:derby:c:/dellater/dbmaintest2;create=true' user 'mamta1' as mamta1; create table t11ConstraintTest (c111 int not null, c112 int not null, primary key (c111, c112)); grant references on t11ConstraintTest to mamta3; connect 'jdbc:derby:c:/dellater/dbmaintest2;create=true' user 'mamta3' as mamta3; drop table t31ConstraintTest; create table t31ConstraintTest (c311 int, c312 int, foreign key(c311, c312) references mamta1.t11ConstraintTest); drop table t31ConstraintTest; set connection mamta1; drop table t11ConstraintTest; create table t11ConstraintTest (c111 int not null, c112 int not null, primary key (c111, c112)); grant references(c111) on t11ConstraintTest to mamta3; grant references(c112) on t11ConstraintTest to PUBLIC; set connection mamta3; drop table t31ConstraintTest; create table t31ConstraintTest (c311 int, c312 int, foreign key(c311, c312) references mamta1.t11ConstraintTest); And the last create table always gave null pointer exception. The stack trace looks as follows at org.apache.derby.iapi.sql.dictionary.TablePermsDescriptor.(TablePermsDescriptor.java:70) at org.apache.derby.iapi.sql.dictionary.TablePermsDescriptor.(TablePermsDescriptor.java:81) at org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getTablePermissions(DataDictionaryImpl.java:9962) at org.apache.derby.iapi.sql.dictionary.StatementTablePermission.oneAuthHasPermissionOnTable(StatementTablePermission.java:148) at org.apache.derby.iapi.sql.dictionary.StatementTablePermission.hasPermissionOnTable(StatementTablePermission.java:141) at org.apache.derby.iapi.sql.dictionary.StatementColumnPermission.check(StatementColumnPermission.java:94) at org.apache.derby.impl.sql.conn.GenericAuthorizer.authorize(GenericAuthorizer.java:158) at org.apache.derby.impl.sql.execute.GenericResultSetFactory.getDDLResultSet(GenericResultSetFactory.java:1020) at org.apache.derby.impl.sql.execute.ConstantActionActivation.execute(ConstantActionActivation.java:54) at org.apache.derby.impl.sql.GenericActivationHolder.execute(GenericActivationHolder.java:327) at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:356) at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1182) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:585) at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517) at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:321) at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:517) at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:370) at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:268) at org.apache.derby.impl.tools.ij.Main.go(Main.java:204) at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:170) at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56) at org.apache.derby.tools.ij.main(ij.java:71) > CREATE TABLE throws NullPointerException in Derby SQL Standard Authorization after DROPs and REVOKES > ---------------------------------------------------------------------------------------------------- > > Key: DERBY-1589 > URL: http://issues.apache.org/jira/browse/DERBY-1589 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.2.1.0 > Reporter: Daniel John Debrunner > Fix For: 10.2.1.0 > > > Currently, the last sql statement in following set of sql statements will raise a null pointer exception > connect 'jdbc:derby:c:/dellater/dbmaintest2;create=true' user 'mamta1' as mamta1; > create table t11ConstraintTest (c111 int not null, c112 int not null, primary key (c111, c112)); > grant references on t11ConstraintTest to mamta3; > connect 'jdbc:derby:c:/dellater/dbmaintest2;create=true' user 'mamta3' as mamta3; > drop table t31ConstraintTest; > -- the following statement should remember that it depends on REFERENCES privilege on mamta1.t11ConstraintTest > create table t31ConstraintTest (c311 int, c312 int, foreign key(c311, c312) references mamta1.t11ConstraintTest); > drop table t31ConstraintTest; > set connection mamta1; > -- following should revoke all the privileges granted on it > drop table t11ConstraintTest; > create table t11ConstraintTest (c111 int not null, c112 int not null, primary key (c111, c112)); > grant references(c111) on t11ConstraintTest to mamta3; > grant references(c112) on t11ConstraintTest to PUBLIC; > --connect 'jdbc:derby:c:/dellater/dbmaintest2;create=true' user 'mamta3' as mamta3; > set connection mamta3; > drop table t31ConstraintTest; > -- following sql should recompie itself because the earlier plan depended on a privilege which doesn't > -- exist anymore. Instead, new privileges have been granted and the plan for following statement should depend > -- on those new privileges > create table t31ConstraintTest (c311 int, c312 int, foreign key(c311, c312) references mamta1.t11ConstraintTest); -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira