mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
Lex::save_list contents remain from a previous query that has invalid syntax and isn't reset when processing a new query. We initialize this structure along with it's peer in LEX::start. MDEV-38295 Recursive CTE usage leaks memory when not used in a top level select During st_select_lex::cleanup() we assume that leaf tables and any associated recursive table references can only be present when a join structure is present. After MDEV-37220 this is no longer true. We shift our cleanup routine out of the test for a join. We add Multidelete_prelocking_strategy::handle_end() in the same manner as Multiupdate_prelocking_strategy::handle_end() (but with minimal processing as yet) to populate these leaf_tables in the outermost select when it is a delete statement. We add in a call to free_underlaid_joins() to the error processing section of Sql_cmd_dml::execute to free up temporary tables that were allocated in prepare, but not freed up when execute is bypassed because an error occured during prepare. Sergei Petrunia: Better comments for MDEV-38272, MDEV-38272 Approved by: Sergei Petrunia (sergey@mariadb.com)
3.5 KiB
3.5 KiB