~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/bigint.test

code clean move Item_func_abs, Item_func_int_exp, Item_func_ln, Item_func_log to functions directory

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 9223372036854775808 +1;
 
14
select cast(9223372036854775808 as)+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);
19
20
 
20
21
#
21
22
# In 3.23 we have to disable the test of column to bigint as
24
25
#
25
26
 
26
27
create table t1 (a bigint not null, primary key(a));
27
 
insert into t1 values (9223372036854775808);
28
 
insert into t1 values (0x7000000000000000);
 
28
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
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),(9223372036854775808),(9223372036854775807),(9223372036854775808);
 
37
insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
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 (9223372036854775808);
 
44
insert into t1 (big) values (18446744073709551615);
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;
129
129
#
130
130
 
131
131
create table t1 select 1 as 'a';
132
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
133
132
show create table t1;
134
133
drop table t1;
135
134
create table t1 select 9223372036854775809 as 'a';
136
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
137
135
show create table t1;
138
136
select * from t1;
139
137
drop table t1;
150
148
  18446744073709551615, 18446744073709551615
151
149
);
152
150
 
153
 
insert into t1 values (-1,-1,-1,-1);
 
151
insert into t1 values (-1 | 0,-1 | 0,-1 | 0 ,-1 | 0);
154
152
select * from t1;
155
153
drop table t1;
156
154
 
157
155
create table t1 ( quantity decimal(2));
158
 
insert into t1 values (50), (-50), (0), (-1);
 
156
insert into t1 values (500), (-500), (~0), (-1);
159
157
select * from t1;
160
158
drop table t1;
161
159
 
165
163
#
166
164
 
167
165
CREATE TABLE t1 (
168
 
  `col1` INT NULL,
169
 
  `col2` INT NULL,
170
 
  `col3` INT NULL,
171
 
  `col4` INT NULL,
172
 
  `col5` INT NULL,
173
 
  `col6` INT NULL,
174
 
  `col7` INT NULL,
175
 
  `col8` INT NULL,
176
 
  `col9` INT NULL,
177
 
  `col10` BIGINT NULL,
178
 
  `col11` BIGINT NULL,
179
 
  `col12` BIGINT NULL,
180
 
  `col13` BIGINT NULL,
181
 
  `col14` BIGINT NULL,
182
 
  `col15` BIGINT NULL,
183
 
  `col16` BIGINT NULL,
184
 
  `col17` BIGINT NULL,
185
 
  `col18` BIGINT NULL,
 
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,
186
184
  `col19` DECIMAL(19, 0) NULL,
187
185
  `col20` DECIMAL(20, 0) NULL,
188
186
  `col21` DECIMAL(21, 0) NULL,
292
290
--echo
293
291
--echo bug 19955 -- mod is signed with bigint
294
292
 
295
 
select 10000002383263201056 mod 50 as result;
 
293
select cast(10000002383263201056 as) mod 50 as result;
296
294
 
297
295
create table t1 (c1 bigint);
298
296
insert into t1 values (10000002383263201056);
300
298
drop table t1;
301
299
 
302
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
#
303
308
# Bug #28625: -9223372036854775808 doesn't fit in BIGINT.
304
309
#
305
310