mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/hf/work/8663/my50-8663
into mysql.com:/home/hf/work/8663/my51-8663 strings/decimal.c: Auto merged mysql-test/r/bigint.result: SCCS merged mysql-test/t/bigint.test: merging
This commit is contained in:
@ -352,6 +352,16 @@ select c1 mod 50 as result from t1;
|
|||||||
result
|
result
|
||||||
6
|
6
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
select cast(19999999999999999999 as signed);
|
||||||
|
cast(19999999999999999999 as signed)
|
||||||
|
9223372036854775807
|
||||||
|
Warnings:
|
||||||
|
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||||
|
select cast(-19999999999999999999 as signed);
|
||||||
|
cast(-19999999999999999999 as signed)
|
||||||
|
-9223372036854775808
|
||||||
|
Warnings:
|
||||||
|
Error 1292 Truncated incorrect DECIMAL value: ''
|
||||||
create table t1 select -9223372036854775808 bi;
|
create table t1 select -9223372036854775808 bi;
|
||||||
describe t1;
|
describe t1;
|
||||||
Field Type Null Key Default Extra
|
Field Type Null Key Default Extra
|
||||||
|
@ -288,6 +288,13 @@ insert into t1 values (10000002383263201056);
|
|||||||
select c1 mod 50 as result from t1;
|
select c1 mod 50 as result from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #8663 cant use bgint unsigned as input to cast
|
||||||
|
#
|
||||||
|
|
||||||
|
select cast(19999999999999999999 as signed);
|
||||||
|
select cast(-19999999999999999999 as signed);
|
||||||
|
|
||||||
# Bug #28005 Partitions: can't use -9223372036854775808
|
# Bug #28005 Partitions: can't use -9223372036854775808
|
||||||
create table t1 select -9223372036854775808 bi;
|
create table t1 select -9223372036854775808 bi;
|
||||||
describe t1;
|
describe t1;
|
||||||
|
@ -1089,7 +1089,11 @@ int decimal2longlong(decimal_t *from, longlong *to)
|
|||||||
x=x*DIG_BASE - *buf++;
|
x=x*DIG_BASE - *buf++;
|
||||||
if (unlikely(y < (LONGLONG_MIN/DIG_BASE) || x > y))
|
if (unlikely(y < (LONGLONG_MIN/DIG_BASE) || x > y))
|
||||||
{
|
{
|
||||||
*to= from->sign ? y : -y;
|
/*
|
||||||
|
the decimal is bigger than any possible integer
|
||||||
|
return border integer depending on the sign
|
||||||
|
*/
|
||||||
|
*to= from->sign ? LONGLONG_MIN : LONGLONG_MAX;
|
||||||
return E_DEC_OVERFLOW;
|
return E_DEC_OVERFLOW;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user