diff options
author | unknown <marko@hundin.mysql.fi> | 2005-01-28 12:18:33 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2005-01-28 12:18:33 +0200 |
commit | 264f83f07612d34c53d3d4e7478d441989997bab (patch) | |
tree | ee6668b6383795ee433d0de358fdf584cafde011 /innobase | |
parent | 9aad0ae359881bbe39431714f30e49bbed29aa97 (diff) | |
download | mariadb-git-264f83f07612d34c53d3d4e7478d441989997bab.tar.gz |
InnoDB: Allow concurrent TRUNCATE and INSERT on a table. (Bug #8144)
innobase/include/rem0rec.ic:
Improve formatting of comments
innobase/include/trx0trx.h:
dict_operation: document the effect of setting the flag
innobase/row/row0mysql.c:
Do not set the dict_operation flag. (Bug #8144)
Allow MySQL to have open handles to the table being truncated.
sql/ha_innodb.cc:
store_lock(): Do not weaken TL_WRITE locks taken by TRUNCATE TABLE.
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/include/rem0rec.ic | 4 | ||||
-rw-r--r-- | innobase/include/trx0trx.h | 4 | ||||
-rw-r--r-- | innobase/row/row0mysql.c | 12 |
3 files changed, 5 insertions, 15 deletions
diff --git a/innobase/include/rem0rec.ic b/innobase/include/rem0rec.ic index ca69b9ca871..366f1c3f77d 100644 --- a/innobase/include/rem0rec.ic +++ b/innobase/include/rem0rec.ic @@ -526,7 +526,7 @@ bits of a record. (Only compact records have status bits.) */ UNIV_INLINE ulint rec_get_info_and_status_bits( -/*==============*/ +/*=========================*/ /* out: info bits */ rec_t* rec, /* in: physical record */ ibool comp) /* in: TRUE=compact page format */ @@ -550,7 +550,7 @@ bits of a record. (Only compact records have status bits.) */ UNIV_INLINE void rec_set_info_and_status_bits( -/*==============*/ +/*=========================*/ rec_t* rec, /* in: physical record */ ibool comp, /* in: TRUE=compact page format */ ulint bits) /* in: info bits */ diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 76b051105de..b63afdd526c 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -383,7 +383,9 @@ struct trx_struct{ dulint commit_lsn; /* lsn at the time of the commit */ ibool dict_operation; /* TRUE if the trx is used to create a table, create an index, or drop a - table */ + table. This is a hint that the table + may need to be dropped in crash + recovery. */ dulint table_id; /* table id if the preceding field is TRUE */ /*------------------------------*/ diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 6aaa0cbcf1b..2c4eebedaf7 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2561,17 +2561,6 @@ do not allow the TRUNCATE. We also reserve the data dictionary latch. */ goto funct_exit; } - if (table->n_mysql_handles_opened > 1) { - ut_print_timestamp(stderr); -fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr); - ut_print_name(stderr, trx, table->name); - fputs("\n" -"InnoDB: though there are still open handles to it.\n", stderr); - err = DB_ERROR; - - goto funct_exit; - } - /* TODO: could we replace the counter n_foreign_key_checks_running with lock checks on the table? Acquire here an exclusive lock on the table, and rewrite lock0lock.c and the lock wait in srv0srv.c so that @@ -2594,7 +2583,6 @@ fputs(" InnoDB: Warning: MySQL is trying to truncate table ", stderr); lock_reset_all_on_table(table); - trx->dict_operation = TRUE; trx->table_id = table->id; /* scan SYS_INDEXES for all indexes of the table */ |