You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Rick Hillegas (JIRA)" <de...@db.apache.org> on 2005/09/20 02:01:28 UTC

[jira] Created: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Grouped select from temporary table raises null pointer exception in byte code generator
----------------------------------------------------------------------------------------

         Key: DERBY-578
         URL: http://issues.apache.org/jira/browse/DERBY-578
     Project: Derby
        Type: Bug
    Reporter: Rick Hillegas


The last statement in the following script:

autocommit off;

declare global temporary table session.ztemp
( orderID varchar( 50 ) )
not logged;

select orderID from session.ztemp group by orderID;

raises the following stack trace in the trunk:

java.lang.NullPointerException

	at java.util.Hashtable.get(Hashtable.java:333)

	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)

	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)

	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)

	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)

	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)

	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)

	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)

	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)

	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)

	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)

	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)

	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)

	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)

	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)

	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)

	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)

	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)

	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)

	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:203)

	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)

	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


Re: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Myrna van Lunteren <m....@gmail.com>.
On 6/6/06, Kathey Marsden <km...@sbcglobal.net> wrote:
> Manish Khettry wrote:
> Hi Manish,
>
> Checking the patch available box  can help get reviewers/committers
> attention.
> http://issues.apache.org/jira/secure/ConfigureReport.jspa?filterid=12310751&mapper=assignees&selectedProjectId=10594&reportKey=com.atlassian.jira.plugin.system.reports%3Asinglelevelgroupby&Next=Next
>
> We seem to have quite a few and quite a few UNASSIGNED and I think maybe
> out of date.
[...snip...]
> and the ever hard working
> Unassigned.

I had a look at the unassigneds, and my attention was caught by
DERBY-654. Unassigned is correct, patch was to disable the running of
a test under a specific jvm and has been committed, so I took off the
patch available check for that one.

Myrna

Re: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Kathey Marsden <km...@sbcglobal.net>.
Manish Khettry wrote:

> Just wondering if any of the commiters had seen this and were planning 
> to commit this patch?

Hi Manish,

Checking the patch available box  can help get reviewers/committers 
attention.

Speaking  of patch available ...
http://issues.apache.org/jira/secure/ConfigureReport.jspa?filterid=12310751&mapper=assignees&selectedProjectId=10594&reportKey=com.atlassian.jira.plugin.system.reports%3Asinglelevelgroupby&Next=Next

We seem to have quite a few and quite a few UNASSIGNED and I think maybe 
out of date. 
The patch report shows patches for the following contributors.

A B
Andreas Korneliussen
Deepa Remesh
Dyre Tjeldvoll
Fernanda Pizzorno
John Embretsen
Kristian Waagan
Myrna van Lunteren
Satheesh Bandaram
and the ever hard working
Unassigned.

Take a look if you think you should be on this list or if you are on 
this list but don't think you have a patch oustanding.

Kathey



Re: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Manish Khettry <ma...@gmail.com>.
Just wondering if any of the commiters had seen this and were planning to
commit this patch?

Thanks,
Manish

On 4/28/06, Manish Khettry (JIRA) <de...@db.apache.org> wrote:
>
>      [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
>
> Manish Khettry updated DERBY-578:
> ---------------------------------
>
>     Attachment: 578.diff.txt
>
> The problem is simple enough-- we didn't have a conglomerate name for
> temporary tables. I fixed the code to behave more like what fillInScanArgs
> does. Several master files had to be changed and I think I got to all of
> them. If there is a wiki entry on how to convert existing tests to JUnit or
> if there is some work underway, let me know!
>
>
>
>
>
> > Grouped select from temporary table raises null pointer exception in
> byte code generator
> >
> ----------------------------------------------------------------------------------------
> >
> >          Key: DERBY-578
> >          URL: http://issues.apache.org/jira/browse/DERBY-578
> >      Project: Derby
> >         Type: Bug
>
> >   Components: Services, SQL
> >     Reporter: Rick Hillegas
> >     Assignee: Manish Khettry
> >  Attachments: 578.diff.txt
> >
> > The last statement in the following script:
> > autocommit off;
> > declare global temporary table session.ztemp
> > ( orderID varchar( 50 ) )
> > not logged;
> > select orderID from session.ztemp group by orderID;
> > raises the following stack trace in the trunk:
> > java.lang.NullPointerException
> >       at java.util.Hashtable.get(Hashtable.java:333)
> >       at
> org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(
> ClassHolder.java:656)
> >       at
> org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(
> ClassHolder.java:482)
> >       at org.apache.derby.iapi.services.classfile.ClassHolder.addString(
> ClassHolder.java:506)
> >       at
> org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(
> ClassHolder.java:302)
> >       at org.apache.derby.impl.services.bytecode.BCMethod.push(
> BCMethod.java:452)
> >       at
> org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(
> FromBaseTable.java:3216)
> >       at
> org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(
> FromBaseTable.java:3032)
> >       at org.apache.derby.impl.sql.compile.FromBaseTable.generate(
> FromBaseTable.java:2978)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(
> ScrollInsensitiveResultSetNode.java:109)
> >       at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(
> ReadCursorNode.java:118)
> >       at org.apache.derby.impl.sql.compile.CursorNode.generate(
> CursorNode.java:546)
> >       at org.apache.derby.impl.sql.compile.StatementNode.generate(
> StatementNode.java:232)
> >       at org.apache.derby.impl.sql.GenericStatement.prepMinion(
> GenericStatement.java:433)
> >       at org.apache.derby.impl.sql.GenericStatement.prepare(
> GenericStatement.java:107)
> >       at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement
> (GenericLanguageConnectionContext.java:704)
> >       at org.apache.derby.impl.jdbc.EmbedStatement.execute(
> EmbedStatement.java:533)
> >       at org.apache.derby.impl.jdbc.EmbedStatement.execute(
> EmbedStatement.java:480)
> >       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:203)
> >       at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> >       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
>
>

Re: [jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Rick Hillegas <Ri...@Sun.COM>.
Thanks, Manish. I can add the new canon myself. I just want to make sure 
that you've seen and understood this diff and don't regard it as a 
regression.

Regards,
-Rick

Manish Khettry wrote:

> Yes for some reason there is a missing newline in the patch I 
> submitted :(
>
> Do you want to edit the subquery.out file yourself or should I attach 
> another patch? Do you want the entire patch or just subquery.diff?
>
>
>
> On 6/20/06, *Rick Hillegas (JIRA)* <derby-dev@db.apache.org 
> <ma...@db.apache.org>> wrote:
>
>         [
>     http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416915
>     ]
>
>     Rick Hillegas commented on DERBY-578:
>     -------------------------------------
>
>     Thanks for the explanation, Manish. I ran derbyall and came up
>     with one unexpected diff in lang/subquery.sql. It's some extra
>     cruft on the printout for some scan qualifiers. On its surface
>     this suggests that a little work is needed to fix that printout.
>     Would appreciate your opinion here.
>
>     > Grouped select from temporary table raises null pointer
>     exception in byte code generator
>     >
>     ----------------------------------------------------------------------------------------
>     >
>     >          Key: DERBY-578
>     >          URL: http://issues.apache.org/jira/browse/DERBY-578
>     >      Project: Derby
>     >         Type: Bug
>
>     >   Components: SQL, Services
>     >     Reporter: Rick Hillegas
>     >     Assignee: Manish Khettry
>     >  Attachments: 578.diff.new.txt, 578.diff.txt,
>     predicatePushdown.out.patch
>     >
>     > The last statement in the following script:
>     > autocommit off;
>     > declare global temporary table session.ztemp
>     > ( orderID varchar( 50 ) )
>     > not logged;
>     > select orderID from session.ztemp group by orderID;
>     > raises the following stack trace in the trunk:
>     > java.lang.NullPointerException
>     >       at java.util.Hashtable.get(Hashtable.java:333)
>     >       at
>     org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
>     >       at
>     org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
>     >       at
>     org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
>     >       at
>     org.apache.derby.iapi.services.classfile.ClassHolder.addConstant
>     (ClassHolder.java:302)
>     >       at
>     org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
>     >       at
>     org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
>
>     >       at
>     org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
>     >       at
>     org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
>     >       at
>     org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
>     >       at
>     org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
>     >       at
>     org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
>     >       at
>     org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
>     >       at
>     org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
>     >       at org.apache.derby.impl.sql.GenericStatement.prepMinion
>     (GenericStatement.java:433)
>     >       at
>     org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
>     >       at
>     org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement
>     (GenericLanguageConnectionContext.java:704)
>     >       at
>     org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
>     >       at
>     org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java
>     :480)
>     >       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:203)
>     >       at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
>     >       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
>
>


Re: [jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Manish Khettry <ma...@gmail.com>.
Yes for some reason there is a missing newline in the patch I submitted :(

Do you want to edit the subquery.out file yourself or should I attach
another patch? Do you want the entire patch or just subquery.diff?



On 6/20/06, Rick Hillegas (JIRA) <de...@db.apache.org> wrote:
>
>     [
> http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416915]
>
> Rick Hillegas commented on DERBY-578:
> -------------------------------------
>
> Thanks for the explanation, Manish. I ran derbyall and came up with one
> unexpected diff in lang/subquery.sql. It's some extra cruft on the printout
> for some scan qualifiers. On its surface this suggests that a little work is
> needed to fix that printout. Would appreciate your opinion here.
>
> > Grouped select from temporary table raises null pointer exception in
> byte code generator
> >
> ----------------------------------------------------------------------------------------
> >
> >          Key: DERBY-578
> >          URL: http://issues.apache.org/jira/browse/DERBY-578
> >      Project: Derby
> >         Type: Bug
>
> >   Components: SQL, Services
> >     Reporter: Rick Hillegas
> >     Assignee: Manish Khettry
> >  Attachments: 578.diff.new.txt, 578.diff.txt,
> predicatePushdown.out.patch
> >
> > The last statement in the following script:
> > autocommit off;
> > declare global temporary table session.ztemp
> > ( orderID varchar( 50 ) )
> > not logged;
> > select orderID from session.ztemp group by orderID;
> > raises the following stack trace in the trunk:
> > java.lang.NullPointerException
> >       at java.util.Hashtable.get(Hashtable.java:333)
> >       at
> org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(
> ClassHolder.java:656)
> >       at
> org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(
> ClassHolder.java:482)
> >       at org.apache.derby.iapi.services.classfile.ClassHolder.addString(
> ClassHolder.java:506)
> >       at
> org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(
> ClassHolder.java:302)
> >       at org.apache.derby.impl.services.bytecode.BCMethod.push(
> BCMethod.java:452)
> >       at
> org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(
> FromBaseTable.java:3216)
> >       at
> org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(
> FromBaseTable.java:3032)
> >       at org.apache.derby.impl.sql.compile.FromBaseTable.generate(
> FromBaseTable.java:2978)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(
> ProjectRestrictNode.java:1196)
> >       at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(
> ProjectRestrictNode.java:1145)
> >       at
> org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(
> ScrollInsensitiveResultSetNode.java:109)
> >       at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(
> ReadCursorNode.java:118)
> >       at org.apache.derby.impl.sql.compile.CursorNode.generate(
> CursorNode.java:546)
> >       at org.apache.derby.impl.sql.compile.StatementNode.generate(
> StatementNode.java:232)
> >       at org.apache.derby.impl.sql.GenericStatement.prepMinion(
> GenericStatement.java:433)
> >       at org.apache.derby.impl.sql.GenericStatement.prepare(
> GenericStatement.java:107)
> >       at
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement
> (GenericLanguageConnectionContext.java:704)
> >       at org.apache.derby.impl.jdbc.EmbedStatement.execute(
> EmbedStatement.java:533)
> >       at org.apache.derby.impl.jdbc.EmbedStatement.execute(
> EmbedStatement.java:480)
> >       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:203)
> >       at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> >       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
>
>

[jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416588 ] 

Rick Hillegas commented on DERBY-578:
-------------------------------------

Hi Manish,

I'm confused about what I'm supposed to do with the latest attachment. It looks like it might just be the changes to predicatePushdown.out. Could you give me a single patch file which contains everything I need to apply this patch and which I can apply with a single patch command? Thanks-Rick

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12418683 ] 

Kathey Marsden commented on DERBY-578:
--------------------------------------

If there are no comments on the merge and comments I added I will run derbyall and commit this on Monday and put this poor patch (posted in April  28) out of its misery.  Thanks to Manish for the fix and Rick for the review.

Kathey


> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.new.txt, 578.diff.txt, derby578_06282006_diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Reopened: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
     
Kathey Marsden reopened DERBY-578:
----------------------------------


> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.txt
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416803 ] 

Rick Hillegas commented on DERBY-578:
-------------------------------------

Thanks, Manish. As you said, the fix looks pretty simple. I'm running regression tests now. I have a couple questions:

1) I don't understand the change to xaHelper. How is that related to this bugfix?

2) Can you explain the test diffs? On the surface, it looks like a number of index scans have been replaced with table scans. However, it's hard to trust the original claim that an index was being used because there doesn't seem to be a usable index.  Please help me muddle through these diffs.

-Rick

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.new.txt, 578.diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Resolved: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
     
Kathey Marsden resolved DERBY-578:
----------------------------------

    Fix Version: 10.2.0.0
     Resolution: Fixed
     Derby Info:   (was: [Patch Available])

Submitted to trunk.

Date: Sun Jul  2 19:37:42 2006
New Revision: 418672

URL: http://svn.apache.org/viewvc?rev=418672&view=rev

It is actually fixed in 10.2.0.4 but there is no such version in Jira so marked it 10.2.0.0


> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>      Fix For: 10.2.0.0
>  Attachments: 578.diff.new.txt, 578.diff.txt, derby578_06282006_diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]

Kathey Marsden updated DERBY-578:
---------------------------------

    Attachment: derby578_06282006_diff.txt

In the interest of learning a little about a different code area  I did a bit of housekeeping on this patch.  Attaching:

derby578_06282006_diff.txt
derby578_06282006_stat.txt

-  merged FromBaseTable now out of date and merged in general up to revision 417747
-  Fixed up the javadoc for the new method.  
- Added a comment about the fix for runtimestatistics incorrectly reporting.
- Ran derbylang suite with no failures on Windows XP jdk 1.4.2.
 - Fixed master for subquery.out to remove white space diff.


Kathey


> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.new.txt, 578.diff.txt, derby578_06282006_diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


Re: JUnit documentation (was: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator)

Posted by Kristian Waagan <Kr...@Sun.COM>.
Manish Khettry (JIRA) wrote:
>      [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
> 
> Manish Khettry updated DERBY-578:
> ---------------------------------
> 
>     Attachment: 578.diff.txt
> 
> The problem is simple enough-- we didn't have a conglomerate name for temporary tables. I fixed the code to behave more like what fillInScanArgs does. Several master files had to be changed and I think I got to all of them. If there is a wiki entry on how to convert existing tests to JUnit or if there is some work underway, let me know!

Hello Manish,

There is a little information about JUnit at 
http://wiki.apache.org/db-derby/DerbyJUnitTesting, but it really isn't much.

If you go ahead and convert a test, please let the list (or me) know 
what information you miss, and we/I will try to help you and add content 
to the page.



--
Kristian


[snip - DERBY-578 details]

[jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]

Manish Khettry updated DERBY-578:
---------------------------------

    Attachment: 578.diff.txt

The problem is simple enough-- we didn't have a conglomerate name for temporary tables. I fixed the code to behave more like what fillInScanArgs does. Several master files had to be changed and I think I got to all of them. If there is a wiki entry on how to convert existing tests to JUnit or if there is some work underway, let me know!





> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: Services, SQL
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.txt
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416814 ] 

Manish Khettry commented on DERBY-578:
--------------------------------------

Thanks for taking time to review the fix. The xaHelper is not related to this but when I was debugging using ij, this bit of code would always throw a NPE in the debugger. 

