
| Key: |
DERBY-3279
|
| Type: |
Bug
|
| Status: |
Resolved
|
| Resolution: |
Fixed
|
| Priority: |
Major
|
| Assignee: |
A B
|
| Reporter: |
Ajay Bhala
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
File Attachments:
|
|
|
Environment:
|
Rational Application Developer 7.0.0.2 (Eclipse 3.2.2), J2RE 1.5.0 IBM J9 2.3 Windows XP
|
|
Issue Links:
|
Reference
|
|
|
|
This issue is related to:
|
|
DERBY-47
Some possible improvements to IN optimization
|
|
|
|
|
|
|
| Urgency: |
Urgent
|
| Bug behavior facts: |
Regression
|
| Resolution Date: |
07/Feb/08 07:03 PM
|
Running the following produces the error seen in Derby 10.3.X but not in 10.2.X nor in 10.1.X.
Don't know if this related to DERBY-3231.
First query is incorrectly sorted whereas the second one is okay when there is an index on the table.
If the table is not indexed, the sort works correctly in DESC order.
------
create table CHEESE (
CHEESE_CODE VARCHAR(5),
CHEESE_NAME VARCHAR(20),
CHEESE_COST DECIMAL(7,4)
);
create index cheese_index on CHEESE (CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC);
INSERT INTO CHEESE (
CHEESE_CODE,
CHEESE_NAME,
CHEESE_COST)
VALUES ('00000', 'GOUDA', 001.1234),
('00000', 'EDAM', 002.1111),
('54321', 'EDAM', 008.5646),
('12345', 'GORGONZOLA', 888.2309),
('AAAAA', 'EDAM', 999.8888),
('54321', 'MUENSTER', 077.9545);
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='00000' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='AAAAA' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
|
|
Description
|
Running the following produces the error seen in Derby 10.3.X but not in 10.2.X nor in 10.1.X.
Don't know if this related to DERBY-3231.
First query is incorrectly sorted whereas the second one is okay when there is an index on the table.
If the table is not indexed, the sort works correctly in DESC order.
------
create table CHEESE (
CHEESE_CODE VARCHAR(5),
CHEESE_NAME VARCHAR(20),
CHEESE_COST DECIMAL(7,4)
);
create index cheese_index on CHEESE (CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC);
INSERT INTO CHEESE (
CHEESE_CODE,
CHEESE_NAME,
CHEESE_COST)
VALUES ('00000', 'GOUDA', 001.1234),
('00000', 'EDAM', 002.1111),
('54321', 'EDAM', 008.5646),
('12345', 'GORGONZOLA', 888.2309),
('AAAAA', 'EDAM', 999.8888),
('54321', 'MUENSTER', 077.9545);
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='00000' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='AAAAA' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC; |
Show » |
made changes - 14/Dec/07 09:25 PM
| Field |
Original Value |
New Value |
|
Description
|
Running the following produces the error seen in Derby 10.3.X but not in 10.2.X nor in 10.1.X.
Don't know if this related to DERBY-3231.
First query is incorrectly sorted whereas the second one is okay.
------
create table CHEESE (
CHEESE_CODE VARCHAR(5),
CHEESE_NAME VARCHAR(20),
CHEESE_COST DECIMAL(7,4)
);
create index cheese_index on CHEESE (CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC);
INSERT INTO CHEESE (
CHEESE_CODE,
CHEESE_NAME,
CHEESE_COST)
VALUES ('00000', 'GOUDA', 001.1234),
('00000', 'EDAM', 002.1111),
('54321', 'EDAM', 008.5646),
('12345', 'GORGONZOLA', 888.2309),
('AAAAA', 'EDAM', 999.8888),
('54321', 'MUENSTER', 077.9545);
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='00000' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='AAAAA' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
|
Running the following produces the error seen in Derby 10.3.X but not in 10.2.X nor in 10.1.X.
Don't know if this related to DERBY-3231.
First query is incorrectly sorted whereas the second one is okay when there is an index on the table.
If the table is not indexed, the sort works correctly in DESC order.
------
create table CHEESE (
CHEESE_CODE VARCHAR(5),
CHEESE_NAME VARCHAR(20),
CHEESE_COST DECIMAL(7,4)
);
create index cheese_index on CHEESE (CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC);
INSERT INTO CHEESE (
CHEESE_CODE,
CHEESE_NAME,
CHEESE_COST)
VALUES ('00000', 'GOUDA', 001.1234),
('00000', 'EDAM', 002.1111),
('54321', 'EDAM', 008.5646),
('12345', 'GORGONZOLA', 888.2309),
('AAAAA', 'EDAM', 999.8888),
('54321', 'MUENSTER', 077.9545);
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='00000' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
SELECT * FROM CHEESE
WHERE (CHEESE_CODE='AAAAA' OR CHEESE_CODE='54321') AND CHEESE_NAME='EDAM'
ORDER BY CHEESE_CODE DESC, CHEESE_NAME DESC, CHEESE_COST DESC;
|
made changes - 14/Dec/07 10:10 PM
made changes - 23/Jan/08 04:39 PM
made changes - 23/Jan/08 10:05 PM
|
Attachment
|
|
d3279_v1.patch
[ 12373874
]
|
made changes - 23/Jan/08 10:07 PM
|
Summary
|
Derby 10.3.X sorts VARCHAR column incorrectly when table is indexed and VARCHAR column contains a value of '00000'
|
Derby 10.3.X ignores ORDER BY DESC when target column has an index and is used in an OR clause or an IN list.
|
made changes - 23/Jan/08 10:08 PM
|
Derby Info
|
[Regression]
|
[Patch Available, Regression]
|
made changes - 29/Jan/08 01:02 AM
|
Fix Version/s
|
|
10.4.0.0
[ 12312540
]
|
|
Derby Info
|
[Regression, Patch Available]
|
[Regression]
|
made changes - 29/Jan/08 09:24 PM
|
Attachment
|
|
cheese2.sql
[ 12374294
]
|
made changes - 30/Jan/08 09:38 PM
|
Derby Info
|
[Regression]
|
[Patch Available, Regression]
|
made changes - 01/Feb/08 04:30 PM
|
Derby Info
|
[Regression, Patch Available]
|
[Regression]
|
made changes - 07/Feb/08 07:03 PM
|
Resolution
|
|
Fixed
[ 1
]
|
|
Fix Version/s
|
|
10.3.2.2
[ 12312885
]
|
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
made changes - 19/Feb/08 10:25 PM
|
Link
|
|
This issue is related to DERBY-47
[ DERBY-47
]
|
made changes - 30/Jun/09 03:55 PM
|
Bug behavior facts
|
|
[Regression]
|
|