Issue Details (XML | Word | Printable)

Key: DERBY-3257
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Kathey Marsden
Reporter: Stan Bradbury
Votes: 1
Watchers: 0
Operations

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

SELECT with HAVING clause containing OR conditional incorrectly return 1 row - should return 2 rows - works correctly with 10.2 DB

Created: 06/Dec/07 12:57 AM   Updated: 30/Jun/09 03:55 PM
Return to search
Component/s: SQL
Affects Version/s: 10.3.1.4, 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 42X24_error.sql 2008-01-18 03:16 AM Kathey Marsden 0.4 kB
Text File Licensed for inclusion in ASF works d3257_doNOTCommit.patch 2008-01-17 11:50 PM A B 3 kB
Text File Licensed for inclusion in ASF works derby-3257_diff.txt 2008-01-19 11:13 PM Kathey Marsden 8 kB
Text File Licensed for inclusion in ASF works derby-3257_diff2.txt 2008-01-21 07:18 PM Kathey Marsden 8 kB
Text File derby-3257_plan_10.2.txt 2008-01-17 07:06 PM Kathey Marsden 3 kB
Text File derby-3257_plan_10.4.txt 2008-01-17 07:06 PM Kathey Marsden 2 kB
Text File Licensed for inclusion in ASF works derby-3257_stat.txt 2008-01-19 11:13 PM Kathey Marsden 0.3 kB
Java Source File TestHaving.java 2008-01-18 05:26 PM Kathey Marsden 5 kB
Issue Links:
Incorporates
 
Reference
 

Bug behavior facts: Regression
Resolution Date: 22/Jan/08 08:22 PM


 Description  « Hide
Attached program demonstrates the problem. Only one count is returned (matching CODE= GBR) - the count of CODE=CHA is not returned. Works fine with versions 10.1 and 10.2 or if program is run using 10.3 jars and 10.2 database (soft upgrade).

Query:
SELECT COUNT(t0.ID) FROM CTS1.TEST_TABLE t0
  GROUP BY t0.CODE
    HAVING (t0.CODE = 'GBR' OR t0.CODE = 'CHA') AND t0.CODE IS NOT NULL

Incorrect results (see last line):
Database product: Apache Derby
Database version: 10.3.1.5 - (579866)
Driver name: Apache Derby Embedded JDBC Driver
Driver version: 10.3.1.5 - (579866)
result: 2


Correct results:
Database product: Apache Derby
Database version: 10.2.2.0 - (485682)
Driver name: Apache Derby Embedded JDBC Driver
Driver version: 10.2.2.0 - (485682)
result: 4
result: 2

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Stan Bradbury made changes - 06/Dec/07 12:58 AM
Field Original Value New Value
Attachment TestHaving.java [ 12371082 ]
A B made changes - 06/Dec/07 05:02 PM
Link This issue is related to DERBY-681 [ DERBY-681 ]
A B made changes - 13/Dec/07 05:44 PM
Link This issue relates to DERBY-2034 [ DERBY-2034 ]
A B made changes - 13/Dec/07 05:45 PM
Link This issue relates to DERBY-2034 [ DERBY-2034 ]
A B made changes - 13/Dec/07 05:46 PM
Link This issue is part of DERBY-2034 [ DERBY-2034 ]
Kathey Marsden made changes - 14/Dec/07 04:44 PM
Component/s SQL [ 11408 ]
Kathey Marsden made changes - 17/Jan/08 07:06 PM
Attachment derby-3257_plan_10.2.txt [ 12373420 ]
Attachment derby-3257_plan_10.4.txt [ 12373421 ]
A B made changes - 17/Jan/08 11:40 PM
Attachment d3257_doNOTCommit.patch [ 12373455 ]
A B made changes - 17/Jan/08 11:49 PM
Attachment d3257_doNOTCommit.patch [ 12373455 ]
A B made changes - 17/Jan/08 11:49 PM
Attachment d3257_doNOTCommit.patch [ 12373457 ]
A B made changes - 17/Jan/08 11:49 PM
Attachment d3257_doNOTCommit.patch [ 12373457 ]
A B made changes - 17/Jan/08 11:50 PM
Attachment d3257_doNOTCommit.patch [ 12373458 ]
Kathey Marsden made changes - 18/Jan/08 03:16 AM
Attachment 42X24_error.sql [ 12373466 ]
Kathey Marsden made changes - 18/Jan/08 05:25 PM
Attachment TestHaving.java [ 12371082 ]
Kathey Marsden made changes - 18/Jan/08 05:26 PM
Attachment TestHaving.java [ 12373540 ]
Kathey Marsden made changes - 18/Jan/08 05:41 PM
Assignee Kathey Marsden [ kmarsden ]
Kathey Marsden made changes - 19/Jan/08 11:13 PM
Attachment derby-3257_stat.txt [ 12373611 ]
Attachment derby-3257_diff.txt [ 12373610 ]
Kathey Marsden made changes - 21/Jan/08 07:18 PM
Attachment derby-3257_diff2.txt [ 12373697 ]
Kathey Marsden made changes - 22/Jan/08 08:22 PM
Resolution Fixed [ 1 ]
Fix Version/s 10.4.0.0 [ 12312540 ]
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 10.3.2.2 [ 12312885 ]
Stan Bradbury made changes - 24/Jan/08 11:12 PM
Status Resolved [ 5 ] Closed [ 6 ]
Dag H. Wanvik made changes - 30/Jun/09 03:55 PM
Bug behavior facts [Regression]