summaryrefslogtreecommitdiff
path: root/mysql-test/r/limit.result
diff options
context:
space:
mode:
authorunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-05-18 12:08:07 +0500
committerunknown <ramil/ram@mysql.com/ramil.myoffice.izhnet.ru>2007-05-18 12:08:07 +0500
commit5b3b80b44f413925a33580bd4229a14b0d6836fa (patch)
tree1ae986c917186244ee7d08ad840caf48344d72e6 /mysql-test/r/limit.result
parent8ab53d5f4e9225d3d3d3509f8cd47c610406ed8e (diff)
downloadmariadb-git-5b3b80b44f413925a33580bd4229a14b0d6836fa.tar.gz
Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
Problem: we may get syntactically incorrect queries in the binary log if we use a string value user variable executing a PS which contains '... limit ?' clause, e.g. prepare s from "select 1 limit ?"; set @a='qwe'; execute s using @a; Fix: raise an error in such cases. mysql-test/r/limit.result: Fix for bug #28464: a string argument to 'limit ?' PS - replication fails - test result mysql-test/t/limit.test: Fix for bug #28464: a string argument to 'limit ?' PS - replication fails - test case sql/item.cc: Fix for bug #28464: a string argument to 'limit ?' PS - replication fails - if Item_param::strict_type is set, check given and required types, return an error if not equal. sql/item.h: Fix for bug #28464: a string argument to 'limit ?' PS - replication fails - bool strict_type introduced, which indicates that a parameter value must be of the required_result_type type. - set_strict_type() function introduced to set required type. sql/sql_yacc.yy: Fix for bug #28464: a string argument to 'limit ?' PS - replication fails - as we accept only INTs in the 'limit' clause set parameter's required type.
Diffstat (limited to 'mysql-test/r/limit.result')
-rw-r--r--mysql-test/r/limit.result11
1 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/limit.result b/mysql-test/r/limit.result
index ac96ac8ff17..01d7d7ca218 100644
--- a/mysql-test/r/limit.result
+++ b/mysql-test/r/limit.result
@@ -91,3 +91,14 @@ select sum(a) c FROM t1 WHERE a > 0 ORDER BY c LIMIT 3;
c
28
drop table t1;
+prepare s from "select 1 limit ?";
+set @a='qwe';
+execute s using @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare s from "select 1 limit 1, ?";
+execute s using @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+prepare s from "select 1 limit ?, ?";
+execute s using @a, @a;
+ERROR HY000: Incorrect arguments to EXECUTE
+End of 5.0 tests