Skip to content

Commit 5b0c8f2

Browse files
author
holyfoot/hf@mysql.com/hfmain.(none)
committed
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.
1 parent 306371a commit 5b0c8f2

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

mysql-test/r/partition.result

+2
Original file line numberDiff line numberDiff line change
@@ -1233,4 +1233,6 @@ select * from t1;
12331233
c1 c2
12341234
aaa 2
12351235
drop table t1;
1236+
create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
1237+
drop table t1;
12361238
End of 5.1 tests

mysql-test/t/partition.test

+6
Original file line numberDiff line numberDiff line change
@@ -1441,5 +1441,11 @@ insert into t1 values ('aaa','1') on duplicate key update c2 = c2 + 1;
14411441
select * from t1;
14421442
drop table t1;
14431443

1444+
#
1445+
# Bug #28005 Partitions: can't use -9223372036854775808
1446+
#
1447+
1448+
create table t1 (s1 bigint) partition by list (s1) (partition p1 values in (-9223372036854775808));
1449+
drop table t1;
14441450

14451451
--echo End of 5.1 tests

sql/item_func.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ void Item_func_neg::fix_length_and_dec()
14831483
*/
14841484
if (hybrid_type == INT_RESULT &&
14851485
args[0]->type() == INT_ITEM &&
1486-
((ulonglong) args[0]->val_int() >= (ulonglong) LONGLONG_MIN))
1486+
((ulonglong) args[0]->val_int() > (ulonglong) LONGLONG_MIN))
14871487
{
14881488
/*
14891489
Ensure that result is converted to DECIMAL, as longlong can't hold

0 commit comments

Comments
 (0)