summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 18:26:21 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-07-27 18:26:21 +0300
commit742e1c727fc2be50b758068c2ab92abb19f3ff56 (patch)
treeb4efffa4eade915001faf0ceaf50715306416907 /sql/sql_insert.cc
parent19283c67c6d196a49211da6f925ca59fceef3ea0 (diff)
parent30914389fe9ca13cf29470dd033a5cf6997a3931 (diff)
downloadmariadb-git-742e1c727fc2be50b758068c2ab92abb19f3ff56.tar.gz
Merge 10.6 into 10.7
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 73bc914746d..9507aaf3ab7 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -1367,8 +1367,12 @@ values_loop_end:
thd->lex->current_select->save_leaf_tables(thd);
thd->lex->current_select->first_cond_optimization= 0;
}
- if (readbuff)
- my_free(readbuff);
+
+ my_free(readbuff);
+#ifndef EMBEDDED_LIBRARY
+ if (lock_type == TL_WRITE_DELAYED && table->expr_arena)
+ table->expr_arena->free_items();
+#endif
DBUG_RETURN(FALSE);
abort:
@@ -1385,6 +1389,8 @@ abort:
*/
for (Field **ptr= table_list->table->field ; *ptr ; ptr++)
(*ptr)->free();
+ if (table_list->table->expr_arena)
+ table_list->table->expr_arena->free_items();
}
#endif
if (table != NULL)
@@ -1563,8 +1569,7 @@ static bool mysql_prepare_insert_check_table(THD *thd, TABLE_LIST *table_list,
if (insert_into_view && !fields.elements)
{
thd->lex->empty_field_list_on_rset= 1;
- if (!thd->lex->first_select_lex()->leaf_tables.head()->table ||
- table_list->is_multitable())
+ if (!table_list->table || table_list->is_multitable())
{
my_error(ER_VIEW_NO_INSERT_FIELD_LIST, MYF(0),
table_list->view_db.str, table_list->view_name.str);
@@ -3820,7 +3825,6 @@ int mysql_insert_select_prepare(THD *thd, select_result *sel_res)
if (sel_res)
sel_res->prepare(lex->returning()->item_list, NULL);
- DBUG_ASSERT(select_lex->leaf_tables.elements != 0);
List_iterator<TABLE_LIST> ti(select_lex->leaf_tables);
TABLE_LIST *table;
uint insert_tables;