Below is the list of changes that have just been committed into a local
5.0 repository of serg. When serg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1880 05/04/05 18:42:34 serg@stripped +1 -0
Per Heikki's request make trans_register_ha tolerant to multiple registrations
sql/handler.cc
1.157 05/04/05 18:42:22 serg@stripped +11 -8
Per Heikki's request make trans_register_ha tolerant to multiple registrations
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: serg
# Host: serg.mylan
# Root: /usr/home/serg/Abk/mysql-5.0
--- 1.156/sql/handler.cc Tue Apr 5 13:23:03 2005
+++ 1.157/sql/handler.cc Tue Apr 5 18:42:22 2005
@@ -505,10 +505,16 @@
"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 @@
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);
| Thread |
|---|
| • bk commit into 5.0 tree (serg:1.1880) | Sergei Golubchik | 5 Apr |