List:Commits« Previous MessageNext Message »
From:monty Date:January 10 2006 5:13pm
Subject:bk commit into 4.1 tree (monty:1.2476)
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of monty. When monty does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2476 06/01/10 19:13:12 monty@stripped +2 -0
  Re-run fix-fields on condition if table was reopened in HANDLERREAD

  sql/sql_handler.cc
    1.66 06/01/10 19:13:08 monty@stripped +8 -3
    Re-run fix-fields on condition if table was reopened

  sql/sql_base.cc
    1.262 06/01/10 19:13:08 monty@stripped +16 -4
    Added more comments

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-4.1

--- 1.261/sql/sql_base.cc	2006-01-04 16:35:17 +02:00
+++ 1.262/sql/sql_base.cc	2006-01-10 19:13:08 +02:00
@@ -1012,10 +1012,20 @@
 
 
 /****************************************************************************
-** 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 @@
     (*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;
 

--- 1.65/sql/sql_handler.cc	2006-01-09 11:10:45 +02:00
+++ 1.66/sql/sql_handler.cc	2006-01-10 19:13:08 +02:00
@@ -437,9 +437,14 @@
   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)
   {
Thread
bk commit into 4.1 tree (monty:1.2476)monty10 Jan