You are right about 2. Earlier, we would set the indexName field in DistinctScanResult to the conglomerate name (cd.getName()) used to scan the table. If the conglomerate was the base table itself then this was just plain wrong. The change, for this patch, passes null if no index is being used. This in turn ended up causing all the diffs to the master files. I really wish we had assert tests; all the test output wants to check in this case is that a distinct scan is performed and not have all the other cruft output by runtime stats.

The change to FromBaseTable is similar to the code in BaseJoinStrategy:fillInScanArgs2. I was tempted to try and have all the differfent code paths (DistinctScan, specialMaxScan) share the same code when it comes to filling in the scan args but I took the easy way out for this bug for now.





> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.new.txt, 578.diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416403 ] 

Rick Hillegas commented on DERBY-578:
-------------------------------------

Hi Manish,

I would like to take a look at this patch, but I get the following errors when I try to apply it to my workspace. Could you regenerate the patch? Thanks-Rick

(Stripping trailing CRs from patch.)
patching file java/tools/org/apache/derby/impl/tools/ij/xaHelper.java
Hunk #1 succeeded at 64 (offset 1 line).
(Stripping trailing CRs from patch.)
patching file java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java
Hunk #1 succeeded at 3085 (offset 4 lines).
Hunk #2 succeeded at 3125 (offset 4 lines).
Hunk #3 succeeded at 3152 (offset 4 lines).
Hunk #4 succeeded at 3187 (offset 4 lines).
Hunk #5 succeeded at 3247 (offset 4 lines).
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/tests/lang/distinct.sql
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/master/distinctElimination.out
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/master/distinct.out
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/master/j9_13/distinct.out
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/master/j9_22/distinct.out
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/master/predicatePushdown.out
Hunk #1 succeeded at 9052 (offset 1480 lines).
Hunk #2 succeeded at 9071 (offset 1480 lines).
Hunk #3 succeeded at 9090 (offset 1480 lines).
Hunk #4 succeeded at 9109 with fuzz 1 (offset 1480 lines).
Hunk #5 FAILED at 9215.
Hunk #6 FAILED at 9234.
Hunk #7 succeeded at 9259 (offset 1480 lines).
Hunk #8 FAILED at 9278.
Hunk #9 succeeded at 9297 with fuzz 1 (offset 1480 lines).
Hunk #10 FAILED at 9316.
Hunk #11 succeeded at 9335 with fuzz 1 (offset 1480 lines).
4 out of 11 hunks FAILED -- saving rejects to file java/testing/org/apache/derbyTesting/functionTests/master/predicatePu
shdown.out.rej
(Stripping trailing CRs from patch.)
patching file java/testing/org/apache/derbyTesting/functionTests/master/subquery.out

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.txt
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Mike Matrigali (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]

Mike Matrigali updated DERBY-578:
---------------------------------

    Component: Services
               SQL

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug
>   Components: Services, SQL
>     Reporter: Rick Hillegas

>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Resolved: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
     
Manish Khettry resolved DERBY-578:
----------------------------------

    Resolution: Fixed
    Derby Info: [Patch Available]

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.txt
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Assigned: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]

Manish Khettry reassigned DERBY-578:
------------------------------------

    Assign To: Manish Khettry

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: Services, SQL
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry

>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Closed: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
     
Rick Hillegas closed DERBY-578:
-------------------------------


> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>      Fix For: 10.2.0.0
>  Attachments: 578.diff.new.txt, 578.diff.txt, derby578_06282006_diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


Re: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Army <qo...@gmail.com>.
Manish Khettry wrote:

> The qeury plan was erroneusly reporting an index being 
> used when none was being used. Try to do a distinct scan 
> on a table without an index.
> 
> ---------
>  maximumdisplaywidth 20000;
>  create table noindex (x int);
>  call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
>  select distinct x from noindex;
>  values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
> ---------

Okay, thanks for the example--I see your point.  It doesn't seem like we should 
be printing an index here after all...

> Let me know if this clarifies or makes you (or any 
> other commiter) feel better (or worse) about the patch?

I guess I feel better now :)

Thanks for the quick reply,
Army


Re: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Manish Khettry <ma...@yahoo.com>.

--- Army <qo...@gmail.com> wrote:

