mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
514e60480d
BitKeeper/deleted/.del-global.h~e80d28157acfdcb5: Auto merged Docs/manual.texi: Auto merged include/my_no_pthread.h: Auto merged innobase/include/univ.i: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/os/os0thread.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/ut/ut0ut.c: Auto merged mysql-test/r/bigint.result: Auto merged mysql-test/t/bigint.test: Auto merged mysys/my_init.c: Auto merged mysys/my_net.c: Auto merged mysys/mysys_priv.h: Auto merged mysys/thr_rwlock.c: Auto merged sql/ha_innodb.h: Auto merged sql/sql_insert.cc: Auto merged include/my_sys.h: merge with 3.23 libmysql/Makefile.shared: merge with 3.23 mysql-test/mysql-test-run.sh: merge with 3.23 mysql-test/r/func_if.result: merge with 3.23 mysys/Makefile.am: merge with 3.23 mysys/my_gethostbyname.c: merge with 3.23 sql/ha_innodb.cc: merge with 3.23 sql/item_cmpfunc.cc: merge with 3.23 sql/mysqld.cc: merge with 3.23 sql/sql_show.cc: merge with 3.23
45 lines
1.7 KiB
Text
45 lines
1.7 KiB
Text
#
|
|
# Test of reading of bigint values
|
|
#
|
|
select 0,256,00000000000000065536,2147483647,-2147483648,2147483648,+4294967296;
|
|
select 9223372036854775807,-009223372036854775808;
|
|
select +9999999999999999999,-9999999999999999999;
|
|
|
|
#
|
|
# In 3.23 we have to disable the test of column to bigint as
|
|
# this fails on AIX powerpc (the resolution for double is not good enough)
|
|
# This will work on 4.0 as we then have internal handling of bigint variables.
|
|
#
|
|
|
|
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;
|
|
select * from t1 where a=18446744073709551615;
|
|
# select * from t1 where a='18446744073709551615';
|
|
delete from t1 where a=18446744073709551615;
|
|
select * from t1;
|
|
drop table t1;
|
|
|
|
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;
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
alter table t1 modify big bigint unsigned not null;
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
alter table t1 add key (big);
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
alter table t1 modify big bigint not null;
|
|
select min(big),max(big),max(big)-1 from t1;
|
|
select min(big),max(big),max(big)-1 from t1 group by a;
|
|
drop table t1;
|
|
|
|
select CAST(1-2 AS UNSIGNED);
|
|
select CAST(CAST(1-2 AS UNSIGNED) AS SIGNED INTEGER);
|
|
select CONVERT('-1',UNSIGNED);
|
|
select cast(-5 as unsigned) | 1, cast(-5 as unsigned) & -1;
|
|
select cast(-5 as unsigned) -1, cast(-5 as unsigned) + 1;
|
|
select ~5, cast(~5 as signed);
|
|
select cast(5 as unsigned) -6.0;
|