Loading mysql-test/r/bigint.result +11 −0 Original line number Diff line number Diff line Loading @@ -341,3 +341,14 @@ select * from t1 where bigint_col='17666000000000000000'; bigint_col 17666000000000000000 drop table t1; bug 19955 -- mod is signed with bigint select cast(10000002383263201056 as unsigned) mod 50 as result; result 6 create table t1 (c1 bigint unsigned); insert into t1 values (10000002383263201056); select c1 mod 50 as result from t1; result 6 drop table t1; mysql-test/t/bigint.test +9 −0 Original line number Diff line number Diff line Loading @@ -278,4 +278,13 @@ select * from t1 where bigint_col=17666000000000000000; select * from t1 where bigint_col='17666000000000000000'; drop table t1; --echo --echo bug 19955 -- mod is signed with bigint select cast(10000002383263201056 as unsigned) mod 50 as result; create table t1 (c1 bigint unsigned); insert into t1 values (10000002383263201056); select c1 mod 50 as result from t1; drop table t1; sql/item_func.cc +4 −0 Original line number Diff line number Diff line Loading @@ -1326,6 +1326,10 @@ longlong Item_func_mod::int_op() signal_divide_by_null(); return 0; } if (args[0]->unsigned_flag) return ((ulonglong) value) % val2; return value % val2; } Loading Loading
mysql-test/r/bigint.result +11 −0 Original line number Diff line number Diff line Loading @@ -341,3 +341,14 @@ select * from t1 where bigint_col='17666000000000000000'; bigint_col 17666000000000000000 drop table t1; bug 19955 -- mod is signed with bigint select cast(10000002383263201056 as unsigned) mod 50 as result; result 6 create table t1 (c1 bigint unsigned); insert into t1 values (10000002383263201056); select c1 mod 50 as result from t1; result 6 drop table t1;
mysql-test/t/bigint.test +9 −0 Original line number Diff line number Diff line Loading @@ -278,4 +278,13 @@ select * from t1 where bigint_col=17666000000000000000; select * from t1 where bigint_col='17666000000000000000'; drop table t1; --echo --echo bug 19955 -- mod is signed with bigint select cast(10000002383263201056 as unsigned) mod 50 as result; create table t1 (c1 bigint unsigned); insert into t1 values (10000002383263201056); select c1 mod 50 as result from t1; drop table t1;
sql/item_func.cc +4 −0 Original line number Diff line number Diff line Loading @@ -1326,6 +1326,10 @@ longlong Item_func_mod::int_op() signal_divide_by_null(); return 0; } if (args[0]->unsigned_flag) return ((ulonglong) value) % val2; return value % val2; } Loading