summaryrefslogtreecommitdiff
path: root/sql/sql_base.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_base.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_base.cc')
-rw-r--r--sql/sql_base.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index c8443948a4a..ea013bb4e1e 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1012,10 +1012,20 @@ TABLE *find_locked_table(THD *thd, const char *db,const char *table_name)
/****************************************************************************
-** Reopen an table because the definition has changed. The date file for the
-** table is already closed.
-** Returns 0 if ok.
-** If table can't be reopened, the entry is unchanged.
+ Reopen an table because the definition has changed. The date file for the
+ table is already closed.
+
+ SYNOPSIS
+ reopen_table()
+ table Table to be opened
+ locked 1 if we have already a lock on LOCK_open
+
+ NOTES
+ table->query_id will be 0 if table was reopened
+
+ RETURN
+ 0 ok
+ 1 error ('table' is unchanged if table couldn't be reopened)
****************************************************************************/
bool reopen_table(TABLE *table,bool locked)
@@ -1085,8 +1095,10 @@ bool reopen_table(TABLE *table,bool locked)
(*field)->table_name=table->table_name;
}
for (key=0 ; key < table->keys ; key++)
+ {
for (part=0 ; part < table->key_info[key].usable_key_parts ; part++)
table->key_info[key].key_part[part].field->table= table;
+ }
VOID(pthread_cond_broadcast(&COND_refresh));
error=0;