summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index f1bbf6f0f5e..78eacd02e56 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -424,7 +424,11 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (cond && ((!cond->fixed &&
cond->fix_fields(thd, &cond)) || cond->check_cols(1)))
+ {
+ if (table->query_id != thd->query_id)
+ cond->cleanup(); // File was reopened
goto err0;
+ }
if (keyname)
{