diff options
| author | Oleg Smirnov <olernov@gmail.com> | 2022-10-19 13:26:19 +0400 |
|---|---|---|
| committer | Oleg Smirnov <olernov@gmail.com> | 2022-10-31 19:20:17 +0400 |
| commit | 0d927a57d2bfb32384dd024b9b4d1009fa22555a (patch) | |
| tree | 681166ec47285ff9f253cd1fb457b37824beff60 /sql/sql_derived.cc | |
| parent | ce443c855478e931b77058f3a7108c07500220d7 (diff) | |
| download | mariadb-git-0d927a57d2bfb32384dd024b9b4d1009fa22555a.tar.gz | |
MDEV-29624 MDEV-29655 Fix ASAN errors on pushdown of derived table
Deallocation of TABLE_LIST::dt_handler and TABLE_LIST::pushdown_derived
was performed in multiple places if code. This not only made the code
more difficult to maintain but also led to memory leaks and
ASAN heap-use-after-free errors.
This commit puts deallocation of TABLE_LIST::dt_handler and
TABLE_LIST::pushdown_derived to the single point - JOIN::cleanup()
Diffstat (limited to 'sql/sql_derived.cc')
| -rw-r--r-- | sql/sql_derived.cc | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc index a4e0fd6b683..4dcc8a61985 100644 --- a/sql/sql_derived.cc +++ b/sql/sql_derived.cc @@ -1000,11 +1000,7 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived) /* Create an object for execution of the query specifying the table */ if (!(derived->pushdown_derived= new (thd->mem_root) Pushdown_derived(derived, derived->dt_handler))) - { - delete derived->dt_handler; - derived->dt_handler= NULL; DBUG_RETURN(TRUE); - } } lex->current_select= first_select; @@ -1229,7 +1225,6 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived) /* Execute the query that specifies the derived table by a foreign engine */ res= derived->pushdown_derived->execute(); unit->executed= true; - delete derived->pushdown_derived; DBUG_RETURN(res); } |
