~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/bigint.result

  • Committer: Lee Bieber
  • Date: 2010-11-07 19:34:48 UTC
  • mfrom: (1910.1.2 build)
  • Revision ID: kalebral@gmail.com-20101107193448-64kdu912qej354sh
Merge Stewart - including adapting and expanding the "differences from mysql" page from the wiki.
Merge Stewart - fix bug 668143: drizzleslap with --commit runs second iteration data load in a transaction

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
24
24
-1      -11     -101    -1001   -10001  -100001 -1000001        -10000001       -100000001      -1000000001     -10000000001    -100000000001   -1000000000001  -10000000000001 -100000000000001        -1000000000000001       -10000000000000001      -100000000000000001     -1000000000000000001    -10000000000000000001
25
25
-1      -11     -101    -1001   -10001  -100001 -1000001        -10000001       -100000001      -1000000001     -10000000001    -100000000001   -1000000000001  -10000000000001 -100000000000001        -1000000000000001       -10000000000000001      -100000000000000001     -1000000000000000001    -10000000000000000001
26
 
create table t1 (a bigint unsigned not null, primary key(a));
 
26
create table t1 (a bigint not null, primary key(a));
27
27
insert into t1 values (9223372036854775808);
28
28
insert into t1 values (0x7000000000000000);
29
29
select * from t1;
30
30
a
 
31
-9223372036854775808
31
32
8070450532247928832
32
 
-9223372036854775808
33
33
select * from t1 where a=18446744073709551615;
34
34
a
35
35
delete from t1 where a=18446744073709551615;
36
36
select * from t1;
37
37
a
 
38
-9223372036854775808
38
39
8070450532247928832
39
 
-9223372036854775808
40
40
drop table t1;
41
 
create table t1 ( a int not null default 1, big bigint unsigned);
 
41
create table t1 ( a int not null default 1, big bigint );
42
42
insert into t1 (big) values (-1),(9223372036854775808),(9223372036854775807),(9223372036854775808);
43
 
ERROR 22003: Out of range value for column 'big' at row 1
44
 
insert into t1 (big) values (-1);
45
 
ERROR 22003: Out of range value for column 'big' at row 1
46
 
insert into t1 (big) values (9223372036854775808),(9223372036854775807),(9223372036854775808);
47
43
select * from t1;
48
44
a       big
 
45
1       -1
49
46
1       -9223372036854775808
50
47
1       9223372036854775807
51
48
1       -9223372036854775808
52
49
select min(big),max(big),max(big)-1 from t1;
53
50
min(big)        max(big)        max(big)-1
54
 
9223372036854775807     9223372036854775808     9223372036854775807
 
51
-9223372036854775808    9223372036854775807     9223372036854775806
55
52
select min(big),max(big),max(big)-1 from t1 group by a;
56
53
min(big)        max(big)        max(big)-1
57
 
9223372036854775807     -9223372036854775808    9223372036854775807
 
54
-9223372036854775808    9223372036854775807     9223372036854775806
58
55
alter table t1 modify big bigint not null;
59
56
select min(big),max(big),max(big)-1 from t1;
60
57
min(big)        max(big)        max(big)-1
63
60
min(big)        max(big)        max(big)-1
64
61
-9223372036854775808    9223372036854775807     9223372036854775806
65
62
insert into t1 (big) values (9223372036854775808);
66
 
ERROR 22003: Out of range value for column 'big' at row 1
67
63
select * from t1;
68
64
a       big
 
65
1       -1
69
66
1       -9223372036854775808
70
67
1       9223372036854775807
71
68
1       -9223372036854775808
 
69
1       -9223372036854775808
72
70
select min(big),max(big),max(big)-1 from t1;
73
71
min(big)        max(big)        max(big)-1
74
72
-9223372036854775808    9223372036854775807     9223372036854775806
85
83
alter table t1 modify big bigint not null;
86
84
select * from t1;
87
85
a       big
 
86
1       -1
88
87
1       -9223372036854775808
89
88
1       9223372036854775807
90
89
1       -9223372036854775808
 
90
1       -9223372036854775808
91
91
select min(big),max(big),max(big)-1 from t1;
92
92
min(big)        max(big)        max(big)-1
93
93
-9223372036854775808    9223372036854775807     9223372036854775806
120
120
Warnings:
121
121
Warning 1292    Truncated incorrect DOUBLE value: '0x8000000000000001'
122
122
create table t1 (
123
 
value64  bigint  unsigned not null,
 
123
value64  bigint  not null,
124
124
value32  integer          not null,
125
125
primary key(value64, value32)
126
126
);
127
127
create table t2 (
128
 
value64  bigint unsigned not null,
 
128
value64  bigint  not null,
129
129
value32  integer          not null,
130
130
primary key(value64, value32)
131
131
);
133
133
insert into t1 values( 9223372036854775807, 2);
134
134
insert into t2 values(17156792991891826145, 3);
135
135
insert into t2 values( 9223372036854775807, 4);
136
 
select * from t1 ORDER BY value32;
 
136
select * from t1;
137
137
value64 value32
138
138
-1289951081817725471    1
139
139
9223372036854775807     2
140
 
select * from t2 ORDER BY value32;
 
140
select * from t2;
141
141
value64 value32
142
142
-1289951081817725471    3
143
143
9223372036854775807     4
144
 
select * from t1, t2 where t1.value64=17156792991891826145 and t2.value64=17156792991891826145;
145
 
value64 value32 value64 value32
146
 
-1289951081817725471    1       -1289951081817725471    3
147
 
select * from t1, t2 where t1.value64=17156792991891826145 and t2.value64=t1.value64;
148
 
value64 value32 value64 value32
149
 
-1289951081817725471    1       -1289951081817725471    3
150
 
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=9223372036854775807;
 
