diff options
author | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-08-13 13:34:00 +0700 |
---|---|---|
committer | Dmitry Shulga <Dmitry.Shulga@oracle.com> | 2011-08-13 13:34:00 +0700 |
commit | 644db664462a52bae2237635c1d44401a5b1ec60 (patch) | |
tree | fe01e7d32375d087c27c01c181f1087a25256111 /sql/item.h | |
parent | 232b112e18bbef171e9b72a30336f14380042ab1 (diff) | |
download | mariadb-git-644db664462a52bae2237635c1d44401a5b1ec60.tar.gz |
Fixed Bug#12621017 - CRASH IF A SP VARIABLE IS USED IN THE LIMIT CLAUSE OF A
SET STATEMENT.
Server built with debug asserts, without debug crashes if a user tries
to run a stored procedure that constains query with subquery that include
either LIMIT or LIMIT OFFSET clauses.
The problem was that Item::fix_fields() was not called for the items
representing LIMIT or OFFSET clauses.
The solution is to call Item::fix_fields() right before evaluation in
st_select_lex_unit::set_limit().
mysql-test/r/sp.result:
Added testcase result for bug#12621017. Updated testcase result for
bug 11918.
mysql-test/t/sp.test:
Added testcase for bug#12621017. Addressed review comments for Bug 11918
(added tests for use LIMIT at stored function).
sql/item.h:
Addressed review comments for Bug 11918.
sql/share/errmsg-utf8.txt:
Addressed review comments for Bug 11918.
sql/sp_head.cc:
Addressed review comments for Bug 11918.
sql/sql_lex.cc:
Added call fix_fields() for item just before its evaluation.
sql/sql_yacc.yy:
Addressed review comments for Bug 11918.
Diffstat (limited to 'sql/item.h')
-rw-r--r-- | sql/item.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item.h b/sql/item.h index 46916346ebe..3fa0f4bb50b 100644 --- a/sql/item.h +++ b/sql/item.h @@ -1371,7 +1371,7 @@ class Item_splocal :public Item_sp_variable, enum_field_types m_field_type; public: /* - Is this variable a parameter in LIMIT clause. + If this variable is a parameter in LIMIT clause. Used only during NAME_CONST substitution, to not append NAME_CONST to the resulting query and thus not break the slave. |