From f50dc99d24617fbbe9c532070e9e4fd0d69dfe3f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Apr 2005 15:16:15 +0200 Subject: [PATCH 1/2] add changeset key to the bk commit mail --- BitKeeper/triggers/post-commit | 3 +++ 1 file changed, 3 insertions(+) diff --git a/BitKeeper/triggers/post-commit b/BitKeeper/triggers/post-commit index d2a4f9153b2..4c28b408658 100755 --- a/BitKeeper/triggers/post-commit +++ b/BitKeeper/triggers/post-commit @@ -27,6 +27,7 @@ then fi CHANGESET=`bk -R prs -r+ -h -d':P:::I:' ChangeSet` +CSETKEY=`bk -R prs -r+ -h -d':KEY:' ChangeSet` BUG=`bk -R prs -r+ -h -d':C:' ChangeSet | sed -ne 's/^.*[Bb][Uu][Gg] *# *\([0-9][0-9]*\).*$/\1/p'` if [ "$BUG" = "" ] @@ -51,6 +52,7 @@ List-ID: From: $FROM To: $TO Subject: bk commit - $VERSION tree ($CHANGESET)$BS +X-CSetKey: <$CSETKEY> $BH EOF bk changes -v -r+ @@ -67,6 +69,7 @@ List-ID: From: $FROM To: $INTERNALS Subject: bk commit into $VERSION tree ($CHANGESET)$BS +X-CSetKey: <$CSETKEY> $BH Below is the list of changes that have just been committed into a local $VERSION repository of $USER. When $USER does a push these changes will From ce10cefda6de5f184e3132b1985941cdac336b00 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 5 Apr 2005 18:42:34 +0200 Subject: [PATCH 2/2] Per Heikki's request make trans_register_ha tolerant to multiple registrations --- sql/handler.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/sql/handler.cc b/sql/handler.cc index 3eead37482b..96fe3937198 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -505,10 +505,16 @@ void ha_close_connection(THD* thd) "beginning of transaction" and "beginning of statement"). Only storage engines registered for the transaction/statement will know when to commit/rollback it. + + NOTE + trans_register_ha is idempotent - storage engine may register many + times per transaction. + */ void trans_register_ha(THD *thd, bool all, handlerton *ht_arg) { THD_TRANS *trans; + handlerton **ht; DBUG_ENTER("trans_register_ha"); DBUG_PRINT("enter",("%s", all ? "all" : "stmt")); @@ -520,15 +526,12 @@ void trans_register_ha(THD *thd, bool all, handlerton *ht_arg) else trans= &thd->transaction.stmt; -#ifndef DBUG_OFF - handlerton **ht=trans->ht; - while (*ht) - { - DBUG_ASSERT(*ht != ht_arg); - ht++; - } -#endif + for (ht=trans->ht; *ht; ht++) + if (*ht == ht_arg) + DBUG_VOID_RETURN; + trans->ht[trans->nht++]=ht_arg; + DBUG_ASSERT(*ht == ht_arg); trans->no_2pc|=(ht_arg->prepare==0); if (thd->transaction.xid.is_null()) thd->transaction.xid.set(thd->query_id);