~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/bigint.result

  • Committer: Brian Aker
  • Date: 2010-12-20 19:20:57 UTC
  • mto: This revision was merged to the branch mainline in revision 2016.
  • Revision ID: brian@tangent.org-20101220192057-1ch4b9uo008d8rje
Merge in additional fixes for sign, plus alter table, plus TIME on
processlist.

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 not null, primary key(a));
 
26
create table t1 (a bigint unsigned 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
8070450532247928832
31
32
-9223372036854775808
32
 
8070450532247928832
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
8070450532247928832
38
39
-9223372036854775808
39
 
8070450532247928832
40
40
drop table t1;
41
 
create table t1 ( a int not null default 1, big bigint );
 
41
create table t1 ( a int not null default 1, big bigint unsigned);
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);
43
47
select * from t1;
44
48
a       big
45
 
1       -1
46
49
1       -9223372036854775808
47
50
1       9223372036854775807
48
51
1       -9223372036854775808
49
52
select min(big),max(big),max(big)-1 from t1;
50
53
min(big)        max(big)        max(big)-1
51
 
-9223372036854775808    9223372036854775807     9223372036854775806
 
54
9223372036854775807     9223372036854775808     9223372036854775807
52
55
select min(big),max(big),max(big)-1 from t1 group by a;
53
56
min(big)        max(big)        max(big)-1
54
 
-9223372036854775808    9223372036854775807     9223372036854775806
 
57
9223372036854775807     -9223372036854775808    9223372036854775807
55
58
alter table t1 modify big bigint not null;
56
59
select min(big),max(big),max(big)-1 from t1;
57
60
min(big)        max(big)        max(big)-1
60
63
min(big)        max(big)        max(big)-1
61
64
-9223372036854775808    9223372036854775807     9223372036854775806
62
65
insert into t1 (big) values (9223372036854775808);
 
66
ERROR 22003: Out of range value for column 'big' at row 1
63
67
select * from t1;
64
68
a       big
65
 
1       -1
66
69
1       -9223372036854775808
67
70
1       9223372036854775807
68
71
1       -9223372036854775808
69
 
1       -9223372036854775808
70
72
select min(big),max(big),max(big)-1 from t1;
71
73
min(big)        max(big)        max(big)-1
72
74
-9223372036854775808    9223372036854775807     9223372036854775806
83
85
alter table t1 modify big bigint not null;
84
86
select * from t1;
85
87
a       big
86
 
1       -1
87
88
1       -9223372036854775808
88
89
1       9223372036854775807
89
90
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  not null,
 
123
value64  bigint  unsigned not null,
124
124
value32  integer          not null,
125
125
primary key(value64, value32)
126
126
);
127
127
create table t2 (
128
 
value64  bigint  not null,
 
128
value64  bigint unsigned 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;
 
136
select * from t1 ORDER BY value32;
137
137
value64 value32
138
138
-1289951081817725471    1
139
139
9223372036854775807     2
140
 
select * from t2;
 
140
select * from t2 ORDER BY value32;
141
141
value64 value32
142
142
-1289951081817725471    3
143
143
9223372036854775807     4
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;
 
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;
154
151
value64 value32 value64 value32
155
152
9223372036854775807     2       9223372036854775807     4
156
 
select * from t1, t2 where t1.value64= 9223372036854775807 and
157
 
t2.value64=t1.value64;
 
153
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=t1.value64;
158
154
value64 value32 value64 value32
159
155
9223372036854775807     2       9223372036854775807     4
160
156
drop table t1, t2;
175
171
show create table t1;
176
172
Table   Create Table
177
173
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` (
178
181
  `a` BIGINT NOT NULL
179
182
) ENGINE=DEFAULT COLLATE = utf8_general_ci
180
183
select * from t1;
181
184
a
182
 
-9223372036854775807
 
185
72036854775809
183
186
drop table t1;
184
187
DROP DATABASE IF EXISTS `scott`;
185
188
Warnings:
192
195
insert into t1 values (-1,-1,-1,-1);
193
196
select * from t1;
194
197
a       b       c       d
 
198
-1      -1      -1      -1
195
199
18446744073709551615    18446744073709551615    18446744073709551615    18446744073709551615
196
 
-1      -1      -1      -1
197
200
drop table t1;
198
201
create table t1 ( quantity decimal(2));
199
202
insert into t1 values (50), (-50), (0), (-1);
200
203
select * from t1;
201
204
quantity
 
205
-1
 
206
-50
 
207
0
202
208
50
203
 
-50
204
 
0
205
 
-1
206
209
drop table t1;
207
210
CREATE TABLE t1 (
208
211
`col1` INT NULL,
321
324
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
322
325
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
323
326
DROP TABLE t1;
324
 
create table t1 (bigint_col bigint);
 
327
create table t1 (bigint_col bigint unsigned);
325
328
insert into t1 values (17666000000000000000);
326
329
select * from t1 where bigint_col=17666000000000000000;
327
330
bigint_col
334
337
select 10000002383263201056 mod 50 as result;
335
338
result
336
339
6
337
 
create table t1 (c1 bigint);
 
340
create table t1 (c1 bigint unsigned);
338
341
insert into t1 values (10000002383263201056);
339
342
select c1 mod 50 as result from t1;
340
343
result
341
 
-10
 
344
6
342
345
drop table t1;
343
346
select -9223372036854775808;
344
347
Catalog Database        Table   Table_alias     Column  Column_alias    Type    Length  Max length      Is_null Flags   Decimals        Charsetnr