summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorunknown <monty@narttu.mysql.fi>2003-03-04 12:22:35 +0200
committerunknown <monty@narttu.mysql.fi>2003-03-04 12:22:35 +0200
commit3446199d8e421da02a5546f439ee76b368594700 (patch)
tree6c1fb5d875ec9be01b82dead74784385452e9aa2 /sql/lock.cc
parent4c0f2f45913ad0a60211785792afc45037cfd608 (diff)
downloadmariadb-git-3446199d8e421da02a5546f439ee76b368594700.tar.gz
Fixed bug in LOCK TABLE + DROP TABLE when other thread was waiting for a table that was locked bug not droped
client/mysqltest.c: Fixed bug that comments did a ping include/thr_lock.h: Added function to abort a lock for a specific thread mysql-test/mysql-test-run.sh: Fixed where mysqltest traces are put mysql-test/r/lock_multi.result: Test for LOCK TABLE + DROP TABLE bug mysql-test/t/lock_multi.test: Test for LOCK TABLE + DROP TABLE bug mysys/thr_lock.c: Added function to abort a lock for a specific thread sql/handler.cc: Indentation cleanup sql/lock.cc: Added function to abort a lock for a specific thread sql/mysql_priv.h: Added function to abort a lock for a specific thread sql/mysqld.cc: Use automatic recover even with --safe
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 4c84bbb6e69..64456e6ec36 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -313,6 +313,25 @@ void mysql_lock_abort(THD *thd, TABLE *table)
}
+/* Abort one thread / table combination */
+
+void mysql_lock_abort_for_thread(THD *thd, TABLE *table)
+{
+ MYSQL_LOCK *locked;
+ TABLE *write_lock_used;
+ DBUG_ENTER("mysql_lock_abort_for_thread");
+
+ if ((locked = get_lock_data(thd,&table,1,1,&write_lock_used)))
+ {
+ for (uint i=0; i < locked->lock_count; i++)
+ thr_abort_locks_for_thread(locked->locks[i]->lock,
+ table->in_use->real_id);
+ my_free((gptr) locked,MYF(0));
+ }
+ DBUG_VOID_RETURN;
+}
+
+
MYSQL_LOCK *mysql_lock_merge(MYSQL_LOCK *a,MYSQL_LOCK *b)
{
MYSQL_LOCK *sql_lock;