diff options
author | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-05-18 12:08:07 +0500 |
---|---|---|
committer | ramil/ram@mysql.com/ramil.myoffice.izhnet.ru <> | 2007-05-18 12:08:07 +0500 |
commit | 63b2e8d9dfab1cb2ed0b8f1c1fce267512cf5493 (patch) | |
tree | 1ae986c917186244ee7d08ad840caf48344d72e6 /sql/item.cc | |
parent | 290b975043ae325e2cad3f9a94efbfc4ffb9cf0e (diff) | |
download | mariadb-git-63b2e8d9dfab1cb2ed0b8f1c1fce267512cf5493.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.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 827c872adbc..155b2a962c8 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2312,6 +2312,7 @@ default_set_param_func(Item_param *param, Item_param::Item_param(unsigned pos_in_query_arg) : + strict_type(FALSE), state(NO_VALUE), item_result_type(STRING_RESULT), /* Don't pretend to be a literal unless value for this item is set. */ @@ -2506,6 +2507,8 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) if (entry && entry->value) { item_result_type= entry->type; + if (strict_type && required_result_type != item_result_type) + DBUG_RETURN(1); switch (entry->type) { case REAL_RESULT: set_double(*(double*)entry->value); |