summaryrefslogtreecommitdiff
path: root/sql/ha_berkeley.cc
diff options
context:
space:
mode:
authorkonstantin@mysql.com <>2005-07-19 22:21:12 +0400
committerkonstantin@mysql.com <>2005-07-19 22:21:12 +0400
commit14344b658a2a41a221bc71399c9211145dac8b03 (patch)
treeedda5c9dfcd664864671ccb706df789fbf268a14 /sql/ha_berkeley.cc
parentf40ac0bb9915501f74964c9edcd57deaa241ee61 (diff)
downloadmariadb-git-14344b658a2a41a221bc71399c9211145dac8b03.tar.gz
A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch is that every cursor gets its own lock id for table level locking. Thus cursors are protected from updates performed within the same connection. Additionally a list of transient (must be closed at commit) cursors is maintained and all transient cursors are closed when necessary. Lastly, this patch adds support for deadlock timeouts to TLL locking when using cursors. + post-review fixes.
Diffstat (limited to 'sql/ha_berkeley.cc')
-rw-r--r--sql/ha_berkeley.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/ha_berkeley.cc b/sql/ha_berkeley.cc
index 568fb727e63..26e743d4a71 100644
--- a/sql/ha_berkeley.cc
+++ b/sql/ha_berkeley.cc
@@ -120,7 +120,8 @@ static handlerton berkeley_hton = {
NULL, /* prepare */
NULL, /* recover */
NULL, /* commit_by_xid */
- NULL /* rollback_by_xid */
+ NULL, /* rollback_by_xid */
+ HTON_CLOSE_CURSORS_AT_COMMIT
};
typedef struct st_berkeley_trx_data {
@@ -372,6 +373,17 @@ void berkeley_cleanup_log_files(void)
/*****************************************************************************
** Berkeley DB tables
*****************************************************************************/
+
+ha_berkeley::ha_berkeley(TABLE *table_arg)
+ :handler(&berkeley_hton, table_arg), alloc_ptr(0), rec_buff(0), file(0),
+ int_table_flags(HA_REC_NOT_IN_SEQ | HA_FAST_KEY_READ |
+ HA_NULL_IN_KEY | HA_CAN_INDEX_BLOBS | HA_NOT_EXACT_COUNT |
+ HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED |
+ HA_AUTO_PART_KEY | HA_TABLE_SCAN_ON_INDEX),
+ changed_rows(0), last_dup_key((uint) -1), version(0), using_ignore(0)
+{}
+
+
static const char *ha_berkeley_exts[] = {
ha_berkeley_ext,
NullS