summaryrefslogtreecommitdiff
path: root/storage/myisammrg
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/april.(none)>2007-07-25 19:56:17 +0500
committerunknown <svoj@mysql.com/april.(none)>2007-07-25 19:56:17 +0500
commit4537a0c9e97e19b34bd4cc1969ce388f4ac48ccc (patch)
tree3d9b4b3023946a2cde552f86f3b6f13275eb21d6 /storage/myisammrg
parent363a2f765c044e9442423692208d12635ec63eb0 (diff)
downloadmariadb-git-4537a0c9e97e19b34bd4cc1969ce388f4ac48ccc.tar.gz
BUG#29806 - binlog_innodb.test creates a server log
Stopping mysql server could result in an entry in mysql error file: "InnoDB: Error: MySQL is freeing a thd". This happened because InnoDB assumes that the server will never call external_lock(F_UNLCK) in case external_lock(READ/WRITE) failed. Prior to this patch we haven't had strict definition whether external_lock(F_UNLCK) must be called in case external_lock(READ/WRITE) fails. This patch states that we never call external_lock(F_UNLCK) in case external_lock(READ/WRITE) fails. mysql-test/suite/binlog/t/disabled.def: Re-enabled binlog_innodb and binlog_killed tests. sql/ha_ndbcluster.cc: Restore handler state in case external_lock() failed. sql/ha_partition.cc: Do not call external_lock(F_UNLCK) in case external_lock(READ/WRITE) failed. sql/lock.cc: Do not call external_lock(F_UNLCK) in case external_lock(READ/WRITE) failed. storage/myisammrg/myrg_locking.c: Restore handler state in case external_lock() failed.
Diffstat (limited to 'storage/myisammrg')
-rw-r--r--storage/myisammrg/myrg_locking.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/storage/myisammrg/myrg_locking.c b/storage/myisammrg/myrg_locking.c
index a07833bc829..4f1e3f844a1 100644
--- a/storage/myisammrg/myrg_locking.c
+++ b/storage/myisammrg/myrg_locking.c
@@ -37,7 +37,15 @@ int myrg_lock_database(MYRG_INFO *info, int lock_type)
(file->table)->owned_by_merge = TRUE;
#endif
if ((new_error=mi_lock_database(file->table,lock_type)))
+ {
error=new_error;
+ if (lock_type != F_UNLCK)
+ {
+ while (--file >= info->open_tables)
+ mi_lock_database(file->table, F_UNLCK);
+ break;
+ }
+ }
}
return(error);
}