summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/cursor/cur_join.c
diff options
context:
space:
mode:
authorAlex Gorrod <alexander.gorrod@mongodb.com>2016-05-27 15:51:43 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-05-27 15:51:52 +1000
commitf5be31696774455a67ca8c3f6268252d1d4086a4 (patch)
tree9ab8d44354f28d9e2db7309ab81fc4ae71dc102e /src/third_party/wiredtiger/src/cursor/cur_join.c
parent832d65c6eec6eb4314b2700a18a332185b5baa36 (diff)
downloadmongo-f5be31696774455a67ca8c3f6268252d1d4086a4.tar.gz
Import wiredtiger-wiredtiger-2.8.0-441-g6f9a7a4.tar.gz from wiredtiger branch mongodb-3.4
ref: 636a7b2..6f9a7a4 WT-2554 Implement a framework for adding C test cases WT-2610 Investigate eviction hazard pointer check WT-2611 wtperf and/or WT_CONFIG_PARSER do not allow escaped double quotes WT-2617 Bug in pluggable file system example WT-2624 snprintf unsupported on MSVC 2013 WT-2626 snprintf errors with macro redefinition on MSVC2015 WT-2627 Coverity complaints WT-2628 reconciliation can return without unlocking the page lock WT-2629 Introduction of ppc64le crc32c assembly file has made the stack executable WT-2630 Rename WT_FSTREAM methods to avoid using C99 reserved names WT-2632 Test format failures due to "checkpoints cannot be dropped when in-use" WT-2637 The file-extension documentation doesn't cover not-supported cases WT-2644 'wt load -r' (rename) fails with LSM WT-2646 Split the lock_wait flag into two, adding a checkpoint_wait flag WT-2651 Coverity 1355591 resource leak WT-2653 the custom file-system example should show device configuration WT-2656 Builds failing on GCC 4.7 builder WT-2659 csuite tests, assorted lint and cleanup. WT-2660 Hang between eviction and connection close WT-2661 Coverity failures: 1356050-1356053 WT-2662 For internal spell checking, strip out double quote literals, they confuse aspell SERVER-24151 WiredTiger changes for MongoDB 3.3.7
Diffstat (limited to 'src/third_party/wiredtiger/src/cursor/cur_join.c')
-rw-r--r--src/third_party/wiredtiger/src/cursor/cur_join.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/src/third_party/wiredtiger/src/cursor/cur_join.c b/src/third_party/wiredtiger/src/cursor/cur_join.c
index fd7de53c981..b35558e04b3 100644
--- a/src/third_party/wiredtiger/src/cursor/cur_join.c
+++ b/src/third_party/wiredtiger/src/cursor/cur_join.c
@@ -45,7 +45,6 @@ __wt_curjoin_joined(WT_CURSOR *cursor)
/*
* __curjoin_iter_init --
* Initialize an iteration for the index managed by a join entry.
- *
*/
static int
__curjoin_iter_init(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
@@ -66,7 +65,6 @@ __curjoin_iter_init(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
/*
* __curjoin_iter_close --
* Close the iteration, release resources.
- *
*/
static int
__curjoin_iter_close(WT_CURSOR_JOIN_ITER *iter)
@@ -82,7 +80,6 @@ __curjoin_iter_close(WT_CURSOR_JOIN_ITER *iter)
/*
* __curjoin_iter_close_all --
* Free the iterator and all of its children recursively.
- *
*/
static int
__curjoin_iter_close_all(WT_CURSOR_JOIN_ITER *iter)
@@ -105,7 +102,6 @@ __curjoin_iter_close_all(WT_CURSOR_JOIN_ITER *iter)
/*
* __curjoin_iter_reset --
* Reset an iteration to the starting point.
- *
*/
static int
__curjoin_iter_reset(WT_CURSOR_JOIN_ITER *iter)
@@ -120,7 +116,6 @@ __curjoin_iter_reset(WT_CURSOR_JOIN_ITER *iter)
/*
* __curjoin_iter_ready --
* Check the positioned flag for all nested iterators.
- *
*/
static bool
__curjoin_iter_ready(WT_CURSOR_JOIN_ITER *iter)
@@ -136,7 +131,6 @@ __curjoin_iter_ready(WT_CURSOR_JOIN_ITER *iter)
/*
* __curjoin_iter_set_entry --
* Set the current entry for an iterator.
- *
*/
static int
__curjoin_iter_set_entry(WT_CURSOR_JOIN_ITER *iter, u_int entry_pos)
@@ -146,13 +140,13 @@ __curjoin_iter_set_entry(WT_CURSOR_JOIN_ITER *iter, u_int entry_pos)
WT_CURSOR_JOIN_ENTRY *entry;
WT_DECL_RET;
WT_SESSION_IMPL *session;
- char *uri;
+ size_t size;
const char *raw_cfg[] = { WT_CONFIG_BASE(
iter->session, WT_SESSION_open_cursor), "raw", NULL };
const char *def_cfg[] = { WT_CONFIG_BASE(
iter->session, WT_SESSION_open_cursor), NULL };
const char **config;
- size_t size;
+ char *uri;
session = iter->session;
cjoin = iter->cjoin;
@@ -402,8 +396,7 @@ __curjoin_endpoint_init_key(WT_SESSION_IMPL *session,
endpoint->recno_buf,
sizeof(endpoint->recno_buf),
&endpoint->key));
- }
- else
+ } else
endpoint->key = *k;
}
}
@@ -422,8 +415,8 @@ __curjoin_entries_in_range(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
WT_CURSOR_JOIN_ENTRY *entry;
WT_CURSOR_JOIN_ITER *iter;
WT_DECL_RET;
- int fastret, slowret;
u_int pos;
+ int fastret, slowret;
iter = iterarg;
if (F_ISSET(cjoin, WT_CURJOIN_DISJUNCTION)) {
@@ -459,8 +452,8 @@ __curjoin_entry_in_range(WT_SESSION_IMPL *session, WT_CURSOR_JOIN_ENTRY *entry,
WT_COLLATOR *collator;
WT_CURSOR_JOIN_ENDPOINT *end, *endmax;
bool disjunction, passed;
- int cmp;
u_int pos;
+ int cmp;
collator = (entry->index != NULL) ? entry->index->collator : NULL;
endmax = &entry->ends[entry->ends_next];
@@ -758,15 +751,15 @@ __curjoin_init_bloom(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
WT_COLLATOR *collator;
WT_CURSOR *c;
WT_CURSOR_JOIN_ENDPOINT *end, *endmax;
- WT_DECL_RET;
WT_DECL_ITEM(uribuf);
+ WT_DECL_RET;
WT_ITEM curkey, curvalue;
- const char *raw_cfg[] = { WT_CONFIG_BASE(
- session, WT_SESSION_open_cursor), "raw", NULL };
- const char *uri;
size_t size;
u_int skip;
int cmp;
+ const char *uri;
+ const char *raw_cfg[] = { WT_CONFIG_BASE(
+ session, WT_SESSION_open_cursor), "raw", NULL };
c = NULL;
skip = 0;
@@ -905,18 +898,18 @@ __curjoin_init_next(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
bool iterable)
{
WT_BLOOM *bloom;
- WT_DECL_RET;
WT_CURSOR *origcur;
- WT_CURSOR_JOIN_ENTRY *je, *jeend, *je2;
WT_CURSOR_JOIN_ENDPOINT *end;
+ WT_CURSOR_JOIN_ENTRY *je, *jeend, *je2;
+ WT_DECL_RET;
+ size_t size;
+ uint32_t f, k;
char *mainbuf;
const char *def_cfg[] = { WT_CONFIG_BASE(
session, WT_SESSION_open_cursor), NULL };
const char *raw_cfg[] = { WT_CONFIG_BASE(
session, WT_SESSION_open_cursor), "raw", NULL };
const char **config, *proj, *urimain;
- size_t size;
- uint32_t f, k;
mainbuf = NULL;
if (cjoin->entries_next == 0)
@@ -1140,10 +1133,10 @@ __curjoin_open_main(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
{
WT_DECL_RET;
WT_INDEX *idx;
+ size_t len, newsize;
char *main_uri, *newformat;
const char *raw_cfg[] = { WT_CONFIG_BASE(
session, WT_SESSION_open_cursor), "raw", NULL };
- size_t len, newsize;
main_uri = NULL;
idx = entry->index;
@@ -1151,8 +1144,7 @@ __curjoin_open_main(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
newsize = strlen(cjoin->table->name) + idx->colconf.len + 1;
WT_ERR(__wt_calloc(session, 1, newsize, &main_uri));
snprintf(main_uri, newsize, "%s%.*s",
- cjoin->table->name, (int)idx->colconf.len,
- idx->colconf.str);
+ cjoin->table->name, (int)idx->colconf.len, idx->colconf.str);
WT_ERR(__wt_open_cursor(session, main_uri,
(WT_CURSOR *)cjoin, raw_cfg, &entry->main));
if (idx->extractor == NULL) {
@@ -1165,8 +1157,7 @@ __curjoin_open_main(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
*/
len = strlen(entry->main->value_format) + 3;
WT_ERR(__wt_calloc(session, len, 1, &newformat));
- snprintf(newformat, len, "%s0x",
- entry->main->value_format);
+ snprintf(newformat, len, "%s0x", entry->main->value_format);
__wt_free(session, entry->main->value_format);
entry->main->value_format = newformat;
}
@@ -1364,9 +1355,9 @@ __wt_curjoin_join(WT_SESSION_IMPL *session, WT_CURSOR_JOIN *cjoin,
uint64_t count, uint32_t bloom_bit_count, uint32_t bloom_hash_count)
{
WT_CURSOR_INDEX *cindex;
+ WT_CURSOR_JOIN *child;
WT_CURSOR_JOIN_ENDPOINT *end;
WT_CURSOR_JOIN_ENTRY *entry;
- WT_CURSOR_JOIN *child;
bool hasins, needbloom, nested, range_eq;
size_t len;
u_int i, ins, nonbloom;