144
select * from t1, t2 where t1.value64=17156792991891826145 and
 
145
t2.value64=17156792991891826145;
 
146
value64 value32 value64 value32
 
147
-1289951081817725471    1       -1289951081817725471    3
 
148
select * from t1, t2 where t1.value64=17156792991891826145 and
 
149
t2.value64=t1.value64;
 
150
value64 value32 value64 value32
 
151
-1289951081817725471    1       -1289951081817725471    3
 
152
select * from t1, t2 where t1.value64= 9223372036854775807 and
 
153
t2.value64=9223372036854775807;
151
154
value64 value32 value64 value32
152
155
9223372036854775807     2       9223372036854775807     4
153
 
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=t1.value64;
 
156
select * from t1, t2 where t1.value64= 9223372036854775807 and
 
157
t2.value64=t1.value64;
154
158
value64 value32 value64 value32
155
159
9223372036854775807     2       9223372036854775807     4
156
160
drop table t1, t2;
171
175
show create table t1;
172
176
Table   Create Table
173
177
t1      CREATE TABLE `t1` (
174
 
  `a` BIGINT UNSIGNED NOT NULL
175
 
) ENGINE=DEFAULT COLLATE = utf8_general_ci
176
 
drop table t1;
177
 
create table t1 select 72036854775809 as 'a';
178
 
show create table t1;
179
 
Table   Create Table
180
 
t1      CREATE TABLE `t1` (
181
178
  `a` BIGINT NOT NULL
182
179
) ENGINE=DEFAULT COLLATE = utf8_general_ci
183
180
select * from t1;
184
181
a
185
 
72036854775809
 
182
-9223372036854775807
186
183
drop table t1;
187
184
DROP DATABASE IF EXISTS `scott`;
188
185
Warnings:
195
192
insert into t1 values (-1,-1,-1,-1);
196
193
select * from t1;
197
194
a       b       c       d
 
195
18446744073709551615    18446744073709551615    18446744073709551615    18446744073709551615
198
196
-1      -1      -1      -1
199
 
18446744073709551615    18446744073709551615    18446744073709551615    18446744073709551615
200
197
drop table t1;
201
198
create table t1 ( quantity decimal(2));
202
199
insert into t1 values (50), (-50), (0), (-1);
203
200
select * from t1;
204
201
quantity
 
202
50
 
203
-50
 
204
0
205
205
-1
206
 
-50
207
 
0
208
 
50
209
206
drop table t1;
210
207
CREATE TABLE t1 (
211
208
`col1` INT NULL,
324
321
col1    col2    col3    col4    col5    col6    col7    col8    col9    col10   col11   col12   col13   col14   col15   col16   col17   col18   col19   col20   col21   col22   col23   col24   col25   col26   col27   col28   col29   col30   col31   col32   col33   col34   col35   col36   col37   col38   fix1    fix2    fix3    fix4    fix5    fix6    fix7    fix8    fix9    fix10   fix11   fix12   fix13   fix14   fix15   fix16   fix17   fix18   fix19   fix20   fix21   fix22   fix23   fix24   fix25   fix26   fix27   fix28   fix29   fix30
325
322
9       99      999     9999    99999   999999  9999999 99999999        999999999       9999999999      99999999999     999999999999    9999999999999   99999999999999  999999999999999 9999999999999999        99999999999999999       999999999999999999      9999999999999999999     99999999999999999999    999999999999999999999   9999999999999999999999  99999999999999999999999 999999999999999999999999        9999999999999999999999999       99999999999999999999999999      999999999999999999999999999     9999999999999999999999999999    99999999999999999999999999999   999999999999999999999999999999  9999999999999999999999999999999 99999999999999999999999999999999        999999999999999999999999999999999       9999999999999999999999999999999999      99999999999999999999999999999999999     999999999999999999999999999999999999    9999999999999999999999999999999999999   99999999999999999999999999999999999999  9999999999999999999999999999999999999.9 999999999999999999999999999999999999.99 99999999999999999999999999999999999.999 9999999999999999999999999999999999.9999 999999999999999999999999999999999.99999 99999999999999999999999999999999.999999 9999999999999999999999999999999.9999999 999999999999999999999999999999.99999999 99999999999999999999999999999.999999999 9999999999999999999999999999.9999999999 999999999999999999999999999.99999999999 99999999999999999999999999.999999999999 9999999999999999999999999.9999999999999 999999999999999999999999.99999999999999 99999999999999999999999.999999999999999 9999999999999999999999.9999999999999999 999999999999999999999.99999999999999999 99999999999999999999.999999999999999999 9999999999999999999.9999999999999999999 999999999999999999.99999999999999999999 99999999999999999.999999999999999999999 9999999999999999.9999999999999999999999 999999999999999.99999999999999999999999 99999999999999.999999999999999999999999 9999999999999.9999999999999999999999999 999999999999.99999999999999999999999999 99999999999.999999999999999999999999999 9999999999.9999999999999999999999999999 999999999.99999999999999999999999999999 99999999.999999999999999999999999999999
326
323
DROP TABLE t1;
327
 
create table t1 (bigint_col bigint unsigned);
 
324
create table t1 (bigint_col bigint);
328
325
insert into t1 values (17666000000000000000);
329
326
select * from t1 where bigint_col=17666000000000000000;
330
327
bigint_col
337
334
select 10000002383263201056 mod 50 as result;
338
335
result
339
336
6
340
 
create table t1 (c1 bigint unsigned);
 
337
create table t1 (c1 bigint);
341
338
insert into t1 values (10000002383263201056);
342
339
select c1 mod 50 as result from t1;
343
340
result
344
 
6
 
341
-10
345
342
drop table t1;
346
343
select -9223372036854775808;
347
344
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr