summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-01-10 19:13:12 +0200
committerunknown <monty@mysql.com>2006-01-10 19:13:12 +0200
commitaf024409afac7b9ded1f5c431e08f3b26699bcf6 (patch)
treeea44ec976e5fff02c0f9ca2200b4013b8108ba4d /sql/sql_handler.cc
parent159eaf4f0a68e216267b28eb13f8b4f9bbd2fec6 (diff)
downloadmariadb-git-af024409afac7b9ded1f5c431e08f3b26699bcf6.tar.gz
Re-run fix-fields on condition if table was reopened in HANDLERREAD
sql/sql_base.cc: Added more comments sql/sql_handler.cc: Re-run fix-fields on condition if table was reopened
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 765a057f740..1c5381a9fa0 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -437,9 +437,14 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
if (!lock)
goto err0; // mysql_lock_tables() printed error message already
- if (cond && ((!cond->fixed &&
- cond->fix_fields(thd, tables, &cond)) || cond->check_cols(1)))
- goto err0;
+ if (cond)
+ {
+ 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)
{