Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.1 tree (mskold:1.2577)

From: Martin Skold <Martin.Skold(at)mysql.com>
Date: Fri Aug 31 2007 - 10:35:05 EDT


Below is the list of changes that have just been committed into a local 5.1 repository of marty. When marty 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.2577, 2007-08-31 16:34:55+02:00, mskold@mysql.com +3 -0   Added new temporary table type TMP_TABLE_FRM_FILE_ONLY for on-line alter table

  sql/sql_base.cc@1.424, 2007-08-31 16:34:44+02:00, mskold@mysql.com +20 -4     Added new temporary table type TMP_TABLE_FRM_FILE_ONLY for on-line alter table

  sql/sql_table.cc@1.449, 2007-08-31 16:34:44+02:00, mskold@mysql.com +3 -3     Added new temporary table type TMP_TABLE_FRM_FILE_ONLY for on-line alter table

  sql/table.h@1.179, 2007-08-31 16:34:43+02:00, mskold@mysql.com +1 -1     Added new temporary table type TMP_TABLE_FRM_FILE_ONLY for on-line alter table

diff -Nrup a/sql/sql_base.cc b/sql/sql_base.cc

--- a/sql/sql_base.cc	2007-08-24 12:22:30 +02:00
+++ b/sql/sql_base.cc	2007-08-31 16:34:44 +02:00

@@ -1762,7 +1762,11 @@ void close_temporary(TABLE *table, bool
 

   free_io_cache(table);
   closefrm(table, 0);
- if (delete_table)

+  /*
+     Check that temporary table has not been created with
+     frm_only because it has then not been created in any storage engine
+   */
+  if (table->s->tmp_table != TMP_TABLE_FRM_FILE_ONLY && delete_table)
     rm_temporary_table(table_type, table->s->path.str);
   if (free_share)
   {
@@ -4367,7 +4371,10 @@ TABLE *open_temporary_table(THD *thd, co
                             (open_mode == OTM_ALTER) ? 0 :
                             (uint) (HA_OPEN_KEYFILE | HA_OPEN_RNDFILE |
                                     HA_GET_INDEX),
-                            READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD,
+                            (open_mode == OTM_ALTER) ?
+                              (READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD |
+                               OPEN_FRM_FILE_ONLY)
+                            : (READ_KEYINFO | COMPUTE_TYPES | EXTRA_RECORD),
                             ha_open_options,
                             tmp_table, open_mode))
   {
@@ -4378,8 +4385,17 @@ TABLE *open_temporary_table(THD *thd, co

   }  

Do you need help?X

   tmp_table->reginfo.lock_type= TL_WRITE; // Simulate locked - share->tmp_table= (tmp_table->file->has_transactions() ?

-                     TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE);
+  if (open_mode == OTM_ALTER)
+  {
+    /*
+       Temporary table has been created with frm_only
+       and has not been created in any storage engine
+    */
+    share->tmp_table= TMP_TABLE_FRM_FILE_ONLY;
+  }
+  else
+    share->tmp_table= (tmp_table->file->has_transactions() ?
+                       TRANSACTIONAL_TMP_TABLE : NON_TRANSACTIONAL_TMP_TABLE);
 

   if (link_in_list)
   {
diff -Nrup a/sql/sql_table.cc b/sql/sql_table.cc

--- a/sql/sql_table.cc	2007-08-23 15:22:02 +02:00
+++ b/sql/sql_table.cc	2007-08-31 16:34:44 +02:00

@@ -6472,7 +6472,7 @@ view_err:
} /* TODO need to check if changes can be handled as fast ALTER TABLE */ if (!altered_table || - !(altered_table->file->ha_table_flags() & HA_ONLINE_ALTER)) + !(table->file->ha_table_flags() & HA_ONLINE_ALTER))
Do you need more help?X
need_copy_table= TRUE; if (!need_copy_table)
@@ -6489,7 +6489,7 @@ view_err:
mysql_unlock_tables(thd, thd->lock); thd->lock=0; } - close_temporary_table(thd, altered_table, 1, 0); + close_temporary_table(thd, altered_table, 1, 1); if (error) goto err;
@@ -6498,7 +6498,7 @@ view_err:
} if (altered_table) - close_temporary_table(thd, altered_table, 1, 0); + close_temporary_table(thd, altered_table, 1, 1);

   }  

   my_snprintf(tmp_name, sizeof(tmp_name), "%s-%lx_%lx", tmp_file_prefix, diff -Nrup a/sql/table.h b/sql/table.h

--- a/sql/table.h	2007-08-23 15:22:02 +02:00
+++ b/sql/table.h	2007-08-31 16:34:43 +02:00

@@ -82,7 +82,7 @@ typedef struct st_grant_info
 enum tmp_table_type
 {
   NO_TMP_TABLE, NON_TRANSACTIONAL_TMP_TABLE, TRANSACTIONAL_TMP_TABLE, - INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE
+ INTERNAL_TMP_TABLE, SYSTEM_TMP_TABLE, TMP_TABLE_FRM_FILE_ONLY  };  

 /** Event on which trigger is invoked. */

-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Fri Aug 31 10:36:32 2007

This archive was generated by hypermail 2.1.8 : Sun Oct 07 2007 - 09:01:35 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library