diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-04-01 10:15:22 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-04-01 10:15:22 -0300 |
commit | 7ecad98c45ece1140e9f2cb7627741cde31fa2f7 (patch) | |
tree | 837d819846c7947b1b5d47a21d2e07591e273299 /sql/sp_head.h | |
parent | 2303a8c6e4dd94eb6b682c61e0ff333c21b188b2 (diff) | |
download | mariadb-git-7ecad98c45ece1140e9f2cb7627741cde31fa2f7.tar.gz |
Bug#50755: Crash if stored routine def contains version comments
The problem was that a syntactically invalid trigger could cause
the server to crash when trying to list triggers. The crash would
happen due to a mishap in the backup/restore procedure that should
protect parser items which are not associated with the trigger. The
backup/restore is used to isolate the parse tree (and context) of
a statement from the load (and parsing) of a trigger. In this case,
a error during the parsing of a trigger could cause the improper
backup/restore sequence.
The solution is to properly restore the original statement context
before the parser is exited due to syntax errors in the trigger body.
mysql-test/r/trigger.result:
Add test case result for Bug#50755
mysql-test/t/trigger.test:
Add test case for Bug#50755
sql/sp_head.cc:
Merge sp_head::destroy() and sp_head destructor. Retrieve THD
from the LEX so that m_thd is not necessary.
sql/sql_lex.cc:
Explicitly restore the original environment.
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index 00c96d44f70..d422adc8927 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -289,10 +289,6 @@ public: virtual ~sp_head(); - /// Free memory - void - destroy(); - bool execute_trigger(THD *thd, const LEX_STRING *db_name, |