Commit eb5b5ad4 authored by unknown's avatar unknown

Merge bk@192.168.21.1:mysql-5.1-opt

into  mysql.com:/home/hf/work/28005/my51-28005


sql/item_func.cc:
  Auto merged
parents b32473a3 5083c33f
......@@ -352,3 +352,13 @@ select c1 mod 50 as result from t1;
result
6
drop table t1;
select -9223372036854775808 bi;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def bi 8 20 20 N 32897 0 63
bi
-9223372036854775808
select -9223372036854775809 bi;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def bi 246 20 20 N 129 0 63
bi
-9223372036854775809
......@@ -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
......@@ -288,3 +288,8 @@ insert into t1 values (10000002383263201056);
select c1 mod 50 as result from t1;
drop table t1;
# Bug #28005 Partitions: can't use -9223372036854775808
--enable_metadata
select -9223372036854775808 bi;
select -9223372036854775809 bi;
--disable_metadata
......@@ -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
......@@ -1501,7 +1501,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