Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 60237 invoked from network); 27 Aug 2006 06:47:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Aug 2006 06:47:43 -0000 Received: (qmail 12358 invoked by uid 500); 27 Aug 2006 06:47:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 12336 invoked by uid 500); 27 Aug 2006 06:47:43 -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 12327 invoked by uid 99); 27 Aug 2006 06:47:42 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 26 Aug 2006 23:47:42 -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; Sat, 26 Aug 2006 23:47:42 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EC20741000C for ; Sun, 27 Aug 2006 06:44:23 +0000 (GMT) Message-ID: <22223903.1156661063964.JavaMail.jira@brutus> Date: Sat, 26 Aug 2006 23:44:23 -0700 (PDT) From: "Bryan Pendleton (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-1583) With grant revoke enabled, defining a trigger whose actions updates a table (from different schema) results in NPE In-Reply-To: <19035277.1153807274818.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-1583?page=all ] Bryan Pendleton updated DERBY-1583: ----------------------------------- Attachment: setTableDescriptor.diff Sorry about the bad attachment, Yip, thanks for catching it. Let's try this again: attaching setTableDescriptor.diff (again), this time with the actual diff. Meanwhile, my derbyall run completed, and I did have one failure, so I'll need to investigate this to see if it was caused by the patch: ********* Diff file derbyall/derbylang/update.diff *** Start: update jdk1.4.2_11 derbyall:derbylang 2006-08-26 14:42:38 *** 587 del < ERROR 42X04: Column 'DERBY10431.A_COL' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'DERBY10431.A_COL' is not a column in the target table. 587a587 > 1 row inserted/updated/deleted Test Failed. > With grant revoke enabled, defining a trigger whose actions updates a table (from different schema) results in NPE > ------------------------------------------------------------------------------------------------------------------ > > Key: DERBY-1583 > URL: http://issues.apache.org/jira/browse/DERBY-1583 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.2.1.0 > Reporter: Mamta A. Satoor > Assigned To: Bryan Pendleton > Fix For: 10.2.1.0 > > Attachments: setTableDescriptor.diff, setTableDescriptor.diff > > > While working on SQL authorization work, I ran across a test case where Derby will throw a NPE when a trigger is defined with it's action as update a table from another schema. I don't have much details on why but following is the test case. Derby is trying to put privilege requirement for a column into privilege requirements list and it expects the column's tableUUID to be not null but in this particular case, it is null. > connect 'jdbc:derby:c:/dellater/dbmain;create=true' user 'mamta1' as mamta1; > create table t11TriggerRevokeTest (c111 int not null primary key, c12 int); > grant TRIGGER on t11TriggerRevokeTest to mamta2; > create table t12TriggerRevokeTest (c121 int, c122 int, c123 int); > grant UPDATE(c122, c121) on t12TriggerRevokeTest to mamta2; > connect 'jdbc:derby:c:/dellater/dbmain;create=true' user 'mamta2' as mamta2; > create trigger tr11t11 after insert on mamta1.t11TriggerRevokeTest for each statement mode db2sql > update mamta1.t12TriggerRevokeTest set c122 = 99; > The stack trace looks as follows > ij(MAMTA2)> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.java.lang.NullPointerException > at org.apache.derby.impl.sql.compile.CompilerContextImpl.addRequiredColumnPriv(CompilerContextImpl.java:741) > at org.apache.derby.impl.sql.compile.ResultColumn.bindResultColumnByName(ResultColumn.java:682) > at org.apache.derby.impl.sql.compile.ResultColumnList.bindResultColumnsByName(ResultColumnList.java:635) > at org.apache.derby.impl.sql.compile.ResultSetNode.bindResultColumns(ResultSetNode.java:682) > at org.apache.derby.impl.sql.compile.SelectNode.bindResultColumns(SelectNode.java:751) > at org.apache.derby.impl.sql.compile.UpdateNode.bind(UpdateNode.java:348) > at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:344) > at org.apache.derby.impl.sql.GenericStatement.prepareStorable(GenericStatement.java:591) > at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.compileStatement(SPSDescriptor.java:353) > at org.apache.derby.iapi.sql.dictionary.SPSDescriptor.prepareAndRelease(SPSDescriptor.java:283) > at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(CreateTriggerConstantAction.java:367) > at org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(CreateTriggerConstantAction.java:272) > at org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:56) > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:357) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1181) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:584) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:516) > at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:313) > at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:433) > at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:310) > at org.apache.derby.impl.tools.ij.Main.go(Main.java:207) > at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:173) > at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55) > at org.apache.derby.tools.ij.main(ij.java:60) -- 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