summaryrefslogtreecommitdiff
path: root/innobase/include/row0mysql.h
diff options
context:
space:
mode:
authorunknown <jan@hundin.mysql.fi>2004-11-08 14:52:15 +0200
committerunknown <jan@hundin.mysql.fi>2004-11-08 14:52:15 +0200
commit04ff81aebbf2e9ef3abde40230c13882272db6f4 (patch)
treea98d05b6cd050c61fe77dc69f8174a19482a1c10 /innobase/include/row0mysql.h
parent621fa1cc62b161dd7a7d64730759eebfa3077922 (diff)
downloadmariadb-git-04ff81aebbf2e9ef3abde40230c13882272db6f4.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/row0mysql.h')
-rw-r--r--innobase/include/row0mysql.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 6e1865dae1d..581f1bcade3 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -233,6 +233,17 @@ row_update_for_mysql(
the MySQL format */
row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
handle */
+
+/*************************************************************************
+Does an unlock of a row for MySQL. */
+
+int
+row_unlock_for_mysql(
+/*=================*/
+ /* out: error code or DB_SUCCESS */
+ row_prebuilt_t* prebuilt); /* in: prebuilt struct in MySQL
+ handle */
+
/*************************************************************************
Creates an query graph node of 'update' type to be used in the MySQL
interface. */