Below is the list of changes that have just been committed into a local
5.1 repository of jimw. When jimw 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.1947 05/11/07 17:14:35 jimw@stripped +2 -0
Use transaction-aware DB->stat() call when doing 'ANALYZE TABLE' on
a table using the BDB storage engine. (Bug #14671)
sql/ha_berkeley.cc
1.160 05/11/07 17:14:32 jimw@stripped +2 -36
Remove unnecessary code to skip 'ANALYZE TABLE' when transactions are in
process, now that BDB supports passing the transaction to the DB->stat()
method.
mysql-test/r/bdb-crash.result
1.10 05/11/07 17:14:31 jimw@stripped +1 -1
Update test result
# 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: jimw
# Host: rama.(none)
# Root: /home/jimw/my/mysql-5.1-14671
--- 1.159/sql/ha_berkeley.cc 2005-11-07 07:24:36 -08:00
+++ 1.160/sql/ha_berkeley.cc 2005-11-07 17:14:32 -08:00
@@ -2286,40 +2286,6 @@
berkeley_trx_data *trx=(berkeley_trx_data *)thd->ha_data[berkeley_hton.slot];
DBUG_ASSERT(trx);
- /*
- Original bdb documentation says:
- "The DB->stat method cannot be transaction-protected.
- For this reason, it should be called in a thread of
- control that has no open cursors or active transactions."
- So, let's check if there are any changes have been done since
- the beginning of the transaction..
- */
-
- if (!db_env->txn_stat(db_env, &txn_stat_ptr, 0) &&
- txn_stat_ptr && txn_stat_ptr->st_nactive>=2)
- {
- DB_TXN_ACTIVE *atxn_stmt= 0, *atxn_all= 0;
-
- u_int32_t all_id= trx->all->id(trx->all);
- u_int32_t stmt_id= trx->stmt->id(trx->stmt);
-
- DB_TXN_ACTIVE *cur= txn_stat_ptr->st_txnarray;
- DB_TXN_ACTIVE *end= cur + txn_stat_ptr->st_nactive;
- for (; cur!=end && (!atxn_stmt || !atxn_all); cur++)
- {
- if (cur->txnid==all_id) atxn_all= cur;
- if (cur->txnid==stmt_id) atxn_stmt= cur;
- }
-
- if (atxn_stmt && atxn_all &&
- log_compare(&atxn_stmt->lsn,&atxn_all->lsn))
- {
- free(txn_stat_ptr);
- return HA_ADMIN_REJECT;
- }
- free(txn_stat_ptr);
- }
-
for (i=0 ; i < table->s->keys ; i++)
{
if (stat)
@@ -2327,7 +2293,7 @@
free(stat);
stat=0;
}
- if ((key_file[i]->stat)(key_file[i], NULL, (void*) &stat, 0))
+ if ((key_file[i]->stat)(key_file[i], trx->all, (void*) &stat, 0))
goto err; /* purecov: inspected */
share->rec_per_key[i]= (stat->bt_ndata /
(stat->bt_nkeys ? stat->bt_nkeys : 1));
@@ -2340,7 +2306,7 @@
free(stat);
stat=0;
}
- if ((file->stat)(file, NULL, (void*) &stat, 0))
+ if ((file->stat)(file, trx->all, (void*) &stat, 0))
goto err; /* purecov: inspected */
}
pthread_mutex_lock(&share->mutex);
--- 1.9/mysql-test/r/bdb-crash.result 2004-03-29 15:32:39 -08:00
+++ 1.10/mysql-test/r/bdb-crash.result 2005-11-07 17:14:31 -08:00
@@ -35,5 +35,5 @@
insert into t1 values(1);
analyze table t1;
Table Op Msg_type Msg_text
-test.t1 analyze status Operation need committed state
+test.t1 analyze status OK
drop table t1;
| Thread |
|---|
| • bk commit into 5.1 tree (jimw:1.1947) BUG#14671 | Jim Winstead | 8 Nov |