diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result index b406dbab82f..79943df18c5 100644 --- a/mysql-test/r/type_newdecimal.result +++ b/mysql-test/r/type_newdecimal.result @@ -928,3 +928,9 @@ select * from t1 where a = -0.00; a 0.00 drop table t1; +create table t1 (col1 bigint default -9223372036854775808); +insert into t1 values (default); +select * from t1; +col1 +-9223372036854775808 +drop table t1; diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test index 6199bd34fa9..5c4f288983b 100644 --- a/mysql-test/t/type_newdecimal.test +++ b/mysql-test/t/type_newdecimal.test @@ -964,3 +964,12 @@ insert into t1 values (0.00); select * from t1 where a > -0.00; select * from t1 where a = -0.00; drop table t1; + +# +# Bug #11215: a problem with LONGLONG_MIN +# + +create table t1 (col1 bigint default -9223372036854775808); +insert into t1 values (default); +select * from t1; +drop table t1; diff --git a/sql/item.cc b/sql/item.cc index d3888cef9d5..82edc05c721 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3573,7 +3573,7 @@ Item *Item_int_with_ref::new_item() Item_num *Item_uint::neg() { - Item_decimal *item= new Item_decimal(value, 0); + Item_decimal *item= new Item_decimal(value, 1); return item->neg(); }