-
-
Notifications
You must be signed in to change notification settings - Fork 221
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
Set the fixed and documented check order for WHERE clause and other conditional sentences [CORE1971] #2409
Comments
Commented by: Smirnoff Serg (wildsery) Translate from english to english :) |
Commented by: Dmitry Gogol (dmitrygogol) >> Translate from english to english I have said at gmane.comp.db.firebird.russian : "I'll go to wake up my russian/non-russian speller". It has not woken up. ;-) |
Modified by: Dmitry Gogol (dmitrygogol)summary: Order of check of conditions in query depends on the build version => Set the fixed and documented check order for WHERE clause and other conditional sentences |
Modified by: @dyemanovassignee: Dmitry Yemanov [ dimitr ] |
Commented by: @dyemanov I've tried your sample, but the truth is a bit different. On Windows, the second query raises the conversion error. |
Commented by: @pmakowski Under MacOsX : LINK_TYPE RIGHT_ID PROP_VALUE LINK_TYPE RIGHT_ID PROP_VALUE SQL> |
Commented by: Dmitry Gogol (dmitrygogol) To Dmitry Yemanov: You are right. I didn't check my sample. Just wrote it. When I checked my real database I have not made full fetch. Sorry. Confused. |
Modified by: @dyemanovstatus: Open [ 1 ] => In Progress [ 3 ] |
Modified by: @dyemanovstatus: In Progress [ 3 ] => Open [ 1 ] |
Modified by: @dyemanovstatus: Open [ 1 ] => In Progress [ 3 ] |
Modified by: @dyemanovstatus: In Progress [ 3 ] => Open [ 1 ] |
Commented by: @dyemanov The new predicate evaluation order is always from left to right. |
Commented by: @pcisar QA test added. |
Modified by: @pcisarstatus: Resolved [ 5 ] => Closed [ 6 ] |
Modified by: @pavel-zotovQA Status: No test |
Modified by: @pavel-zotovQA Status: No test => Done successfully |
Submitted by: Dmitry Gogol (dmitrygogol)
Is related to QA350
CREATE TABLE T_LINKS (
LINK_TYPE INTEGER,
RIGHT_ID INTEGER,
PROP_VALUE VARCHAR(1024)
);
INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(2,161,'2001');
INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(2,161,'2002');
INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(2,161,'2003');
INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(10,161,'ANY STRING');
Fisrt query:
SELECT * FROM T_LINKS
WHERE (RIGHT_ID=161 AND LINK_TYPE=2) AND CAST(PROP_VALUE AS INTEGER)<>2001
Second query:
SELECT * FROM T_LINKS
WHERE CAST(PROP_VALUE AS INTEGER)<>2001 AND (RIGHT_ID=161 AND LINK_TYPE=2)
On Firebird SS build 17798 for Win32 (source Firebird-2.1.0.17798_0_Win32.exe) both queries returns the same result.
On Firebird SS build 17798 for Linux (source FirebirdSS-2.1.0.17798-0.nptl.i686.rpm) second query returns correct result, but first query returns the error:
Overflow occurred during data type conversion.
conversion error from string "Any string"
Error presents even adds index, F.E.:
CREATE INDEX LINKS_RIGHT_ID
ON T_LINKS (RIGHT_ID);
Commits: 1d817af 9b90f01 99a17e9
The text was updated successfully, but these errors were encountered: