List:Commits« Previous MessageNext Message »
From:knielsen Date:May 18 2006 12:06pm
Subject:bk commit into 5.1 tree (knielsen:1.2162)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of knielsen. When knielsen 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.2162 06/05/18 12:06:09 knielsen@stripped +1 -0
  After-merge fix.

  sql/sql_insert.cc
    1.200 06/05/18 12:06:05 knielsen@stripped +14 -24
    After-merge fixes

# 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:	knielsen
# Host:	rt.int.sifira.dk
# Root:	/usr/local/mysql/merge-5.1

--- 1.199/sql/sql_insert.cc	2006-05-18 10:53:10 +02:00
+++ 1.200/sql/sql_insert.cc	2006-05-18 12:06:05 +02:00
@@ -2538,6 +2538,7 @@
                           (open) will be returned in this parameter. Since
                           this table is not included in THD::lock caller is
                           responsible for explicitly unlocking this table.
+      hooks
 
   NOTES
     If 'create_info->options' bitmask has HA_LEX_CREATE_IF_NOT_EXISTS
@@ -2556,10 +2557,13 @@
 static TABLE *create_table_from_items(THD *thd, HA_CREATE_INFO *create_info,
                                       TABLE_LIST *create_table,
                                       List<create_field> *extra_fields,
-                                      List<Key> *keys, List<Item> *items,
-                                      MYSQL_LOCK **lock)
+                                      List<Key> *keys,
+                                      List<Item> *items,
+                                      MYSQL_LOCK **lock,
+                                      TABLEOP_HOOKS *hooks)
 {
   TABLE tmp_table;		// Used during 'create_field()'
+  TABLE_SHARE share;
   TABLE *table= 0;
   uint select_field_count= items->elements;
   /* Add selected items to field list */
@@ -2571,11 +2575,14 @@
 
   tmp_table.alias= 0;
   tmp_table.timestamp_field= 0;
-  tmp_table.s= &tmp_table.share_not_to_be_used;
+  tmp_table.s= &share;
+  init_tmp_table_share(&share, "", 0, "", "");
+
   tmp_table.s->db_create_options=0;
   tmp_table.s->blob_ptr_size= portable_sizeof_char_ptr;
-  tmp_table.s->db_low_byte_first= test(create_info->db_type == DB_TYPE_MYISAM ||
-                                       create_info->db_type == DB_TYPE_HEAP);
+  tmp_table.s->db_low_byte_first= 
+        test(create_info->db_type == &myisam_hton ||
+             create_info->db_type == &heap_hton);
   tmp_table.null_row=tmp_table.maybe_null=0;
 
   while ((item=it++))
@@ -2607,9 +2614,6 @@
     don't want to delete from it) 2) it would be written before the CREATE
     TABLE, which is a wrong order. So we keep binary logging disabled when we
     open_table().
-    NOTE: By locking table which we just have created (or for which we just have
-    have found that it already exists) separately from other tables used by the
-    statement we create potential window for deadlock.
     TODO: create and open should be done atomic !
   */
   {
@@ -2618,23 +2622,8 @@
                             create_info, *extra_fields, *keys, 0,
                             select_field_count))
     {
-      /*
-        If we are here in prelocked mode we either create temporary table
-        or prelocked mode is caused by the SELECT part of this statement.
-      */
-      DBUG_ASSERT(!thd->prelocked_mode ||
-                  create_info->options & HA_LEX_CREATE_TMP_TABLE ||
-                  thd->lex->requires_prelocking());
-
-      /*
-        NOTE: We don't want to ignore set of locked tables here if we are
-              under explicit LOCK TABLES since it will open gap for deadlock
-              too wide (and also is not backward compatible).
-      */
       if (! (table= open_table(thd, create_table, thd->mem_root, (bool*) 0,
-                               (MYSQL_LOCK_IGNORE_FLUSH |
-                                ((thd->prelocked_mode == PRELOCKED) ?
-                                 MYSQL_OPEN_IGNORE_LOCKED_TABLES:0)))))
+                               MYSQL_LOCK_IGNORE_FLUSH)))
         quick_rm_table(create_info->db_type, create_table->db,
                        table_case_name(create_info, create_table->table_name));
     }
@@ -2650,6 +2639,7 @@
            save us from that ?
   */
   table->reginfo.lock_type=TL_WRITE;
+  hooks->prelock(&table, 1);                    // Call prelock hooks
   if (! ((*lock)= mysql_lock_tables(thd, &table, 1,
                                     MYSQL_LOCK_IGNORE_FLUSH, &not_used)))
   {
Thread
bk commit into 5.1 tree (knielsen:1.2162)knielsen18 May