summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-04-19 20:41:19 +0300
committerunknown <monty@donna.mysql.fi>2001-04-19 20:41:19 +0300
commite69d8fb32a97cd7269f01ecc60b74f710e4a7c6b (patch)
treeb9a43fcdfcccfe2291c2db879da2011530b4339f /sql/ha_berkeley.cc
parent19a2e7c16b8faf0264a0ee046374784e2a4158ad (diff)
downloadmariadb-git-e69d8fb32a97cd7269f01ecc60b74f710e4a7c6b.tar.gz
Fix for BDB and LOCK TABLES
BitKeeper/deleted/.del-ib_config.h.in~9e57db8504e55b7: Delete: innobase/ib_config.h.in BitKeeper/deleted/.del-ib_config.h~7539e26ffc614439: Delete: innobase/ib_config.h Docs/manual.texi: Changelog myisam/mi_locking.c: Cleanup mysql-test/r/bdb.result: Test for LOCK TABLES mysql-test/r/innodb.result: Test for LOCK TABLES mysql-test/t/bdb.test: Test for LOCK TABLES mysql-test/t/innodb.test: Test for LOCK TABLES sql-bench/test-insert.sh: Allow loop to be small sql/ha_berkeley.cc: Fixed bug when using LOCK TABLES with BDB sql/ha_berkeley.h: Fixed bug when using LOCK TABLES with BDB sql/handler.h: Fixed bug when using LOCK TABLES with BDB sql/sql_base.cc: Fixed bug when using LOCK TABLES with BDB sql/sql_parse.cc: UNLOCK TABLES ends transaction sql/sql_select.cc: Fix to not call index_end() twice
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc26
1 files changed, 24 insertions, 2 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 9dbd7b6c998..4b4894ebcd5 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -41,10 +41,9 @@
from the updated tables.
Testing of:
- - LOCK TABLES
- Mark tables that participate in a transaction so that they are not
closed during the transaction. We need to test what happens if
- MySQL closes a table that is updated by a not commit transaction.
+ MySQL closes a table that is updated by a not commited transaction.
*/
@@ -1701,12 +1700,35 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
DBUG_PRINT("trans",("commiting non-updating transaction"));
error=txn_commit((DB_TXN*) thd->transaction.stmt.bdb_tid,0);
thd->transaction.stmt.bdb_tid=0;
+ transaction=0;
}
}
}
DBUG_RETURN(error);
}
+
+/*
+ When using LOCK TABLE's external_lock is only called when the actual
+ TABLE LOCK is done.
+ Under LOCK TABLES, each used tables will force a call to start_stmt.
+*/
+
+int ha_berkeley::start_stmt(THD *thd)
+{
+ int error=0;
+ DBUG_ENTER("ha_berkeley::start_stmt");
+ if (!thd->transaction.stmt.bdb_tid)
+ {
+ error=txn_begin(db_env, (DB_TXN*) thd->transaction.all.bdb_tid,
+ (DB_TXN**) &thd->transaction.stmt.bdb_tid,
+ 0);
+ transaction= (DB_TXN*) thd->transaction.stmt.bdb_tid;
+ }
+ DBUG_RETURN(error);
+}
+
+
/*
The idea with handler::store_lock() is the following: