diff options
author | Konstantin Osipov <kostja@sun.com> | 2010-04-14 01:56:19 +0400 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2010-04-14 01:56:19 +0400 |
commit | b8d014b8f6671395b9965b5a9953f5b2efa0fd15 (patch) | |
tree | 7a87035df6e8d664a8301574158d57d8305c65cf /sql/item.cc | |
parent | 03b1cdd04549c754a24e996f1aefd4e3a050af49 (diff) | |
download | mariadb-git-b8d014b8f6671395b9965b5a9953f5b2efa0fd15.tar.gz |
A fix for Bug#11918 "SP does not accept variables in LIMIT clause"
Allow stored procedure variables in LIMIT clause.
Only allow variables of INTEGER types.
Handle negative values by means of an implicit cast to UNSIGNED
(similarly to prepared statement placeholders).
Add tests.
Make sure replication works by not doing NAME_CONST substitution
for variables in LIMIT clause.
Add replication tests.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index 209d5aa0197..4199f8a409a 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1186,7 +1186,9 @@ Item_splocal::Item_splocal(const LEX_STRING &sp_var_name, enum_field_types sp_var_type, uint pos_in_q, uint len_in_q) :Item_sp_variable(sp_var_name.str, sp_var_name.length), - m_var_idx(sp_var_idx), pos_in_query(pos_in_q), len_in_query(len_in_q) + m_var_idx(sp_var_idx), + limit_clause_param(FALSE), + pos_in_query(pos_in_q), len_in_query(len_in_q) { maybe_null= TRUE; |