1
select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5),-(1+1)*-2;
2
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5) -(1+1)*-2
1
select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2;
2
1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2
4
explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5),-(1+1)*-2;
5
id select_type table type possible_keys key key_len ref rows filtered Extra
6
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
8
Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,(8 % 5) AS `mod(8,5)`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2`
4
explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2;
5
id select_type table type possible_keys key key_len ref rows filtered Extra
6
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
8
Note 1003 select (1 + 1) AS `1+1`,(1 - 1) AS `1-1`,(1 + (1 * 2)) AS `1+1*2`,(8 / 5) AS `8/5`,(8 % 5) AS `8%5`,(8 % 5) AS `mod(8,5)`,((8 % 5) | 0) AS `mod(8,5)|0`,(-((1 + 1)) * -(2)) AS `-(1+1)*-2`
9
select 1 | (1+1),5 & 3, bit_count(7) ;
10
1 | (1+1) 5 & 3 bit_count(7)
12
explain extended select 1 | (1+1),5 & 3,bit_count(7) ;
13
id select_type table type possible_keys key key_len ref rows filtered Extra
14
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
16
Note 1003 select (1 | (1 + 1)) AS `1 | (1+1)`,(5 & 3) AS `5 & 3`,bit_count(7) AS `bit_count(7)`
17
select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, 1<< 63 >> 60;
18
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '>> 60' at line 1
19
select 1 << 32,1 << 63, 1 << 64, 4 >> 2, 4 >> 63, (1<< 63) >> 60;
20
1 << 32 1 << 63 1 << 64 4 >> 2 4 >> 63 (1<< 63) >> 60
21
4294967296 9223372036854775808 0 1 0 8
22
select -1 | 0, -1 ^ 0, -1 & 0;
24
18446744073709551615 18446744073709551615 0
25
select -1 | 1, -1 ^ 1, -1 & 1;
27
18446744073709551615 18446744073709551614 1
28
select 1 | -1, 1 ^ -1, 1 & -1;
30
18446744073709551615 18446744073709551614 1
31
select 0 | -1, 0 ^ -1, 0 & -1;
33
18446744073709551615 18446744073709551615 0
34
select -1 >> 0, -1 << 0;
36
18446744073709551615 18446744073709551615
37
select -1 >> 1, -1 << 1;
39
9223372036854775807 18446744073709551614
9
40
drop table if exists t1,t2;
10
41
create table t1(a int);
11
42
create table t2(a int, b int);
12
43
insert into t1 values (1), (2), (3);
13
44
insert into t2 values (1, 7), (3, 7);
14
select t1.a, t2.a, t2.b from t1 left join t2 on t1.a=t2.a;
45
select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a;