~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/bigint.test

  • Committer: kalebral at gmail
  • Date: 2010-12-18 04:43:40 UTC
  • mto: This revision was merged to the branch mainline in revision 2010.
  • Revision ID: kalebral@gmail.com-20101218044340-og61cyjogqwp0k0o
update Copyright strings to a more common format to help with creating the master debian copyright file

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
# This will work on 4.0 as we then have internal handling of bigint variables.
24
24
#
25
25
 
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;
33
33
select * from t1;
34
34
drop table t1;
35
35
 
36
 
create table t1 ( a int not null default 1, big bigint unsigned);
37
 
--error ER_WARN_DATA_OUT_OF_RANGE
 
36
create table t1 ( a int not null default 1, big bigint );
38
37
insert into t1 (big) values (-1),(9223372036854775808),(9223372036854775807),(9223372036854775808);
39
 
--error ER_WARN_DATA_OUT_OF_RANGE
40
 
insert into t1 (big) values (-1);
41
 
insert into t1 (big) values (9223372036854775808),(9223372036854775807),(9223372036854775808);
42
38
select * from t1;
43
39
select min(big),max(big),max(big)-1 from t1;
44
40
select min(big),max(big),max(big)-1 from t1 group by a;
45
41
alter table t1 modify big bigint not null;
46
42
select min(big),max(big),max(big)-1 from t1;
47
43
select min(big),max(big),max(big)-1 from t1 group by a;
48
 
--error ER_WARN_DATA_OUT_OF_RANGE
49
44
insert into t1 (big) values (9223372036854775808);
50
45
select * from t1;
51
46
select min(big),max(big),max(big)-1 from t1;
87
82
 
88
83
# Test for BUG#8562: joins over BIGINT value + constant propagation
89
84
create table t1 (
90
 
 value64  bigint  unsigned not null,
 
85
 value64  bigint  not null,
91
86
 value32  integer          not null,
92
87
 primary key(value64, value32)
93
88
);
94
89
 
95
90
create table t2 (
96
 
 value64  bigint unsigned not null,
 
91
 value64  bigint  not null,
97
92
 value32  integer          not null,
98
93
 primary key(value64, value32)
99
94
);
103
98
insert into t2 values(17156792991891826145, 3);
104
99
insert into t2 values( 9223372036854775807, 4);
105
100
 
106
 
select * from t1 ORDER BY value32;
107
 
select * from t2 ORDER BY value32;
108
 
 
109
 
--sorted_result
110
 
select * from t1, t2 where t1.value64=17156792991891826145 and t2.value64=17156792991891826145;
111
 
--sorted_result
112
 
select * from t1, t2 where t1.value64=17156792991891826145 and t2.value64=t1.value64;
113
 
 
114
 
--sorted_result
115
 
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=9223372036854775807;
116
 
--sorted_result
117
 
select * from t1, t2 where t1.value64= 9223372036854775807 and t2.value64=t1.value64;
 
101
select * from t1;
 
102
select * from t2;
 
103
 
 
104
select * from t1, t2 where t1.value64=17156792991891826145 and
 
105
t2.value64=17156792991891826145;
 
106
select * from t1, t2 where t1.value64=17156792991891826145 and
 
107
t2.value64=t1.value64;
 
108
 
 
109
select * from t1, t2 where t1.value64= 9223372036854775807 and
 
110
t2.value64=9223372036854775807;
 
111
select * from t1, t2 where t1.value64= 9223372036854775807 and
 
112
t2.value64=t1.value64;
118
113
 
119
114
drop table t1, t2;
120
115
 
137
132
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
138
133
show create table t1;
139
134
drop table t1;
140
 
 
141
135
create table t1 select 9223372036854775809 as 'a';
142
136
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
143
137
show create table t1;
144
 
drop table t1;
145
 
 
146
 
create table t1 select 72036854775809 as 'a';
147
 
--replace_regex /ENGINE=[a-zA-Z]+/ENGINE=DEFAULT/
148
 
show create table t1;
149
138
select * from t1;
150
139
drop table t1;
151
 
 
152
140
DROP DATABASE IF EXISTS `scott`;
153
141
 
154
142
 
163
151
);
164
152
 
165
153
insert into t1 values (-1,-1,-1,-1);
166
 
--sorted_result
167
154
select * from t1;
168
155
drop table t1;
169
156
 
170
157
create table t1 ( quantity decimal(2));
171
158
insert into t1 values (50), (-50), (0), (-1);
172
 
--sorted_result
173
159
select * from t1;
174
160
drop table t1;
175
161
 
293
279
999999999.99999999999999999999999999999,
294
280
99999999.999999999999999999999999999999);
295
281
 
296
 
--sorted_result
297
282
SELECT * FROM t1;
298
283
DROP TABLE t1;
299
284
 
300
285
#bug #9088 BIGINT WHERE CLAUSE
301
 
create table t1 (bigint_col bigint unsigned);
 
286
create table t1 (bigint_col bigint);
302
287
insert into t1 values (17666000000000000000);
303
288
select * from t1 where bigint_col=17666000000000000000;
304
289
select * from t1 where bigint_col='17666000000000000000';
309
294
 
310
295
select 10000002383263201056 mod 50 as result;
311
296
 
312
 
create table t1 (c1 bigint unsigned);
 
297
create table t1 (c1 bigint);
313
298
insert into t1 values (10000002383263201056);
314
299
select c1 mod 50 as result from t1;
315
300
drop table t1;