New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expression indexes bug: incorrect result for the inverted boolean [CORE2073] #2508
Comments
Modified by: @dyemanovassignee: Dmitry Yemanov [ dimitr ] |
Modified by: @dyemanovstatus: Open [ 1 ] => Open [ 1 ] Fix Version: 2.5 Beta 1 [ 10251 ] Fix Version: 2.1.2 [ 10270 ] Fix Version: 2.0.5 [ 10222 ] |
Modified by: @dyemanovVersion: 2.1.1 [ 10223 ] Version: 2.5 Alpha 1 [ 10224 ] Version: 2.0.4 [ 10211 ] Version: 2.1.0 [ 10041 ] Version: 2.0.3 [ 10200 ] Version: 2.0.2 [ 10130 ] Version: 2.0.1 [ 10090 ] Version: 2.0.0 [ 10091 ] |
Commented by: Sean Leyne (seanleyne) Please provide PLANs generated for the statements. |
Commented by: @dyemanov Sean, this is a complete test case :-) You can see exactly the same plans as the reporter: PLAN (TMP_DATE1 NATURAL) -- for the first query Moreover: CREATE INDEX TMP_DATE1_IDX2 ON TMP_DATE1 (DATE1) ; SELECT count(*) FROM TMP_DATE1 T WHERE '01.03.2008' BETWEEN T.DATE1 AND T.DATE2; The simplified predicate which exposes the bug is: The problem is that the inverted boolean (literal compared to an indexed object) works correctly for an indexed field but fails for an indexed expression. |
Modified by: @dyemanovsummary: Expression indexes bug => Expression indexes bug: incorrect result for the inverted boolean (i.e. when a literal is compared to an indexed object) |
Modified by: @dyemanovsummary: Expression indexes bug: incorrect result for the inverted boolean (i.e. when a literal is compared to an indexed object) => Expression indexes bug: incorrect result for the inverted boolean |
Modified by: @pmakowski |
Modified by: @pmakowskistatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovQA Status: No test => Done successfully |
Submitted by: freemanzav (freemanzav)
Is related to QA224
CREATE TABLE TMP_DATE1
(
DATE1 DATE,
DATE2 DATE
);
EXECUTE BLOCK
AS
DECLARE VARIABLE D DATE;
BEGIN
D = '01.01.2008';
WHILE (D < '01.08.2008') DO BEGIN
INSERT INTO TMP_DATE1(DATE1, DATE2)
VALUES(:D, :D + 100);
D = D + 1;
END
END;
CREATE INDEX TMP_DATE1_IDX1 ON TMP_DATE1 COMPUTED BY (DATE1+0)
---------------------------------------
without index
SELECT count(*) FROM TMP_DATE1 T WHERE '01.03.2008' BETWEEN T.DATE1 AND T.DATE2;
count = 61
---------------------------------------
with index
SELECT count(*) FROM TMP_DATE1 T WHERE '01.03.2008' BETWEEN T.DATE1+0 AND T.DATE2
count = 1
Commits: 278d0f8 049be04 2834254
The text was updated successfully, but these errors were encountered: