summaryrefslogtreecommitdiff
path: root/storage/maria/maria_def.h
diff options
context:
space:
mode:
authorGuilhem Bichot <guilhem@mysql.com>2008-10-09 22:03:54 +0200
committerGuilhem Bichot <guilhem@mysql.com>2008-10-09 22:03:54 +0200
commitade71b252276f8cd3de2b325074ef1dfb5694daf (patch)
tree602ac71b57d4e483706f94049df326c6445e407a /storage/maria/maria_def.h
parentc0157e8aea44496e8a69a01941bab74ef49184e5 (diff)
downloadmariadb-git-ade71b252276f8cd3de2b325074ef1dfb5694daf.tar.gz
Fix for BUG#39697 "Maria: hang when failing to insert due to UNIQUE (seen in pushbuild2 too)"
It was a forgotten rw_unlock(), due to the deadlock detector feature (so bug was only in 5.1-maria, not 6.0-maria). mysql-test/suite/maria/r/maria3.result: result, all fine mysql-test/suite/maria/t/maria3.test: Test of BUG#39697: two scenarios (transactional tables, and non-transactional table but dynamic row format so still taking the rwlock) where the hang happened. t2 added by this test was masked by a temporary table created earlier in the test, which we forgot to drop. storage/maria/ha_maria.cc: use new macro storage/maria/ma_blockrec.c: use new macro storage/maria/ma_commit.c: use new macro storage/maria/ma_init.c: putting address of dummy_transaction_object in --debug trace can be useful storage/maria/ma_open.c: use new macro storage/maria/ma_write.c: if local_lock_tree is true, we have acquired keyinfo->root_lock so need to release it before "goto err". A pair of assertions so that our usage of TrIDs is kept sensible. storage/maria/maria_def.h: A macro so that changes of MARIA_HA::trn can be tracked with --debug. It helped to understand in what cases, in maria_write(), we could have !(info->dup_key_trid == info->trn->trid) && !share->now_transactional (answer: ALTER TABLE adding UNIQUE index on transactional table).
Diffstat (limited to 'storage/maria/maria_def.h')
-rw-r--r--storage/maria/maria_def.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/storage/maria/maria_def.h b/storage/maria/maria_def.h
index 42a78261d20..0ab7c86b594 100644
--- a/storage/maria/maria_def.h
+++ b/storage/maria/maria_def.h
@@ -698,6 +698,19 @@ struct st_maria_handler
#define get_pack_length(length) ((length) >= 255 ? 3 : 1)
#define _ma_have_versioning(info) ((info)->row_flag & ROW_FLAG_TRANSID)
+/**
+ Sets table's trn and prints debug information
+ @param tbl MARIA_HA of table
+ @param newtrn what to put into tbl->trn
+ @note cast of newtrn is because %p of NULL gives warning (NULL is int)
+*/
+#define _ma_set_trn_for_table(tbl, newtrn) do { \
+ DBUG_PRINT("info",("table: %p trn: %p -> %p", \
+ (tbl), (tbl)->trn, (void *)(newtrn))); \
+ (tbl)->trn= (newtrn); \
+ } while (0)
+
+
#define MARIA_MIN_BLOCK_LENGTH 20 /* Because of delete-link */
/* Don't use to small record-blocks */
#define MARIA_EXTEND_BLOCK_LENGTH 20