From 1164e2bc7a6dc18b33e401f0a9f6949c6f2ff6ea Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 28 Feb 2008 11:34:08 -0300 Subject: Bug#33851 Passing UNSIGNED param to EXECUTE returns ERROR 1210 The problem is that passing anything other than a integer to a limit clause in a prepared statement would fail. This limitation was introduced to avoid replication problems (e.g: replicating the statement with a string argument would cause a parse failure in the slave). The solution is to convert arguments to the limit clause to a integer value and use this converted value when persisting the query to the log. mysql-test/r/limit.result: Update test case result. mysql-test/r/ps.result: Add test case result for Bug#33851 mysql-test/r/rpl_user_variables.result: Test case result for replication of prepared statement with limit clause. mysql-test/t/limit.test: Test parameters to limit clause. mysql-test/t/ps.test: Add test case for Bug#33851 mysql-test/t/rpl_user_variables.test: Test replication of a parameter which value is converted. sql/item.cc: Convert value to integer if it's a parameter to a limit clause. sql/item.h: Flag signal that item is a parameter to a limit clause. sql/item_func.cc: Const member functions, object is not mutated. sql/sql_class.h: Const member functions, object is not mutated. sql/sql_yacc.yy: Flag that item is a parameter to a limit clause. --- sql/sql_class.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql/sql_class.h') diff --git a/sql/sql_class.h b/sql/sql_class.h index 97f2d07b1d3..4ca8947de30 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -2329,7 +2329,7 @@ class user_var_entry bool unsigned_flag; double val_real(my_bool *null_value); - longlong val_int(my_bool *null_value); + longlong val_int(my_bool *null_value) const; String *val_str(my_bool *null_value, String *str, uint decimals); my_decimal *val_decimal(my_bool *null_value, my_decimal *result); DTCollation collation; -- cgit v1.2.1