|
>> 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. ;-) I've tried your sample, but the truth is a bit different. On Windows, the second query raises the conversion error.
Under MacOsX :
ISQL Version: UI-V2.1.1.17910 Firebird 2.1 Server version: Firebird/Darwin/Intel64 (access method), version "UI-V2.1.1.17910 Firebird 2.1" Firebird/Darwin/Intel64 (remote server), version "UI-V2.1.1.17910 Firebird 2.1/tcp (callandor)/P11" Firebird/Darwin/Intel64 (remote interface), version "UI-V2.1.1.17910 Firebird 2.1/tcp (callandor)/P11" on disk structure version 11.1 SQL> CREATE TABLE T_LINKS ( CON> LINK_TYPE INTEGER, CON> RIGHT_ID INTEGER, CON> PROP_VALUE VARCHAR(1024) CON> ); SQL> INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(2,161,'2001'); SQL> INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(2,161,'2002'); SQL> INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(2,161,'2003'); SQL> INSERT INTO T_LINKS (LINK_TYPE,RIGHT_ID,PROP_VALUE) VALUES(10,161,'ANY STRING'); SQL> commit; SQL> SELECT * FROM T_LINKS CON> WHERE (RIGHT_ID=161 AND LINK_TYPE=2) AND CAST(PROP_VALUE AS INTEGER)<>2001; LINK_TYPE RIGHT_ID PROP_VALUE ============ ============ =============================================================================== 2 161 2002 2 161 2003 Statement failed, SQLCODE = -413 conversion error from string "ANY STRING" SQL> SELECT * FROM T_LINKS CON> WHERE CAST(PROP_VALUE AS INTEGER)<>2001 AND (RIGHT_ID=161 AND LINK_TYPE=2) CON> ; LINK_TYPE RIGHT_ID PROP_VALUE ============ ============ =============================================================================== 2 161 2002 2 161 2003 SQL> To Dmitry Yemanov:
>I've tried your sample, but the truth is a bit different 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. The new predicate evaluation order is always from left to right.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
"Set the fixed and documented check order for WHERE clause and other conditional sentences"