~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/bigint.test

merge latest from trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
12
12
select 9223372036854775807,-009223372036854775808;
13
13
select +9999999999999999999,-9999999999999999999;
14
 
select cast(9223372036854775808 as)+1;
 
14
select 9223372036854775808 +1;
15
15
select 9223372036854775808+1;
16
16
select -(0-3),round(-(0-3)), round(9999999999999999999);
17
17
select 1,11,101,1001,10001,100001,1000001,10000001,100000001,1000000001,10000000001,100000000001,1000000000001,10000000000001,100000000000001,1000000000000001,10000000000000001,100000000000000001,1000000000000000001,10000000000000000001;
18
18
select -1,-11,-101,-1001,-10001,-100001,-1000001,-10000001,-100000001,-1000000001,-10000000001,-100000000001,-1000000000001,-10000000000001,-100000000000001,-1000000000000001,-10000000000000001,-100000000000000001,-1000000000000000001,-10000000000000000001;
19
 
select conv(1,10,16),conv((1<<2)-1,10,16),conv((1<<10)-2,10,16),conv((1<<16)-3,10,16),conv((1<<25)-4,10,16),conv((1<<31)-5,10,16),conv((1<<36)-6,10,16),conv((1<<47)-7,10,16),conv((1<<48)-8,10,16),conv((1<<55)-9,10,16),conv((1<<56)-10,10,16),conv((1<<63)-11,10,16);
20
19
 
21
20
#
22
21
# In 3.23 we have to disable the test of column to bigint as
25
24
#
26
25
 
27
26
create table t1 (a bigint not null, primary key(a));
28
 
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
 
27
insert into t1 values (9223372036854775808);
 
28
insert into t1 values (0x7000000000000000);
29
29
select * from t1;
30
30
select * from t1 where a=18446744073709551615;
31
31
# select * from t1 where a='18446744073709551615';
34
34
drop table t1;
35
35
 
36
36
create table t1 ( a int not null default 1, big bigint );
37
 
insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
 
37
insert into t1 (big) values (-1),(9223372036854775808),(9223372036854775807),(9223372036854775808);
38
38
select * from t1;
39
39
select min(big),max(big),max(big)-1 from t1;
40
40
select min(big),max(big),max(big)-1 from t1 group by a;
41
41
alter table t1 modify big bigint not null;
42
42
select min(big),max(big),max(big)-1 from t1;
43
43
select min(big),max(big),max(big)-1 from t1 group by a;
44
 
insert into t1 (big) values (18446744073709551615);
 
44
insert into t1 (big) values (9223372036854775808);
45
45
select * from t1;
46
46
select min(big),max(big),max(big)-1 from t1;
47
47
select min(big),max(big),max(big)-1 from t1 group by a;
148
148
  18446744073709551615, 18446744073709551615
149
149
);
150
150
 
151
 
insert into t1 values (-1 | 0,-1 | 0,-1 | 0 ,-1 | 0);
 
151
insert into t1 values (-1,-1,-1,-1);
152
152
select * from t1;
153
153
drop table t1;
154
154
 
155
155
create table t1 ( quantity decimal(2));
156
 
insert into t1 values (500), (-500), (~0), (-1);
 
156
insert into t1 values (50), (-50), (0), (-1);
157
157
select * from t1;
158
158
drop table t1;
159
159
 
163
163
#
164
164
 
165
165
CREATE TABLE t1 (
166
 
  `col1` INT(1) NULL,
167
 
  `col2` INT(2) NULL,
168
 
  `col3` INT(3) NULL,
169
 
  `col4` INT(4) NULL,
170
 
  `col5` INT(5) NULL,
171
 
  `col6` INT(6) NULL,
172
 
  `col7` INT(7) NULL,
173
 
  `col8` INT(8) NULL,
174
 
  `col9` INT(9) NULL,
175
 
  `col10` BIGINT(10) NULL,
176
 
  `col11` BIGINT(11) NULL,
177
 
  `col12` BIGINT(12) NULL,
178
 
  `col13` BIGINT(13) NULL,
179
 
  `col14` BIGINT(14) NULL,
180
 
  `col15` BIGINT(15) NULL,
181
 
  `col16` BIGINT(16) NULL,
182
 
  `col17` BIGINT(17) NULL,
183
 
  `col18` BIGINT(18) NULL,
 
166
  `col1` INT NULL,
 
167
  `col2` INT NULL,
 
168
  `col3` INT NULL,
 
169
  `col4` INT NULL,
 
170
  `col5` INT NULL,
 
171
  `col6` INT NULL,
 
172
  `col7` INT NULL,
 
173
  `col8` INT NULL,
 
174
  `col9` INT NULL,
 
175
  `col10` BIGINT NULL,
 
176
  `col11` BIGINT NULL,
 
177
  `col12` BIGINT NULL,
 
178
  `col13` BIGINT NULL,
 
179
  `col14` BIGINT NULL,
 
180
  `col15` BIGINT NULL,
 
181
  `col16` BIGINT NULL,
 
182
  `col17` BIGINT NULL,
 
183
  `col18` BIGINT NULL,
184
184
  `col19` DECIMAL(19, 0) NULL,
185
185
  `col20` DECIMAL(20, 0) NULL,
186
186
  `col21` DECIMAL(21, 0) NULL,
290
290
--echo
291
291
--echo bug 19955 -- mod is signed with bigint
292
292
 
293
 
select cast(10000002383263201056 as) mod 50 as result;
 
293
select 10000002383263201056 mod 50 as result;
294
294
 
295
295
create table t1 (c1 bigint);
296
296
insert into t1 values (10000002383263201056);
298
298
drop table t1;
299
299
 
300
300
#
301
 
# Bug #8663 cant use bgint as input to cast
302
 
#
303
 
 
304
 
select cast(19999999999999999999 as signed);
305
 
select cast(-19999999999999999999 as signed);
306
 
 
307
 
#
308
301
# Bug #28625: -9223372036854775808 doesn't fit in BIGINT.
309
302
#
310
303