Issue Details (XML | Word | Printable)

Key: DERBY-3061
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: A B
Reporter: Rick Hillegas
Votes: 1
Watchers: 1
Operations

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

Wrong results from query with two conjuncts

Created: 07/Sep/07 01:28 PM   Updated: Tuesday 09:11 AM
Return to search
Component/s: SQL
Affects Version/s: 10.3.1.4
Fix Version/s: 10.3.2.1, 10.4.1.3

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works d3061_v1.patch 2007-09-08 07:26 PM A B 4 kB
File Licensed for inclusion in ASF works d3061_v1.stat 2007-09-08 07:26 PM A B 0.2 kB
Text File Licensed for inclusion in ASF works d3061_v2.patch 2007-09-11 04:17 PM A B 6 kB
Issue Links:
Duplicate
 
Incorporates
 
Reference
 

Bug behavior facts: Regression
Resolution Date: 11/Sep/07 11:43 PM


 Description  « Hide
Tim Dudgeon, on the user list, reports that the following query returns no results in 10.3.1.4 but works correctly in 10.2. I have verified that the query returns no results in the mainline as well. If you eliminate either of the the conjuncts, then the query returns the correct results:

SELECT MYTABLE.MY_ID
 FROM MYTABLE
 WHERE MYTABLE.MY_ID < 100 AND MYTABLE.MY_ID IN (
2,15,19,20,21,48,49
)

Here is a more complete script which demonstrates the problem:

drop table mytable;

create table mytable ( id int primary key );

insert into mytable ( id )
values
( 0 ), ( 1 ), ( 2 ), ( 3 ), ( 4 ), ( 5 ), ( 6 ), ( 7 ), ( 8 ), ( 9 );

insert into mytable select id + 10 from mytable;
insert into mytable select id + 20 from mytable;
insert into mytable select id + 40 from mytable;
insert into mytable select id + 100 from mytable;

select mytable.id
from mytable
where mytable.id < 100;


select mytable.id
from mytable
where mytable.id in ( 2, 15, 19, 20, 21, 48, 49 );

select mytable.id
from mytable
where mytable.id < 100
and mytable.id in ( 2, 15, 19, 20, 21, 48, 49 );
 


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.