diff options
author | Varun Gupta <varunraiko1803@gmail.com> | 2018-03-16 18:57:21 +0530 |
---|---|---|
committer | Varun Gupta <varunraiko1803@gmail.com> | 2018-03-17 10:51:19 +0530 |
commit | e3dd9a95e50ef2019435b01bd9e161d552673a28 (patch) | |
tree | 6e30a3ba05cb0582d1567e82d80fe8a726662d31 /sql/sql_select.cc | |
parent | 3d5dff6cae5cdefe376583f811c9af109ea08080 (diff) | |
download | mariadb-git-e3dd9a95e50ef2019435b01bd9e161d552673a28.tar.gz |
MDEV-6736: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with SQ in WHERE and
HAVING, ORDER BY, materialization+semijoin
During cleanup a pointer to the materialised table that was freed was not set to NULL
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index fd8ff6eb016..37d68c730dd 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -11476,13 +11476,15 @@ void JOIN_TAB::cleanup() } else { + TABLE_LIST *tmp= table->pos_in_table_list; end_read_record(&read_record); - table->pos_in_table_list->jtbm_subselect->cleanup(); + tmp->jtbm_subselect->cleanup(); /* The above call freed the materializedd temptable. Set it to NULL so that we don't attempt to touch it if JOIN_TAB::cleanup() is invoked multiple times (it may be) */ + tmp->table= NULL; table=NULL; } DBUG_VOID_RETURN; |