summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-03-29 19:21:53 +0300
committermonty@mysql.com <>2004-03-29 19:21:53 +0300
commitdc2f606fb85e0763a448132a147a816de829a8cb (patch)
treef51ea3945f84d672edc962cdfc11eab16f569fc5 /sql/ha_berkeley.cc
parent505970b4a76f3d41f338d32d3d4382891ecb0ec3 (diff)
parent3cbab63af1e92677217be8106d5ed696b20521b1 (diff)
downloadmariadb-git-dc2f606fb85e0763a448132a147a816de829a8cb.tar.gz
Merge with 4.0 to get lastest bug fixes
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 4a1ce43cf70..612a9c33b45 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -2123,10 +2123,19 @@ static void print_msg(THD *thd, const char *table_name, const char *op_name,
int ha_berkeley::analyze(THD* thd, HA_CHECK_OPT* check_opt)
{
- DB_BTREE_STAT *stat=0;
uint i;
+ DB_BTREE_STAT *stat=0;
DB_TXN_STAT *txn_stat_ptr= 0;
+ /*
+ 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)
{