>
> Did your changes actually make it so that the query
> no longer uses an index on 
> T1, or did it just change the logQueryPlan output so
> that the index is no longer 
> being printed? 

Actually, neither. The qeury plan was erroneusly
reporting an index being used when none was being
used. Try to do a distinct scan on a table without an
index.

---------
 maximumdisplaywidth 20000;
 create table noindex (x int);
 call SYSCS_UTIL.SYSCS_SET_RUNTIMESTATISTICS(1);
 select distinct x from noindex;
 values SYSCS_UTIL.SYSCS_GET_RUNTIMESTATISTICS();
---------


 
> As for the "None" vs "null", I personally prefer the
> former over the latter--so 

This is only an indirect result of my change-- Since
the indexname is now null, the code that generates the
query plan out put prints None instead of null (or the
other way round).

>
> As I said, I haven't had time to do a thorough
> review, but I did notice the 
> following changes in your patch:
> 	
> +        /* helper method used by
> generateMaxSpecialResultSet and
> +         * generateDistinctScan to return the name
> of the index if the
> +         * conglomerate is an index.
> +         */
> +        private void
> pushIndexName(ConglomerateDescriptor cd,
> MethodBuilder mb)
> +          throws StandardException
> +        {
> +            if (cd.isConstraint()) {
> +                DataDictionary dd =
> getDataDictionary();
> +                ConstraintDescriptor constraintDesc
> =
> +                   
> dd.getConstraintDescriptor(tableDescriptor,
> cd.getUUID());
> +               
> mb.push(constraintDesc.getConstraintName());
> +            } else if (cd.isIndex())  {
> +                mb.push(cd.getConglomerateName());
> +            } else {
> +              mb.pushNull("java.lang.String");
> +            }
> +        }
> +	
> 
> @@ -3128,7 +3148,7 @@
>   		 
>
mb.push(org.apache.derby.iapi.util.PropertyUtil.sortProperties(tableProperties));
>   		else
>   			mb.pushNull("java.lang.String");
> -		mb.push(cd.getConglomerateName());
> +                pushIndexName(cd, mb);
>   		mb.push(colRefItem);
>   	
> mb.push(getTrulyTheBestAccessPath().getLockMode());
>   		mb.push(tableLockGranularity);
> 
> If I'm reading this correctly, we used to _always_
> push 
> cd.getConglomerateName()--which, if we're using an
> index, is the name of the 
> index--but now, in order to avoid the NPE reported
> as part of this issue, we 
> will only push the conglomerate name if it (the
> conglomerate) is not a 
> constraint.  Logically, I'm not entirely sure that's
> the correct thing to do, 

Well if cd is a conglomerate that represents the base
table then why use the base table name as the index
name in the distict result set?! Let me know if this
clarifies or makes you (or any other commiter) feel
better (or worse) about the patch?

The method that you refer to here(pushIndexName) is
pretty much the code that is used
BaseJoinStrategy:fillInScanArgs2. 

Thanks,
Manish


