DROP TABLE IF EXISTS t1;
SELECT IF(NULL AND1, 1, 2), IF(1AND NULL, 1, 2); IF(NULL AND1, 1, 2) IF(1AND NULL, 1, 2) 22
SELECT NULL AND1, 1AND NULL, 0AND NULL, NULL and0;
NULL AND11AND NULL 0AND NULL NULL and0
NULL NULL 00
create table t1 (a int);
insert into t1 values (0),(1),(NULL);
SELECT * FROM t1 WHERE IF(a AND1, 0, 1);
a 0
NULL
SELECT * FROM t1 WHERE IF(1AND a, 0, 1);
a 0
NULL
SELECT * FROM t1 where NOT(a AND1);
a 0
SELECT * FROM t1 where NOT(1AND a);
a 0
SELECT * FROM t1 where (a AND1)=0;
a 0
SELECT * FROM t1 where (1AND a)=0;
a 0
SELECT * FROM t1 where (1AND a)=1;
a 1
SELECT * FROM t1 where (1AND a) IS NULL;
a
NULL set sql_mode='high_not_precedence';
select * from t1 where not a between 2and3;
a set sql_mode=default;
select * from t1 where not a between 2and3;
a 0 1
select a, a is false, a is true, a is unknown from t1;
a a is false a is true a is unknown 0100 1010
NULL 001
select a, a is not false, a is not true, a is not unknown from t1;
a a is not false a is not true a is not unknown 0011 1101
NULL 110 SET @a=0, @b=0;
SELECT * FROM t1 WHERE NULL AND (@a:=@a+1);
a
SELECT * FROM t1 WHERE NOT(a>=0AND NULL AND (@b:=@b+1));
a
SELECT * FROM t1 WHERE a=2OR (NULL AND (@a:=@a+1));
a
SELECT * FROM t1 WHERE NOT(a=2OR (NULL AND (@b:=@b+1)));
a
DROP TABLE t1;
create table t1 (a int, b int);
insert into t1 values(null, null), (0, null), (1, null), (null, 0), (null, 1), (0, 0), (0, 1), (1, 0), (1, 1);
select ifnull(A, 'N') as A, ifnull(B, 'N') as B, ifnull(not A, 'N') as nA, ifnull(not B, 'N') as nB, ifnull(A and B, 'N') as AB, ifnull(not (A and B), 'N') as `n(AB)`, ifnull((not A ornot B), 'N') as nAonB, ifnull(A or B, 'N') as AoB, ifnull(not(A or B), 'N') as `n(AoB)`, ifnull(not A andnot B, 'N') as nAnB from t1;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N 0 N 1 N 011 N N N 1 N 0 N N N N 100
N 0 N 1011 N N N
N 1 N 0 N N N 100 0011011011 0110011100 1001011100 1100100100
select ifnull(A=1, 'N') as A, ifnull(B=1, 'N') as B, ifnull(not (A=1), 'N') as nA, ifnull(not (B=1), 'N') as nB, ifnull((A=1) and (B=1), 'N') as AB, ifnull(not ((A=1) and (B=1)), 'N') as `n(AB)`, ifnull((not (A=1) ornot (B=1)), 'N') as nAonB, ifnull((A=1) or (B=1), 'N') as AoB, ifnull(not((A=1) or (B=1)), 'N') as `n(AoB)`, ifnull(not (A=1) andnot (B=1), 'N') as nAnB from t1;
A B nA nB AB n(AB) nAonB AoB n(AoB) nAnB
N N N N N N N N N N 0 N 1 N 011 N N N 1 N 0 N N N N 100
N 0 N 1011 N N N
N 1 N 0 N N N 100 0011011011 0110011100 1001011100 1100100100
drop table t1;
# Start of 10.6 tests
#
# MDEV-34189 Unexpected error on `WHERE inet6col`
#
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY, a INT, KEY(a));
INSERT INTO t1 VALUES (-1,NULL);
INSERT INTO t1 SELECT seq,seq FROM seq_0_to_31;
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE a;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL a NULL NULL NULL 3396.97 Using where
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is true
SELECT id, a FROM t1 WHERE a;
id a 11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE NOT a;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1100.00 Using index condition
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is false
SELECT id, a FROM t1 WHERE NOT a;
id a 00
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE a IS TRUE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL a NULL NULL NULL 3396.97 Using where
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is true
SELECT id, a FROM t1 WHERE a IS TRUE;
id a 11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE NOT a IS TRUE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 2100.00 Using index condition
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not true
SELECT id, a FROM t1 WHERE NOT a IS TRUE;
id a
-1 NULL 00
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE a IS NOT TRUE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 2100.00 Using index condition
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not true
SELECT id, a FROM t1 WHERE a IS NOT TRUE;
id a
-1 NULL 00
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE NOT a IS NOT TRUE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL a NULL NULL NULL 3396.97 Using where
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is true
SELECT id, a FROM t1 WHERE NOT a IS NOT TRUE;
id a 11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE a IS FALSE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1100.00 Using index condition
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is false
SELECT id, a FROM t1 WHERE a IS FALSE;
id a 00
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE NOT a IS FALSE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL a NULL NULL NULL 3396.97 Using where
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not false
SELECT id, a FROM t1 WHERE NOT a IS FALSE;
id a
-1 NULL 11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE a IS NOT FALSE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 ALL a NULL NULL NULL 3396.97 Using where
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is not false
SELECT id, a FROM t1 WHERE a IS NOT FALSE;
id a
-1 NULL 11 22 33 44 55 66 77 88 99 1010 1111 1212 1313 1414 1515 1616 1717 1818 1919 2020 2121 2222 2323 2424 2525 2626 2727 2828 2929 3030 3131
EXPLAIN EXTENDED
SELECT id, a FROM t1 WHERE NOT a IS NOT FALSE;
id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 range a a 5 NULL 1100.00 Using index condition
Warnings:
Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` is false
SELECT id, a FROM t1 WHERE NOT a IS NOT FALSE;
id a 00
DROP TABLE t1;
# End of 10.6 tests
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.