diff options
author | Nisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com> | 2015-08-25 14:25:46 +0530 |
---|---|---|
committer | Nisha Gopalakrishnan <nisha.gopalakrishnan@oracle.com> | 2015-08-25 14:25:46 +0530 |
commit | e414cbffad0e095c545cf2aa3f646c8a36c9b398 (patch) | |
tree | e33beec2ec8c00c95c6c0c405e4e9520bc235de4 /sql/sql_base.cc | |
parent | f4ff086abea975222572fcfd232bf296018f5d85 (diff) | |
download | mariadb-git-e414cbffad0e095c545cf2aa3f646c8a36c9b398.tar.gz |
BUG#20449914: HANDLE_FATAL_SIGNAL (SIG=11) IN
FIELD_ITERATOR_TABLE::END_OF_FIELDS
Note: This a backport of the patch for bug#19894987
to MySQL-5.5
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 0b256974258..61a0d1ae909 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1648,13 +1648,20 @@ bool close_temporary_tables(THD *thd) if (!thd->temporary_tables) DBUG_RETURN(FALSE); + /* + Ensure we don't have open HANDLERs for tables we are about to close. + This is necessary when close_temporary_tables() is called as part + of execution of BINLOG statement (e.g. for format description event). + */ + mysql_ha_rm_temporary_tables(thd); if (!mysql_bin_log.is_open()) { TABLE *tmp_next; - for (table= thd->temporary_tables; table; table= tmp_next) + for (TABLE *t= thd->temporary_tables; t; t= tmp_next) { - tmp_next= table->next; - close_temporary(table, 1, 1); + tmp_next= t->next; + mysql_lock_remove(thd, thd->lock, t); + close_temporary(t, 1, 1); } thd->temporary_tables= 0; DBUG_RETURN(FALSE); @@ -1744,6 +1751,7 @@ bool close_temporary_tables(THD *thd) strlen(table->s->table_name.str)); s_query.append(','); next= table->next; + mysql_lock_remove(thd, thd->lock, table); close_temporary(table, 1, 1); } thd->clear_error(); |