Loading mysql-test/r/ps.result +16 −0 Original line number Diff line number Diff line Loading @@ -1717,6 +1717,22 @@ t1 CREATE TABLE `t1` ( `?` decimal(2,1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop table if exists t1; create table t1 (a bigint unsigned, b bigint(20) unsigned); prepare stmt from "insert into t1 values (?,?)"; set @a= 9999999999999999; set @b= 14632475938453979136; insert into t1 values (@a, @b); select * from t1 where a = @a and b = @b; a b 9999999999999999 14632475938453979136 execute stmt using @a, @b; select * from t1 where a = @a and b = @b; a b 9999999999999999 14632475938453979136 9999999999999999 14632475938453979136 deallocate prepare stmt; drop table t1; End of 5.0 tests. create procedure proc_1() reset query cache; call proc_1(); Loading mysql-test/t/ps.test +17 −0 Original line number Diff line number Diff line Loading @@ -1821,6 +1821,23 @@ execute stmt using @a; show create table t1; drop table t1; # # Bug#33798: prepared statements improperly handle large unsigned ints # --disable_warnings drop table if exists t1; --enable_warnings create table t1 (a bigint unsigned, b bigint(20) unsigned); prepare stmt from "insert into t1 values (?,?)"; set @a= 9999999999999999; set @b= 14632475938453979136; insert into t1 values (@a, @b); select * from t1 where a = @a and b = @b; execute stmt using @a, @b; select * from t1 where a = @a and b = @b; deallocate prepare stmt; drop table t1; --echo End of 5.0 tests. # Loading sql/item.cc +5 −1 Original line number Diff line number Diff line Loading @@ -2628,6 +2628,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) if (entry && entry->value) { item_result_type= entry->type; unsigned_flag= entry->unsigned_flag; if (strict_type && required_result_type != item_result_type) DBUG_RETURN(1); switch (item_result_type) { Loading Loading @@ -2925,6 +2926,9 @@ const String *Item_param::query_val_str(String* str) const { switch (state) { case INT_VALUE: if (unsigned_flag) str->set((ulonglong) value.integer, &my_charset_bin); else str->set(value.integer, &my_charset_bin); break; case REAL_VALUE: Loading Loading
mysql-test/r/ps.result +16 −0 Original line number Diff line number Diff line Loading @@ -1717,6 +1717,22 @@ t1 CREATE TABLE `t1` ( `?` decimal(2,1) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; drop table if exists t1; create table t1 (a bigint unsigned, b bigint(20) unsigned); prepare stmt from "insert into t1 values (?,?)"; set @a= 9999999999999999; set @b= 14632475938453979136; insert into t1 values (@a, @b); select * from t1 where a = @a and b = @b; a b 9999999999999999 14632475938453979136 execute stmt using @a, @b; select * from t1 where a = @a and b = @b; a b 9999999999999999 14632475938453979136 9999999999999999 14632475938453979136 deallocate prepare stmt; drop table t1; End of 5.0 tests. create procedure proc_1() reset query cache; call proc_1(); Loading
mysql-test/t/ps.test +17 −0 Original line number Diff line number Diff line Loading @@ -1821,6 +1821,23 @@ execute stmt using @a; show create table t1; drop table t1; # # Bug#33798: prepared statements improperly handle large unsigned ints # --disable_warnings drop table if exists t1; --enable_warnings create table t1 (a bigint unsigned, b bigint(20) unsigned); prepare stmt from "insert into t1 values (?,?)"; set @a= 9999999999999999; set @b= 14632475938453979136; insert into t1 values (@a, @b); select * from t1 where a = @a and b = @b; execute stmt using @a, @b; select * from t1 where a = @a and b = @b; deallocate prepare stmt; drop table t1; --echo End of 5.0 tests. # Loading
sql/item.cc +5 −1 Original line number Diff line number Diff line Loading @@ -2628,6 +2628,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) if (entry && entry->value) { item_result_type= entry->type; unsigned_flag= entry->unsigned_flag; if (strict_type && required_result_type != item_result_type) DBUG_RETURN(1); switch (item_result_type) { Loading Loading @@ -2925,6 +2926,9 @@ const String *Item_param::query_val_str(String* str) const { switch (state) { case INT_VALUE: if (unsigned_flag) str->set((ulonglong) value.integer, &my_charset_bin); else str->set(value.integer, &my_charset_bin); break; case REAL_VALUE: Loading