summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2014-06-11 15:54:49 -0400
committerKeith Bostic <keith@wiredtiger.com>2014-06-11 15:54:49 -0400
commit69d75f437a3b77dc98af35e10b5bae739eda597d (patch)
tree83edba28ec8c25bb45cc93b6589716576fd0e195 /src
parentb29df8d05fa9a339d121553ff7b6641d361acc90 (diff)
downloadmongo-69d75f437a3b77dc98af35e10b5bae739eda597d.tar.gz
Move the WT_CBT_CONFLICT_CHECK flag from the btree-specific cursor
structure into the WT_CURSOR structure as WT_CURSTD_CONFLICT_CHK. It's possible we could return from the row-search function with a match not found in the insert list, check for a NULL insert before indirecting through it.
Diffstat (limited to 'src')
-rw-r--r--src/btree/bt_cursor.c4
-rw-r--r--src/include/cursor.h1
-rw-r--r--src/include/wiredtiger.in23
-rw-r--r--src/lsm/lsm_cursor.c3
4 files changed, 15 insertions, 16 deletions
diff --git a/src/btree/bt_cursor.c b/src/btree/bt_cursor.c
index 5b8dc8d3fd8..e18c11ab585 100644
--- a/src/btree/bt_cursor.c
+++ b/src/btree/bt_cursor.c
@@ -408,8 +408,8 @@ retry: WT_RET(__cursor_func_init(cbt, 1));
* If we are only interested in conflict checking do it now.
* A conflict can only exist if there was an exact match.
*/
- if (F_ISSET(cbt, WT_CBT_CONFLICT_CHECK)) {
- if (cbt->compare != 0)
+ if (F_ISSET(cursor, WT_CURSTD_CONFLICT_CHK)) {
+ if (cbt->compare != 0 || cbt->ins == NULL)
return (0);
return (__wt_txn_update_check(session, cbt->ins->upd));
}
diff --git a/src/include/cursor.h b/src/include/cursor.h
index bf757963176..bef920d2104 100644
--- a/src/include/cursor.h
+++ b/src/include/cursor.h
@@ -172,7 +172,6 @@ struct __wt_cursor_btree {
#define WT_CBT_ITERATE_PREV 0x08 /* Prev iteration configuration */
#define WT_CBT_MAX_RECORD 0x10 /* Col-store: past end-of-table */
#define WT_CBT_SEARCH_SMALLEST 0x20 /* Row-store: small-key insert list */
-#define WT_CBT_CONFLICT_CHECK 0x40 /* Only check for conflicts */
uint8_t flags;
};
diff --git a/src/include/wiredtiger.in b/src/include/wiredtiger.in
index 4dd77db15e9..549c00160aa 100644
--- a/src/include/wiredtiger.in
+++ b/src/include/wiredtiger.in
@@ -516,18 +516,19 @@ struct __wt_cursor {
#define WT_CURSTD_APPEND 0x0001
#define WT_CURSTD_BULK 0x0002
-#define WT_CURSTD_DATA_SOURCE 0x0004
-#define WT_CURSTD_DUMP_HEX 0x0008
-#define WT_CURSTD_DUMP_JSON 0x0010
-#define WT_CURSTD_DUMP_PRINT 0x0020
-#define WT_CURSTD_KEY_EXT 0x0040 /* Key points out of the tree. */
-#define WT_CURSTD_KEY_INT 0x0080 /* Key points into the tree. */
+#define WT_CURSTD_CONFLICT_CHK 0x0004 /* Only check for conflicts */
+#define WT_CURSTD_DATA_SOURCE 0x0008
+#define WT_CURSTD_DUMP_HEX 0x0010
+#define WT_CURSTD_DUMP_JSON 0x0020
+#define WT_CURSTD_DUMP_PRINT 0x0040
+#define WT_CURSTD_KEY_EXT 0x0080 /* Key points out of the tree. */
+#define WT_CURSTD_KEY_INT 0x0100 /* Key points into the tree. */
#define WT_CURSTD_KEY_SET (WT_CURSTD_KEY_EXT | WT_CURSTD_KEY_INT)
-#define WT_CURSTD_OPEN 0x0100
-#define WT_CURSTD_OVERWRITE 0x0200
-#define WT_CURSTD_RAW 0x0400
-#define WT_CURSTD_VALUE_EXT 0x0800 /* Value points out of the tree. */
-#define WT_CURSTD_VALUE_INT 0x1000 /* Value points into the tree. */
+#define WT_CURSTD_OPEN 0x0200
+#define WT_CURSTD_OVERWRITE 0x0400
+#define WT_CURSTD_RAW 0x0800
+#define WT_CURSTD_VALUE_EXT 0x1000 /* Value points out of the tree. */
+#define WT_CURSTD_VALUE_INT 0x2000 /* Value points into the tree. */
#define WT_CURSTD_VALUE_SET (WT_CURSTD_VALUE_EXT | WT_CURSTD_VALUE_INT)
uint32_t flags;
#endif
diff --git a/src/lsm/lsm_cursor.c b/src/lsm/lsm_cursor.c
index 0c66f6dc9bc..fc39bdc5229 100644
--- a/src/lsm/lsm_cursor.c
+++ b/src/lsm/lsm_cursor.c
@@ -513,8 +513,7 @@ retry: if (F_ISSET(clsm, WT_CLSM_MERGE)) {
*/
if (!F_ISSET(clsm, WT_CLSM_MERGE) &&
!F_ISSET(chunk, WT_LSM_CHUNK_ONDISK) && i != nchunks - 1)
- F_SET(((WT_CURSOR_BTREE *)*cp),
- WT_CBT_CONFLICT_CHECK);
+ F_SET(*cp, WT_CURSTD_CONFLICT_CHK);
if (F_ISSET(chunk, WT_LSM_CHUNK_BLOOM) &&
!F_ISSET(clsm, WT_CLSM_MERGE))