summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-08-30 15:18:35 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2018-08-31 17:07:43 +0200
commit796d54df115a0e5485a7df0835088a51dd0f9e77 (patch)
tree5769259f7df0b2ba6519f93de58c19598b7b84ea /sql/table.h
parent42f09adab68f80fb99d6da0413cd4983ec13f5ab (diff)
downloadmariadb-git-796d54df115a0e5485a7df0835088a51dd0f9e77.tar.gz
MDEV-16957: Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP
The problem was that join_columns creation was not finished due to error of notfound column in USING, but next execution tried to use join_columns lists. Solution is cleanup the lists on error. It can eat memory in statement MEM_ROOT but it is an error and error will be fixed or statement/procedure removed/altered.
Diffstat (limited to 'sql/table.h')
-rw-r--r--sql/table.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/table.h b/sql/table.h
index 1d4a1d9a2d2..4725eb96432 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -2184,6 +2184,16 @@ struct TABLE_LIST
}
void set_lock_type(THD* thd, enum thr_lock_type lock);
+ void remove_join_columns()
+ {
+ if (join_columns)
+ {
+ join_columns->empty();
+ join_columns= NULL;
+ is_join_columns_complete= FALSE;
+ }
+ }
+
private:
bool prep_check_option(THD *thd, uint8 check_opt_type);
bool prep_where(THD *thd, Item **conds, bool no_where_clause);