2001-09-28 07:05:54 +02:00
|
|
|
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
|
2000-12-28 02:56:38 +01:00
|
|
|
0 256 00000000000000065536 2147483647 -2147483648 2147483648 +4294967296
|
|
|
|
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;
|
2000-12-28 02:56:38 +01:00
|
|
|
+9999999999999999999 -9999999999999999999
|
|
|
|
10000000000000000000 -10000000000000000000
|
2001-09-28 07:05:54 +02:00
|
|
|
drop table if exists t1;
|
|
|
|
create table t1 (a bigint unsigned not null, primary key(a));
|
|
|
|
insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE);
|
|
|
|
select * from t1;
|
2000-12-28 02:56:38 +01:00
|
|
|
a
|
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
|
|
|
select * from t1 where a='18446744073709551615';
|
2001-06-19 13:30:12 +02:00
|
|
|
a
|
2000-12-28 02:56:38 +01:00
|
|
|
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
|
|
|
|
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;
|
2002-01-02 23:46:43 +01:00
|
|
|
select CAST(1-2 AS UNSIGNED);
|
|
|
|
CAST(1-2 AS UNSIGNED)
|
2002-01-02 20:29:41 +01:00
|
|
|
18446744073709551615
|
2002-01-02 23:46:43 +01:00
|
|
|
select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER);
|
|
|
|
CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER)
|
2002-01-02 20:29:41 +01:00
|
|
|
-1
|
2002-01-02 23:46:43 +01:00
|
|
|
select CONVERT('-1',UNSIGNED);
|
|
|
|
CONVERT('-1',UNSIGNED)
|
2002-01-02 20:29:41 +01:00
|
|
|
18446744073709551615
|
2002-01-29 17:32:16 +01:00
|
|
|
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
|
|
|
|
cast(-5 as unsigned) | 1 cast(-5 as unsigned) & -1
|
|
|
|
18446744073709551611 18446744073709551611
|
|
|
|
select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
|
|
|
|
cast(-5 as unsigned) -1 cast(-5 as unsigned) + 1
|
|
|
|
18446744073709551610 18446744073709551612
|
|
|
|
select ~5, cast(~5 as signed);
|
|
|
|
~5 cast(~5 as signed)
|
|
|
|
18446744073709551610 -6
|
|
|
|
select cast(5 as unsigned) -6.0;
|
|
|
|
cast(5 as unsigned) -6.0
|
|
|
|
-1.0
|