~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_op.result

  • Committer: Brian Aker
  • Date: 2011-02-24 07:11:33 UTC
  • mfrom: (2197.1.5 drizzle-build)
  • Revision ID: brian@tangent.org-20110224071133-kj27247l6bqikdtp
Rollup of all current patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
3
3
2       0       3       1.6000  3       3       3       4
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
7
 
Warnings:
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
 
7
Warnings:
 
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)
 
11
3       1       3
 
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
 
15
Warnings:
 
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;
 
23
-1 | 0  -1 ^ 0  -1 & 0
 
24
18446744073709551615    18446744073709551615    0
 
25
select -1 | 1, -1 ^ 1, -1 & 1;
 
26
-1 | 1  -1 ^ 1  -1 & 1
 
27
18446744073709551615    18446744073709551614    1
 
28
select  1 | -1,  1 ^ -1,  1 & -1;
 
29
1 | -1  1 ^ -1  1 & -1
 
30
18446744073709551615    18446744073709551614    1
 
31
select  0 | -1,  0 ^ -1,  0 & -1;
 
32
0 | -1  0 ^ -1  0 & -1
 
33
18446744073709551615    18446744073709551615    0
 
34
select -1 >> 0, -1 << 0;
 
35
-1 >> 0 -1 << 0
 
36
18446744073709551615    18446744073709551615
 
37
select -1 >> 1, -1 << 1;
 
38
-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;
15
 
a       a       b
16
 
1       1       7
17
 
2       NULL    NULL
18
 
3       3       7
 
45
select t1.a, t2.a, t2.b, bit_count(t2.b) from t1 left join t2 on t1.a=t2.a;
 
46
a       a       b       bit_count(t2.b)
 
47
1       1       7       3
 
48
2       NULL    NULL    NULL
 
49
3       3       7       3
19
50
drop table t1, t2;