diff options
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r-- | sql/sql_handler.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index fae48c7d164..3370a0a1957 100644 --- a/sql/sql_handler.cc +++ b/sql/sql_handler.cc @@ -423,7 +423,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables, if (cond && ((!cond->fixed && cond->fix_fields(thd, &cond)) || cond->check_cols(1))) - goto err0; + { + if (table->query_id != thd->query_id) + cond->cleanup(); // File was reopened + if ((!cond->fixed && + cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1)) + goto err0; + } if (keyname) { |