> since I *think* that a conglomerate can be an index
> and a constraint at the same 
> time (I'd have to investigate more--if anyone out
> there knows for sure, please 
> chime in!).  If that's true, then in situations
> where we used to have a 
> conglomerate that was both an index and a
> constraint, we would push the index 
> name; but now for that same conglomerate we will
> push the constraint name 
> instead, and I'm guessing that the constraint name
> and the index name are not 
> always the same--which might account for the fact
> the index name is now missing 
> from the logQueryPlan?
> 
> That's just speculation, though--if anyone can
> confirm/deny, that'd be great. 
> In any event, in order to preserve the existing
> behavior in logQueryPlan, the 
> change might be as small as something like:
> 
> +        /* helper method used by
> generateMaxSpecialResultSet and
> +         * generateDistinctScan to return the name
> of the index if the
> +         * conglomerate is an index.
> +         */
> +        private void
> pushIndexName(ConglomerateDescriptor cd,
> MethodBuilder mb)
> +          throws StandardException
> +        {
> +            if (cd.getConglomerateName() != null)
> +                mb.push(cd.getConglomerateName());
> +            else if (cd.isConstraint()) {
> +                DataDictionary dd =
> getDataDictionary();
> +                ConstraintDescriptor constraintDesc
> =
> +                   
> dd.getConstraintDescriptor(tableDescriptor,
> cd.getUUID());
> +               
> mb.push(constraintDesc.getConstraintName());
> +            } else {
> +              mb.pushNull("java.lang.String");
> +            }
> +        }
> 
> Assuming, of course, that
> constraintDesc.getConstraintName() can't ever be 
> null... :)
> 
> I didn't test the above suggestion so it may need
> some tweaking--but if you 
> could look at the changes again and/or explain a bit
> more about what is causing 
> the diff in the master files--and hopefully post
> your findings--then I'd feel a 
> lot better about this patch...
> 
> For what it's worth,
> Army
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: [jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by Army <qo...@gmail.com>.
Manish Khettry (JIRA) wrote:
>      [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]
> 
> Manish Khettry updated DERBY-578:
> ---------------------------------
> 
>     Attachment: predicatePushdown.out.patch
> 
> Looks like the join order changed between when I generated the patch and now. 
> Try this version of predicatePushdown.

I haven't had time to follow this issue closely, but the diff you just posted 
caught my attention--somehow these master updates seem "funny" to me (for lack 
of a better technical term).

I glanced through all of the master updates that you've made for this issue and 
they all show two kinds of diffs: the first is that Distinct Scans are no longer 
reporting index usage, and the second is that start/stop position for heap scans 
has gone from "None" to "null".

For example:

-			Distinct Scan ResultSet for T1 using index xxxxFILTERED-UUIDxxxx at read 
committed isolation level using instantaneous share row locking:
+			Distinct Scan ResultSet for T1 at read committed isolation level using 
instantaneous share row locking:

Did your changes actually make it so that the query no longer uses an index on 
T1, or did it just change the logQueryPlan output so that the index is no longer 
being printed?  My guess (having not looked closely at the code) is that your 
changes have just affected logQueryPlan output--i.e. that the query plan itself 
is still what it was before.

If that's true, then I'm not sure I like the idea of losing this index 
information--truth is, index information is one of *the* most useful things (at 
least for me) when I'm reading a logged query plan, so to lose this info seems 
like a less-than-ideal change.

As for the "None" vs "null", I personally prefer the former over the latter--so 
I'm wondering if it's possible to somehow fix the issue described but still 
retain the more meaningful "None" keyword in this output?  This is perhaps being 
a bit picky, but I thought I'd bring it up.

As I said, I haven't had time to do a thorough review, but I did notice the 
following changes in your patch:
	
+        /* helper method used by generateMaxSpecialResultSet and
+         * generateDistinctScan to return the name of the index if the
+         * conglomerate is an index.
+         */
+        private void pushIndexName(ConglomerateDescriptor cd, MethodBuilder mb)
+          throws StandardException
+        {
+            if (cd.isConstraint()) {
+                DataDictionary dd = getDataDictionary();
+                ConstraintDescriptor constraintDesc =
+                    dd.getConstraintDescriptor(tableDescriptor, cd.getUUID());
+                mb.push(constraintDesc.getConstraintName());
+            } else if (cd.isIndex())  {
+                mb.push(cd.getConglomerateName());
+            } else {
+              mb.pushNull("java.lang.String");
+            }
+        }
+	

@@ -3128,7 +3148,7 @@
  		 
mb.push(org.apache.derby.iapi.util.PropertyUtil.sortProperties(tableProperties));
  		else
  			mb.pushNull("java.lang.String");
-		mb.push(cd.getConglomerateName());
+                pushIndexName(cd, mb);
  		mb.push(colRefItem);
  		mb.push(getTrulyTheBestAccessPath().getLockMode());
  		mb.push(tableLockGranularity);

If I'm reading this correctly, we used to _always_ push 
cd.getConglomerateName()--which, if we're using an index, is the name of the 
index--but now, in order to avoid the NPE reported as part of this issue, we 
will only push the conglomerate name if it (the conglomerate) is not a 
constraint.  Logically, I'm not entirely sure that's the correct thing to do, 
since I *think* that a conglomerate can be an index and a constraint at the same 
time (I'd have to investigate more--if anyone out there knows for sure, please 
chime in!).  If that's true, then in situations where we used to have a 
conglomerate that was both an index and a constraint, we would push the index 
name; but now for that same conglomerate we will push the constraint name 
instead, and I'm guessing that the constraint name and the index name are not 
always the same--which might account for the fact the index name is now missing 
from the logQueryPlan?

That's just speculation, though--if anyone can confirm/deny, that'd be great. 
In any event, in order to preserve the existing behavior in logQueryPlan, the 
change might be as small as something like:

+        /* helper method used by generateMaxSpecialResultSet and
+         * generateDistinctScan to return the name of the index if the
+         * conglomerate is an index.
+         */
+        private void pushIndexName(ConglomerateDescriptor cd, MethodBuilder mb)
+          throws StandardException
+        {
+            if (cd.getConglomerateName() != null)
+                mb.push(cd.getConglomerateName());
+            else if (cd.isConstraint()) {
+                DataDictionary dd = getDataDictionary();
+                ConstraintDescriptor constraintDesc =
+                    dd.getConstraintDescriptor(tableDescriptor, cd.getUUID());
+                mb.push(constraintDesc.getConstraintName());
+            } else {
+              mb.pushNull("java.lang.String");
+            }
+        }

Assuming, of course, that constraintDesc.getConstraintName() can't ever be 
null... :)

