List:Internals« Previous MessageNext Message »
From:ingo Date:September 13 2005 2:36pm
Subject:bk commit into 5.0 tree (ingo:1.1945) BUG#12845
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of mydev. When mydev 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.1945 05/09/13 14:36:43 ingo@stripped +2 -0
  Bug#12845 - Stress test: Server crashes on  CREATE .. SELECT statement
  Solution for 5.0.
  Changed calls to open_table(). Requested to ignore
  flush at places where the command did already lock tables.
  This could happen in CREATE ... SELECT and ALTER TABLE.
  
  No test case. The bug can only be triggered by true concurrency.
  The stress test suite provides a test case for this.

  sql/sql_table.cc
    1.271 05/09/13 14:36:37 ingo@stripped +4 -2
    Bug#12845 - Stress test: Server crashes on  CREATE .. SELECT statement
    Solution for 5.0.
    Changed calls to open_table(). Requested to ignore
    flush at places where the command did already lock tables.
    This could happen in CREATE ... SELECT and ALTER TABLE.

  sql/sql_base.cc
    1.300 05/09/13 14:36:37 ingo@stripped +15 -13
    Bug#12845 - Stress test: Server crashes on  CREATE .. SELECT statement
    Solution for 5.0.
    Changed open_table() so that ignoring flush requests
    is dependend on the 'flags' parameter as ignoring drop
    request was already. This aims for consistent behaviour.

# 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:	ingo
# Host:	chilla.local
# Root:	/home/mydev/mysql-5.0-5000

--- 1.299/sql/sql_base.cc	2005-09-12 07:28:50 +02:00
+++ 1.300/sql/sql_base.cc	2005-09-13 14:36:37 +02:00
@@ -1030,23 +1030,23 @@
 
   SYNOPSIS
     open_table()
-      thd         Thread context
-      table_list  Open first table in list
-      refresh     Pointer to memory that will be set to 1 if
-                  we need to close all tables and reopen them
-                  If this is a NULL pointer, then the is no version
-                  number checking and the table is not put in the
-                  thread-open-list
-      flags       Bitmap of flags to modify how open works:
-                    MYSQL_LOCK_IGNORE_FLUSH - Open table even if someone
-                    has done a flush or namelock on it.
+    thd                 Thread context.
+    table_list          Open first table in list.
+    refresh      INOUT  Pointer to memory that will be set to 1 if
+                        we need to close all tables and reopen them.
+                        If this is a NULL pointer, then the table is not
+                        put in the thread-open-list.
+    flags               Bitmap of flags to modify how open works:
+                          MYSQL_LOCK_IGNORE_FLUSH - Open table even if
+                          someone has done a flush or namelock on it.
+                          No version number checking is done.
 
   IMPLEMENTATION
     Uses a cache of open tables to find a table not in use.
 
   RETURN
     NULL  Open failed.  If refresh is set then one should close
-          all other tables and retry the open
+          all other tables and retry the open.
     #     Success. Pointer to TABLE object for open table.
 */
 
@@ -1201,10 +1201,12 @@
 
   if (!thd->open_tables)
     thd->version=refresh_version;
-  else if (thd->version != refresh_version && refresh)
+  else if ((thd->version != refresh_version) &&
+           ! (flags & MYSQL_LOCK_IGNORE_FLUSH))
   {
     /* Someone did a refresh while thread was opening tables */
-    *refresh=1;
+    if (refresh)
+      *refresh=1;
     VOID(pthread_mutex_unlock(&LOCK_open));
     DBUG_RETURN(0);
   }

--- 1.270/sql/sql_table.cc	2005-09-12 19:18:43 +02:00
+++ 1.271/sql/sql_table.cc	2005-09-13 14:36:37 +02:00
@@ -1756,7 +1756,8 @@
                             create_info, *extra_fields, *keys, 0,
                             select_field_count))
     {
-      if (!(table= open_table(thd, create_table, thd->mem_root, (bool*)0, 0)))
+      if (! (table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
+                               MYSQL_LOCK_IGNORE_FLUSH)))
         quick_rm_table(create_info->db_type, create_table->db,
                        table_case_name(create_info, create_table->table_name));
     }
@@ -3579,7 +3580,8 @@
       bzero((void*) &tbl, sizeof(tbl));
       tbl.db= new_db;
       tbl.table_name= tbl.alias= tmp_name;
-      new_table= open_table(thd, &tbl, thd->mem_root, 0, 0);
+      new_table= open_table(thd, &tbl, thd->mem_root, (bool*) 0,
+                            MYSQL_LOCK_IGNORE_FLUSH);
     }
     else
     {
Thread
bk commit into 5.0 tree (ingo:1.1945) BUG#12845ingo13 Sep