summaryrefslogtreecommitdiff
path: root/innobase/row/row0mysql.c
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-11-27 00:45:01 +0200
committerunknown <marko@hundin.mysql.fi>2004-11-27 00:45:01 +0200
commit346dce93c2a63757540ed15e660dd07d41f7f20d (patch)
tree8ca2dd048763662b02f24eeeac0e7571a2ffe83d /innobase/row/row0mysql.c
parentb0d586e5648e78981c63e68059c6c836a228a082 (diff)
downloadmariadb-git-346dce93c2a63757540ed15e660dd07d41f7f20d.tar.gz
InnoDB: Make intermediate COMMITs in ALTER TABLE more robust (Bug #6633)
innobase/include/lock0lock.h: Replaced lock_get_ix_table() with lock_get_table(). innobase/lock/lock0lock.c: Replaced lock_get_ix_table() with lock_get_table(). innobase/include/row0mysql.h: row_lock_table_for_mysql(): Added parameter mode. innobase/row/row0mysql.c: row_lock_table_for_mysql(): Added parameter mode. sql/ha_innodb.cc: ha_innobase::write_row(): Make ALTER TABLE commits more robust: account for conversions from non-InnoDB format, do not attempt to commit if there are other than a single IX or IS lock on the source table, and the source table is in InnoDB format. This prohibits intermediate commits for OPTIMIZE TABLE if the table contains an auto_increment field.
Diffstat (limited to 'innobase/row/row0mysql.c')
-rw-r--r--innobase/row/row0mysql.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 9613da2e286..dec2b19559c 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -782,10 +782,11 @@ row_lock_table_for_mysql(
/* out: error code or DB_SUCCESS */
row_prebuilt_t* prebuilt, /* in: prebuilt struct in the MySQL
table handle */
- dict_table_t* table) /* in: table to LOCK_IX, or NULL
+ dict_table_t* table, /* in: table to lock, or NULL
if prebuilt->table should be
locked as LOCK_TABLE_EXP |
prebuilt->select_lock_type */
+ ulint mode) /* in: lock mode of table */
{
trx_t* trx = prebuilt->trx;
que_thr_t* thr;
@@ -819,7 +820,7 @@ run_again:
trx_start_if_not_started(trx);
if (table) {
- err = lock_table(0, table, LOCK_IX, thr);
+ err = lock_table(0, table, mode, thr);
} else {
err = lock_table(LOCK_TABLE_EXP, prebuilt->table,
prebuilt->select_lock_type, thr);