|
|||||||||||
|
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
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);
+ /*
+ 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 } 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)
--- 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 } 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.comReceived 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 |
||||||||||
|
|||||||||||