From af024409afac7b9ded1f5c431e08f3b26699bcf6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jan 2006 19:13:12 +0200 Subject: 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 --- sql/sql_handler.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'sql/sql_handler.cc') 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) { -- cgit v1.2.1