2003-01-06 00:48:59 +01:00
|
|
|
drop table if exists t1;
|
2001-09-28 07:05:54 +02:00
|
|
|
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
|
2003-07-20 12:26:18 +02:00
|
|
|
0 256 00000000000000065536 2147483647 -2147483648 2147483648 4294967296
|
2000-12-28 02:56:38 +01:00
|
|
|
0 256 65536 2147483647 -2147483648 2147483648 4294967296
|
2001-09-28 07:05:54 +02:00
|
|
|
select 9223372036854775807,-009223372036854775808;
|
2000-12-28 02:56:38 +01:00
|
|
|
9223372036854775807 -009223372036854775808
|
|
|
|
9223372036854775807 -9223372036854775808
|
2001-09-28 07:05:54 +02:00
|
|
|
select +9999999999999999999,-9999999999999999999;
|
2003-07-20 12:26:18 +02:00
|
|
|
9999999999999999999 -9999999999999999999
|
2005-02-08 23:50:45 +01:00
|
|
|
9999999999999999999 -9999999999999999999
|
2003-02-25 23:13:18 +01:00
|
|
|
select cast(9223372036854775808 as unsigned)+1;
|
|
|
|
cast(9223372036854775808 as unsigned)+1
|
|
|
|
9223372036854775809
|
2003-02-04 00:05:39 +01:00
|
|
|
select 9223372036854775808+1;
|
|
|
|
9223372036854775808+1
|
2003-02-27 01:10:19 +01:00
|
|
|
9223372036854775809
|
2003-07-20 12:26:18 +02:00
|
|
|
select -(0-3),round(-(0-3)), round(9999999999999999999);
|
|
|
|
-(0-3) round(-(0-3)) round(9999999999999999999)
|
2005-02-08 23:50:45 +01:00
|
|
|
3 3 9999999999999999999
|
2001-09-28 07:05:54 +02:00
|
|
|
create table t1 (a bigint unsigned not null, primary key(a));
|
2003-11-20 23:11:50 +01:00
|
|
|
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
|
2001-09-28 07:05:54 +02:00
|
|
|
select * from t1;
|
2000-12-28 02:56:38 +01:00
|
|
|
a
|
2003-11-20 23:11:50 +01:00
|
|
|
18446744073709551612
|
|
|
|
18446744073709551613
|
2001-06-19 13:30:12 +02:00
|
|
|
18446744073709551614
|
2000-12-28 02:56:38 +01:00
|
|
|
18446744073709551615
|
2001-09-28 07:05:54 +02:00
|
|
|
select * from t1 where a=18446744073709551615;
|
2001-06-19 13:30:12 +02:00
|
|
|
a
|
|
|
|
18446744073709551615
|
2001-09-28 07:05:54 +02:00
|
|
|
delete from t1 where a=18446744073709551615;
|
|
|
|
select * from t1;
|
2001-06-19 13:30:12 +02:00
|
|
|
a
|
2003-11-20 23:11:50 +01:00
|
|
|
18446744073709551612
|
|
|
|
18446744073709551613
|
2001-06-19 13:30:12 +02:00
|
|
|
18446744073709551614
|
2001-09-28 07:05:54 +02:00
|
|
|
drop table t1;
|
2001-10-03 23:19:58 +02:00
|
|
|
create table t1 ( a int not null default 1, big bigint );
|
|
|
|
insert into t1 (big) values (-1),(12345678901234567),(9223372036854775807),(18446744073709551615);
|
|
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
-1 9223372036854775807 9223372036854775806
|
|
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
-1 9223372036854775807 9223372036854775806
|
|
|
|
alter table t1 modify big bigint unsigned not null;
|
|
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
12345678901234567 18446744073709551615 18446744073709551614
|
|
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
12345678901234567 18446744073709551615 18446744073709551614
|
|
|
|
alter table t1 add key (big);
|
|
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
12345678901234567 18446744073709551615 18446744073709551614
|
|
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
12345678901234567 18446744073709551615 18446744073709551614
|
|
|
|
alter table t1 modify big bigint not null;
|
|
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
-1 9223372036854775807 9223372036854775806
|
|
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
|
|
min(big) max(big) max(big)-1
|
|
|
|
-1 9223372036854775807 9223372036854775806
|
|
|
|
drop table t1;
|
2003-02-04 00:05:39 +01:00
|
|
|
create table t1 (id bigint auto_increment primary key, a int) auto_increment=9999999999;
|
|
|
|
insert into t1 values (null,1);
|
|
|
|
select * from t1;
|
|
|
|
id a
|
|
|
|
9999999999 1
|
|
|
|
select * from t1 limit 9999999999;
|
|
|
|
id a
|
|
|
|
9999999999 1
|
|
|
|
drop table t1;
|
2003-11-16 17:37:15 +01:00
|
|
|
CREATE TABLE t1 ( quantity decimal(60,0));
|
|
|
|
insert into t1 values (10000000000000000000);
|
2003-11-20 23:11:50 +01:00
|
|
|
insert into t1 values (10000000000000000000.0);
|
2003-11-16 17:37:15 +01:00
|
|
|
insert into t1 values ('10000000000000000000');
|
|
|
|
select * from t1;
|
|
|
|
quantity
|
2003-11-20 23:11:50 +01:00
|
|
|
-8446744073709551616
|
2003-11-16 17:37:15 +01:00
|
|
|
10000000000000000000
|
|
|
|
10000000000000000000
|
|
|
|
drop table t1;
|
2004-02-24 12:31:33 +01:00
|
|
|
SELECT '0x8000000000000001'+0;
|
|
|
|
'0x8000000000000001'+0
|
|
|
|
0
|
2005-02-28 21:50:06 +01:00
|
|
|
create table t1 (
|
|
|
|
value64 bigint unsigned not null,
|
|
|
|
value32 integer not null,
|
|
|
|
primary key(value64, value32)
|
|
|
|
);
|
|
|
|
create table t2 (
|
|
|
|
value64 bigint unsigned not null,
|
|
|
|
value32 integer not null,
|
|
|
|
primary key(value64, value32)
|
|
|
|
);
|
|
|
|
insert into t1 values(17156792991891826145, 1);
|
|
|
|
insert into t1 values( 9223372036854775807, 2);
|
|
|
|
insert into t2 values(17156792991891826145, 3);
|
|
|
|
insert into t2 values( 9223372036854775807, 4);
|
|
|
|
select * from t1;
|
|
|
|
value64 value32
|
|
|
|
9223372036854775807 2
|
|
|
|
17156792991891826145 1
|
|
|
|
select * from t2;
|
|
|
|
value64 value32
|
|
|
|
9223372036854775807 4
|
|
|
|
17156792991891826145 3
|
|
|
|
select * from t1, t2 where t1.value64=17156792991891826145 and
|
|
|
|
t2.value64=17156792991891826145;
|
|
|
|
value64 value32 value64 value32
|
|
|
|
17156792991891826145 1 17156792991891826145 3
|
|
|
|
select * from t1, t2 where t1.value64=17156792991891826145 and
|
|
|
|
t2.value64=t1.value64;
|
|
|
|
value64 value32 value64 value32
|
|
|
|
17156792991891826145 1 17156792991891826145 3
|
|
|
|
select * from t1, t2 where t1.value64= 9223372036854775807 and
|
|
|
|
t2.value64=9223372036854775807;
|
|
|
|
value64 value32 value64 value32
|
|
|
|
9223372036854775807 2 9223372036854775807 4
|
|
|
|
select * from t1, t2 where t1.value64= 9223372036854775807 and
|
|
|
|
t2.value64=t1.value64;
|
|
|
|
value64 value32 value64 value32
|
|
|
|
9223372036854775807 2 9223372036854775807 4
|
|
|
|
drop table t1, t2;
|