Details
Description
The ORDER BY is causing the ordered column to be retrieved even though it is not part of the SELECT clause. Here is a script to create a table, insert a row, and perform the select:
CREATE TABLE "REVIEWS"."GEOFF_REVIEWS_REVIEW"
(
PK INTEGER PRIMARY KEY not null,
numstars BIGINT,
body VARCHAR(32672),
title VARCHAR(32672),
authoremail VARCHAR(32672)
);
INSERT INTO "REVIEWS"."GEOFF_REVIEWS_REVIEW" (PK,numstars,body,title,authoremail) VALUES (0 /not nullable/,0,'s','s','s');
SELECT "review"."numstars"
FROM
"GEOFF_REVIEWS_REVIEW" AS "review"
WHERE
"review"."PK" = 1
ORDER BY
"review".PK
Attachments
Attachments
Issue Links
- is depended upon by
-
DERBY-3926 Incorrect ORDER BY caused by index
- Closed