Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 10836 invoked from network); 31 Oct 2005 21:56:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Oct 2005 21:56:39 -0000 Received: (qmail 54150 invoked by uid 500); 31 Oct 2005 21:56:38 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 54121 invoked by uid 500); 31 Oct 2005 21:56:38 -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 54109 invoked by uid 99); 31 Oct 2005 21:56:37 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2005 13:56:37 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.36] (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2005 13:56:33 -0800 Received: from phys-d3-ha21sca-2 ([129.145.155.165]) by brmea-mail-4.sun.com (8.12.10/8.12.9) with ESMTP id j9VLuGD7014638 for ; Mon, 31 Oct 2005 14:56:16 -0700 (MST) Received: from conversion-daemon.ha21sca-mail1.sfbay.sun.com by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IP800201VIJAR@ha21sca-mail1.sfbay.sun.com> (original mail from Richard.Hillegas@Sun.COM) for derby-dev@db.apache.org; Mon, 31 Oct 2005 13:56:40 -0800 (PST) Received: from [129.150.32.44] (vpn-129-150-32-44.Central.Sun.COM [129.150.32.44]) by ha21sca-mail1.sfbay.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IP800K4WVMG4Z@ha21sca-mail1.sfbay.sun.com> for derby-dev@db.apache.org; Mon, 31 Oct 2005 13:56:40 -0800 (PST) Date: Mon, 31 Oct 2005 13:56:15 -0800 From: Rick Hillegas Subject: Re: [jira] Commented: (DERBY-85) NPE when creating a trigger on a table and default schema doesn't exist. In-reply-to: <43668FE4.3070202@sun.com> To: derby-dev@db.apache.org Message-id: <436692FF.2070504@sun.com> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) References: <23645502.1130793776595.JavaMail.jira@ajax.apache.org> <43668FE4.3070202@sun.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Yep, Windows it was. Cheers, -Rick David W. Van Couvering wrote: > How did you get derbyall to pass with all the failures we are having > right now? Did you run on Windows? > > Thanks, > > David > > Rick Hillegas (JIRA) wrote: > >> [ >> http://issues.apache.org/jira/browse/DERBY-85?page=comments#action_12356444 >> ] >> Rick Hillegas commented on DERBY-85: >> ------------------------------------ >> >> Derbyall passed. When a new patch is submitted including a regression >> test, I'll just run the appropriate suite. >> >> >>> NPE when creating a trigger on a table and default schema doesn't >>> exist. >>> ------------------------------------------------------------------------ >>> >>> >>> Key: DERBY-85 >>> URL: http://issues.apache.org/jira/browse/DERBY-85 >>> Project: Derby >>> Type: Bug >>> Components: SQL >>> Versions: 10.0.2.0 >>> Reporter: A B >>> Assignee: Dyre Tjeldvoll >>> Attachments: derby-85-notabs.diff, derby-85.diff, derby-85.stat, >>> derbyall_report.txt >>> >>> BACKGROUND: >>> When connecting to a Derby db with a user id and password, the >>> default schema is USER. For example, if I connect with: >>> ij> connect 'jdbc:derby:myDB;user=someUser;password=somePwd'; >>> then the default schema is "SOMEUSER". >>> PROBLEM: >>> It turns out that if a table t1 exists in a non-default schema and >>> the default schema (in this case, "SOMEUSER") doesn't exist yet >>> (because no objects have been created in that schema), then attempts >>> to create a trigger on t1 using its qualified name will lead to a >>> null pointer exception in the Derby engine. >>> REPRO: >>> In ij: >>> -- Create database with default schema "SOMEUSER". >>> ij> connect >>> 'jdbc:derby:myDB;create=true;user=someUser;password=somePwd'; >>> -- Create table t1 in a non-default schema; in this case, call it >>> "ITKO". >>> ij> create table itko.t1 (i int); >>> 0 rows inserted/updated/deleted >>> -- Now schema ITKO exists, and T1 exists in schema ITKO, but default >>> schema SOMEUSER does NOT exist, because we haven't created any >>> objects in that schema yet. >>> -- So now we try to create a trigger in the ITKO (i.e. the >>> non-default) schema... >>> ij> create trigger trig1 after update on itko.t1 for each row mode >>> db2sql select * from sys.systables; >>> ERROR XJ001: Java exception: ': java.lang.NullPointerException'. >>> A look at the derby.log file shows the stack trace given below. In >>> a word, it looks like the "compilation schema" field of >>> SYS.SYSTRIGGERS isn't getting set, and so it ends up being null. >>> That causes the NPE in subsequent processing... >>> java.lang.NullPointerException >>> at >>> org.apache.derby.impl.sql.catalog.SYSSTATEMENTSRowFactory.makeSYSSTATEMENTSrow(SYSSTATEMENTSRowFactory.java:200) >>> >>> at >>> org.apache.derby.impl.sql.catalog.DataDictionaryImpl.addSPSDescriptor(DataDictionaryImpl.java:2890) >>> >>> at >>> org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.createSPS(CreateTriggerConstantAction.java:354) >>> >>> at >>> org.apache.derby.impl.sql.execute.CreateTriggerConstantAction.executeConstantAction(CreateTriggerConstantAction.java:258) >>> >>> at >>> org.apache.derby.impl.sql.execute.MiscResultSet.open(MiscResultSet.java:56) >>> >>> at >>> org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:366) >>> >>> at >>> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1100) >>> >>> at >>> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:509) >>> >>> at >>> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:467) >>> >>> at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:299) >>> 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:210) >>> at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:176) >>> at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:56) >>> at org.apache.derby.tools.ij.main(ij.java:60) >> >> >>