3664
CREATE TABLE t1 (a INT);
3665
INSERT INTO t1 VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
3666
CREATE TABLE t2 (b INT);
3667
INSERT INTO t2 VALUES (2);
3668
SELECT * FROM t1 WHERE a = 1 + 1;
3671
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a = 1 + 1;
3672
id select_type table type possible_keys key key_len ref rows filtered Extra
3673
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
3675
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = <cache>((1 + 1)))
3676
SELECT * FROM t1 HAVING a = 1 + 1;
3679
EXPLAIN EXTENDED SELECT * FROM t1 HAVING a = 1 + 1;
3680
id select_type table type possible_keys key key_len ref rows filtered Extra
3681
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
3683
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` having (`test`.`t1`.`a` = <cache>((1 + 1)))
3684
SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
3687
EXPLAIN EXTENDED SELECT * FROM t1, t2 WHERE a = b + (1 + 1);
3688
id select_type table type possible_keys key key_len ref rows filtered Extra
3689
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00
3690
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where; Using join buffer
3692
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where (`test`.`t1`.`a` = (`test`.`t2`.`b` + <cache>((1 + 1))))
3693
SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
3696
EXPLAIN EXTENDED SELECT * FROM t2 LEFT JOIN t1 ON a = b + 1;
3697
id select_type table type possible_keys key key_len ref rows filtered Extra
3698
1 SIMPLE t2 ALL NULL NULL NULL NULL 1 100.00
3699
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00
3701
Note 1003 select `test`.`t2`.`b` AS `b`,`test`.`t1`.`a` AS `a` from `test`.`t2` left join `test`.`t1` on((`test`.`t1`.`a` = (`test`.`t2`.`b` + 1))) where 1
3702
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a > UNIX_TIMESTAMP('2009-03-10 00:00:00');
3703
id select_type table type possible_keys key key_len ref rows filtered Extra
3704
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 100.00 Using where
3706
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` > <cache>(unix_timestamp('2009-03-10 00:00:00')))