diff options
author | unknown <jan@hundin.mysql.fi> | 2004-11-08 14:52:15 +0200 |
---|---|---|
committer | unknown <jan@hundin.mysql.fi> | 2004-11-08 14:52:15 +0200 |
commit | 20c82f5c014e9902f234f925a218895f3b91b154 (patch) | |
tree | a98d05b6cd050c61fe77dc69f8174a19482a1c10 /innobase/include/trx0trx.h | |
parent | bff1d4751da5e74bd005675b04a8217b163da16b (diff) | |
download | mariadb-git-20c82f5c014e9902f234f925a218895f3b91b154.tar.gz |
Fixed a bug in UPDATE statement with no index column in where condition
locks all rows (BUG #3300). When using innobase_locks_unsafe_for_binlog
option InnoDB does not take locks for those rows which do not
belong to the result set or werent changed by the query. This fix removes
unnecessary locks also from SELECT and DELETE queries.
innobase/include/row0mysql.h:
Added prototype for row_unlock_for_mysql() function which does an unlock of
a row for MySQL.
innobase/include/trx0trx.h:
Added a field trx_create_lock to a transaction structure. This field is
TRUE if we have created a new lock for a record accessed.
innobase/lock/lock0lock.c:
Set lock create flag if lock is created and reset this flag before
transaction requests a lock.
innobase/row/row0mysql.c:
Add support for unlocking a row in InnoDB. If we are using
innobase_locks_unsafe_for_binlog option then all those record
locks obtained by SQL-query which do not belong to result set
or were not modified are unlocked i.e. we remove the lock from
those records.
sql/ha_innodb.cc:
Added support for a unlock_row interface in InnoDB.
sql/ha_innodb.h:
Added prototype for a function unlock_row().
Diffstat (limited to 'innobase/include/trx0trx.h')
-rw-r--r-- | innobase/include/trx0trx.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 7eb91048684..602291f946a 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -423,6 +423,8 @@ struct trx_struct{ lock_t* auto_inc_lock; /* possible auto-inc lock reserved by the transaction; note that it is also in the lock list trx_locks */ + ibool trx_create_lock;/* this is TRUE if we have created a + new lock for a record accessed */ ulint n_lock_table_exp;/* number of explicit table locks (LOCK TABLES) reserved by the transaction, stored in trx_locks */ |