summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authorOleg Smirnov <olernov@gmail.com>2022-06-18 20:54:39 +0700
committerOleg Smirnov <olernov@gmail.com>2022-07-14 11:07:24 +0700
commit49e14000eeb245ea27e9207d2f63cb0a28be1ca9 (patch)
treefa013feb56bb774859cd01e43b84516f84652687 /sql/sql_select.cc
parent02e85aeafdc3fbe7d628e155880390c4d623f9b4 (diff)
downloadmariadb-git-49e14000eeb245ea27e9207d2f63cb0a28be1ca9.tar.gz
MDEV-26427 MariaDB Server SEGV on INSERT .. SELECT
1. For INSERT..SELECT statements: don't include table/view the data is inserted into in the list of leaf tables 2. Remove duplicated and dead code related to table_count
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index cceb50dc9ab..0803e785302 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1597,7 +1597,6 @@ JOIN::optimize_inner()
/* Merge all mergeable derived tables/views in this SELECT. */
if (select_lex->handle_derived(thd->lex, DT_MERGE))
DBUG_RETURN(TRUE);
- table_count= select_lex->leaf_tables.elements;
}
if (select_lex->first_cond_optimization &&
@@ -1640,8 +1639,6 @@ JOIN::optimize_inner()
eval_select_list_used_tables();
- table_count= select_lex->leaf_tables.elements;
-
if (select_lex->options & OPTION_SCHEMA_TABLE &&
optimize_schema_tables_memory_usage(select_lex->leaf_tables))
DBUG_RETURN(1);
@@ -13162,7 +13159,6 @@ void JOIN::cleanup(bool full)
/* Free the original optimized join created for the group_by_handler */
join_tab= original_join_tab;
original_join_tab= 0;
- table_count= original_table_count;
}
if (join_tab)