summaryrefslogtreecommitdiff
path: root/innobase/lock/lock0lock.c
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-10-01 13:47:58 +0300
committerunknown <heikki@hundin.mysql.fi>2002-10-01 13:47:58 +0300
commit821c77c79d47ce1c15c179509b9c6418e01323c1 (patch)
treee3f2e81fae30278e1ae06d9c4d6151160b1ad69f /innobase/lock/lock0lock.c
parent18585d178d6cbf8364c11da5973531681ac26879 (diff)
downloadmariadb-git-821c77c79d47ce1c15c179509b9c6418e01323c1.tar.gz
lock0lock.c:
Fix bug: the AUTO-INC lock was held to the end of trx if it was granted after a lock wait innobase/lock/lock0lock.c: Fix bug: the AUTO-INC lock was held to the end of trx if it was granted after a lock wait
Diffstat (limited to 'innobase/lock/lock0lock.c')
-rw-r--r--innobase/lock/lock0lock.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index da4092b926e..5fe8dc62f5a 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -1863,6 +1863,19 @@ lock_grant(
ut_ad(mutex_own(&kernel_mutex));
lock_reset_lock_and_trx_wait(lock);
+
+ if (lock_get_mode(lock) == LOCK_AUTO_INC) {
+
+ if (lock->trx->auto_inc_lock != NULL) {
+ fprintf(stderr,
+ "InnoDB: Error: trx already had an AUTO-INC lock!\n");
+ }
+
+ /* Store pointer to lock to trx so that we know to
+ release it at the end of the SQL statement */
+
+ lock->trx->auto_inc_lock = lock;
+ }
if (lock_print_waits) {
printf("Lock wait for trx %lu ends\n",