@@ -354,3 +354,394 @@ where (A OR (B XOR C)) != (A OR B XOR C);
...
@@ -354,3 +354,394 @@ where (A OR (B XOR C)) != (A OR B XOR C);
count(*)
count(*)
0
0
drop table t1_30237_bool;
drop table t1_30237_bool;
Testing that NOT has precedence over OR
select (NOT FALSE) OR TRUE, NOT (FALSE OR TRUE), NOT FALSE OR TRUE;
(NOT FALSE) OR TRUE NOT (FALSE OR TRUE) NOT FALSE OR TRUE
1 0 1
Testing that NOT has precedence over XOR
select (NOT FALSE) XOR FALSE, NOT (FALSE XOR FALSE), NOT FALSE XOR FALSE;
(NOT FALSE) XOR FALSE NOT (FALSE XOR FALSE) NOT FALSE XOR FALSE
1 1 1
Testing that NOT has precedence over AND
select (NOT FALSE) AND FALSE, NOT (FALSE AND FALSE), NOT FALSE AND FALSE;
(NOT FALSE) AND FALSE NOT (FALSE AND FALSE) NOT FALSE AND FALSE
0 1 0
Testing that NOT is associative
select NOT NOT TRUE, NOT NOT NOT FALSE;
NOT NOT TRUE NOT NOT NOT FALSE
1 1
Testing that IS has precedence over NOT
select (NOT NULL) IS TRUE, NOT (NULL IS TRUE), NOT NULL IS TRUE;
(NOT NULL) IS TRUE NOT (NULL IS TRUE) NOT NULL IS TRUE
0 1 1
select (NOT NULL) IS NOT TRUE, NOT (NULL IS NOT TRUE), NOT NULL IS NOT TRUE;
(NOT NULL) IS NOT TRUE NOT (NULL IS NOT TRUE) NOT NULL IS NOT TRUE
1 0 0
select (NOT NULL) IS FALSE, NOT (NULL IS FALSE), NOT NULL IS FALSE;
(NOT NULL) IS FALSE NOT (NULL IS FALSE) NOT NULL IS FALSE
0 1 1
select (NOT NULL) IS NOT FALSE, NOT (NULL IS NOT FALSE), NOT NULL IS NOT FALSE;
(NOT NULL) IS NOT FALSE NOT (NULL IS NOT FALSE) NOT NULL IS NOT FALSE
1 0 0
select (NOT TRUE) IS UNKNOWN, NOT (TRUE IS UNKNOWN), NOT TRUE IS UNKNOWN;
(NOT TRUE) IS UNKNOWN NOT (TRUE IS UNKNOWN) NOT TRUE IS UNKNOWN
0 1 1
select (NOT TRUE) IS NOT UNKNOWN, NOT (TRUE IS NOT UNKNOWN), NOT TRUE IS NOT UNKNOWN;
(NOT TRUE) IS NOT UNKNOWN NOT (TRUE IS NOT UNKNOWN) NOT TRUE IS NOT UNKNOWN
1 0 0
select (NOT TRUE) IS NULL, NOT (TRUE IS NULL), NOT TRUE IS NULL;
(NOT TRUE) IS NULL NOT (TRUE IS NULL) NOT TRUE IS NULL
0 1 1
select (NOT TRUE) IS NOT NULL, NOT (TRUE IS NOT NULL), NOT TRUE IS NOT NULL;
(NOT TRUE) IS NOT NULL NOT (TRUE IS NOT NULL) NOT TRUE IS NOT NULL
1 0 0
Testing that IS [NOT] TRUE/FALSE/UNKNOWN predicates are not associative
select TRUE IS TRUE IS TRUE IS TRUE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS TRUE IS TRUE' at line 1
select FALSE IS NOT TRUE IS NOT TRUE IS NOT TRUE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT TRUE IS NOT TRUE' at line 1
select NULL IS FALSE IS FALSE IS FALSE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS FALSE IS FALSE' at line 1
select TRUE IS NOT FALSE IS NOT FALSE IS NOT FALSE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT FALSE IS NOT FALSE' at line 1
select FALSE IS UNKNOWN IS UNKNOWN IS UNKNOWN;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS UNKNOWN IS UNKNOWN' at line 1
select TRUE IS NOT UNKNOWN IS NOT UNKNOWN IS NOT UNKNOWN;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NOT UNKNOWN IS NOT UNKNOWN' at line 1
Testing that IS [NOT] NULL predicates are associative
select FALSE IS NULL IS NULL IS NULL;
FALSE IS NULL IS NULL IS NULL
0
select TRUE IS NOT NULL IS NOT NULL IS NOT NULL;
TRUE IS NOT NULL IS NOT NULL IS NOT NULL
1
Testing that comparison operators are left associative