diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2023-04-12 15:08:23 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2023-04-25 08:37:28 +0200 |
commit | 69604d990ca5795b944e2afd86ee82d758fe0dcb (patch) | |
tree | cbbf9b0c60f25b73bb5a4e970569669b657cd1fb | |
parent | a44ff4bc5cad7d047d729e31efbe3d3d38bad602 (diff) | |
download | mariadb-git-69604d990ca5795b944e2afd86ee82d758fe0dcb.tar.gz |
MDEV-30889: 2 - Allocation in TABLE_SHARE::init_from_sql_statement_string
Fix leack in TABLE_SHARE::init_from_sql_statement_string
by removing uneeded switching arenas.
-rw-r--r-- | sql/table.cc | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/sql/table.cc b/sql/table.cc index a1ee2f3b8b3..71a85fb2786 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2839,7 +2839,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, char *sql_copy; handler *file; LEX *old_lex; - Query_arena *arena, backup; LEX tmp_lex; KEY *unused1; uint unused2; @@ -2848,12 +2847,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, LEX_CSTRING db_backup= thd->db; DBUG_ENTER("TABLE_SHARE::init_from_sql_statement_string"); - /* - Ouch. Parser may *change* the string it's working on. - Currently (2013-02-26) it is used to permanently disable - conditional comments. - Anyway, let's copy the caller's string... - */ if (!(sql_copy= thd->strmake(sql, sql_length))) DBUG_RETURN(HA_ERR_OUT_OF_MEM); @@ -2866,12 +2859,6 @@ int TABLE_SHARE::init_from_sql_statement_string(THD *thd, bool write, old_lex= thd->lex; thd->lex= &tmp_lex; - arena= thd->stmt_arena; - if (arena->is_conventional()) - arena= 0; - else - thd->set_n_backup_active_arena(arena, &backup); - thd->reset_db(&db); lex_start(thd); @@ -2906,8 +2893,6 @@ ret: lex_end(thd->lex); thd->reset_db(&db_backup); thd->lex= old_lex; - if (arena) - thd->restore_active_arena(arena, &backup); reenable_binlog(thd); thd->variables.sql_mode= saved_mode; thd->variables.character_set_client= old_cs; |