diff options
author | unknown <davi@mysql.com/endora.local> | 2008-02-28 11:34:08 -0300 |
---|---|---|
committer | unknown <davi@mysql.com/endora.local> | 2008-02-28 11:34:08 -0300 |
commit | 8d4c99e342de16042f0a7ddb6c3b8a476b94a041 (patch) | |
tree | 5b1788366dab7561e122e3742019bf6d0429c289 /mysql-test/r/limit.result | |
parent | 39b18f80c67f5a5f4698cf680916941a46501681 (diff) | |
download | mariadb-git-8d4c99e342de16042f0a7ddb6c3b8a476b94a041.tar.gz |
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.
Diffstat (limited to 'mysql-test/r/limit.result')
-rw-r--r-- | mysql-test/r/limit.result | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result index 01d7d7ca218..2acf74162a4 100644 --- a/mysql-test/r/limit.result +++ b/mysql-test/r/limit.result @@ -94,6 +94,9 @@ drop table t1; prepare s from "select 1 limit ?"; set @a='qwe'; execute s using @a; +1 +set @a=-1; +execute s using @a; ERROR HY000: Incorrect arguments to EXECUTE prepare s from "select 1 limit 1, ?"; execute s using @a; @@ -101,4 +104,10 @@ ERROR HY000: Incorrect arguments to EXECUTE prepare s from "select 1 limit ?, ?"; execute s using @a, @a; ERROR HY000: Incorrect arguments to EXECUTE +set @a=14632475938453979136; +execute s using @a, @a; +1 +set @a=-14632475938453979136; +execute s using @a, @a; +ERROR HY000: Incorrect arguments to EXECUTE End of 5.0 tests |