Bug #28005 Partitions: can't use -9223372036854775808

the Item_neg changes INT_RESULT with DECIMAL_RESULT when
it gets this border value, what is not necessary.
parent 306371a8
......@@ -1233,4 +1233,6 @@ select * from t1;
c1 c2
aaa 2
drop table t1;
create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
drop table t1;
End of 5.1 tests
......@@ -1441,5 +1441,11 @@ insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
select * from t1;
drop table t1;
#
# Bug #28005 Partitions: can't use -9223372036854775808
#
create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
drop table t1;
--echo End of 5.1 tests
......@@ -1483,7 +1483,7 @@ void Item_func_neg::fix_length_and_dec()
*/
if (hybrid_type == INT_RESULT &&
args[0]->type() == INT_ITEM &&
((ulonglong) args[0]->val_int() >= (ulonglong) LONGLONG_MIN))
((ulonglong) args[0]->val_int() > (ulonglong) LONGLONG_MIN))
{
/*
Ensure that result is converted to DECIMAL, as longlong can't hold
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment