diff options
author | Kristofer Pettersson <kristofer.pettersson@sun.com> | 2009-10-19 09:43:33 +0200 |
---|---|---|
committer | Kristofer Pettersson <kristofer.pettersson@sun.com> | 2009-10-19 09:43:33 +0200 |
commit | 834ba32293173639880423839bbd245c601c0d50 (patch) | |
tree | 89e9504b75534f7f836f5aed34370d36c39f277d /libmysql/libmysql.c | |
parent | c2c12c240269eafc21c6d3fc6a9f0a41c4eaed20 (diff) | |
download | mariadb-git-834ba32293173639880423839bbd245c601c0d50.tar.gz |
Bug#47627 SET @@{global.session}.local_variable in stored routine causes crash
Adding @@session and @@global prefixes to a
declared variable in a stored procedure the server
would lead to a crash.
The reason was that during the parsing of the
syntactic rule 'option_value' an uninitialized
set_var object was pushed to the parameter stack
of the SET statement. The parent rule
'option_type_value' interpreted the existence of
variables on the parameter stack as an assignment
and wrapped it in a sp_instr_set object.
As the procedure later was executed an attempt
was made to run the method 'check()' on an
uninitialized member object (NULL value) belonging
to the previously created but uninitialized object.
sql/sql_yacc.yy:
* Assign the option_type at once since it is needed by the next
parsing rule (internal_variable_name)
* Rearranged the if statement to reduce negations and gain more
clarity of code.
* Added check for option_type to better detect if current
variable is a SP local variable or a system variable.
Diffstat (limited to 'libmysql/libmysql.c')
0 files changed, 0 insertions, 0 deletions