I didn't test the above suggestion so it may need some tweaking--but if you 
could look at the changes again and/or explain a bit more about what is causing 
the diff in the master files--and hopefully post your findings--then I'd feel a 
lot better about this patch...

For what it's worth,
Army


[jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]

Manish Khettry updated DERBY-578:
---------------------------------

    Attachment: predicatePushdown.out.patch

Looks like the join order changed between when I generated the patch and now. Try this version of predicatePushdown.


> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Commented: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Rick Hillegas (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-578?page=comments#action_12416915 ] 

Rick Hillegas commented on DERBY-578:
-------------------------------------

Thanks for the explanation, Manish. I ran derbyall and came up with one unexpected diff in lang/subquery.sql. It's some extra cruft on the printout for some scan qualifiers. On its surface this suggests that a little work is needed to fix that printout. Would appreciate your opinion here.

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.new.txt, 578.diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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


[jira] Updated: (DERBY-578) Grouped select from temporary table raises null pointer exception in byte code generator

Posted by "Manish Khettry (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-578?page=all ]

Manish Khettry updated DERBY-578:
---------------------------------

    Attachment: 578.diff.new.txt

Try this one-- it is a complete patch and it should work.

> Grouped select from temporary table raises null pointer exception in byte code generator
> ----------------------------------------------------------------------------------------
>
>          Key: DERBY-578
>          URL: http://issues.apache.org/jira/browse/DERBY-578
>      Project: Derby
>         Type: Bug

>   Components: SQL, Services
>     Reporter: Rick Hillegas
>     Assignee: Manish Khettry
>  Attachments: 578.diff.new.txt, 578.diff.txt, predicatePushdown.out.patch
>
> The last statement in the following script:
> autocommit off;
> declare global temporary table session.ztemp
> ( orderID varchar( 50 ) )
> not logged;
> select orderID from session.ztemp group by orderID;
> raises the following stack trace in the trunk:
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:333)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.findMatchingEntry(ClassHolder.java:656)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addUtf8Entry(ClassHolder.java:482)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addString(ClassHolder.java:506)
> 	at org.apache.derby.iapi.services.classfile.ClassHolder.addConstant(ClassHolder.java:302)
> 	at org.apache.derby.impl.services.bytecode.BCMethod.push(BCMethod.java:452)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateDistinctScan(FromBaseTable.java:3216)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3032)
> 	at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2978)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1196)
> 	at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1145)
> 	at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:109)
> 	at org.apache.derby.impl.sql.compile.ReadCursorNode.generate(ReadCursorNode.java:118)
> 	at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:546)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:232)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:433)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:107)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:704)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:533)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:480)
> 	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:203)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
> 	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