Issue Details (XML | Word | Printable)

Key: DERBY-3321
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Thomas Nielsen
Reporter: Jørgen Løland
Votes: 1
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

NullPointerException for 'NOT EXISTS' with nested subquery

Created: 16/Jan/08 10:42 AM   Updated: 25/Apr/08 09:07 PM
Return to search
Component/s: SQL
Affects Version/s: 10.0.2.1, 10.1.3.1, 10.2.2.0, 10.3.2.1, 10.4.1.3
Fix Version/s: 10.3.3.0, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works d3321.diff 2008-03-05 12:52 PM Thomas Nielsen 3 kB
File Licensed for inclusion in ASF works d3321.stat 2008-03-05 12:52 PM Thomas Nielsen 0.2 kB
Text File derby.log 2008-01-16 10:47 AM Jørgen Løland 3 kB
Environment: Committed revision 651700 to 10.3
Issue Links:
Reference
 

Resolution Date: 06/Mar/08 04:51 PM


 Description  « Hide
Queries with 'not exists' followed by a nested subquery results in NPE:

-----------8<--------------
connect 'jdbc:derby:testdb;create=true';
create table a (aa int, bb int);
-- 0 rows inserted/updated/deleted

create table b (bb int);
-- 0 rows inserted/updated/deleted

insert into a values (1, 1), (1, 2), (2, 2);
-- 3 rows inserted/updated/deleted

insert into b values (1);
-- 1 row inserted/updated/deleted

select * from a
   where not exists
   (select bb from b where a.bb=b.bb);

-- AA |BB
-- ----------------------
-- 1 |2
-- 2 |2

select bb from (select bb from b) p;
-- BB
-- -----------
-- 1

select * from a
   where not exists
   (select bb from (select bb from b) p where a.bb=p.bb);
-- ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
------------>8----------------

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #634316 Thu Mar 06 15:52:18 UTC 2008 dyre DERBY-3321: NullPointerException for 'NOT EXISTS' with nested subquery
Checks fromList for a FromSubquery using a CollectNodesVistior.
The value of bindTargetListOnly is based on the contents of the visitor.
Patch contributed by Thomas Nielsen
Patch file: d3321.diff
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NestedWhereSubqueryTest.java
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java

Repository Revision Date User Message
ASF #651700 Fri Apr 25 21:09:47 UTC 2008 kmarsden DERBY-3321 NullPointerException for 'NOT EXISTS' with nested subquery

port from trunk revision 614316
Contributed by Thomas Nielsen (thomas dot nielsen at sun dot com)
Files Changed
MODIFY /db/derby/code/branches/10.3/java/testing/org/apache/derbyTesting/functionTests/tests/lang/NestedWhereSubqueryTest.java
MODIFY /db/derby/code/branches/10.3/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java