summaryrefslogtreecommitdiff
path: root/src/cursor/cur_stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cursor/cur_stat.c')
-rw-r--r--src/cursor/cur_stat.c74
1 files changed, 37 insertions, 37 deletions
diff --git a/src/cursor/cur_stat.c b/src/cursor/cur_stat.c
index 00a6ade21c6..f7a8f5fc866 100644
--- a/src/cursor/cur_stat.c
+++ b/src/cursor/cur_stat.c
@@ -200,8 +200,6 @@ __curstat_next(WT_CURSOR *cursor)
if (cst->notinitialized) {
WT_ERR(__wt_curstat_init(
session, cursor->internal_uri, NULL, cst->cfg, cst));
- if (cst->next_set != NULL)
- WT_ERR((*cst->next_set)(session, cst, true, true));
cst->notinitialized = false;
}
@@ -209,6 +207,8 @@ __curstat_next(WT_CURSOR *cursor)
if (cst->notpositioned) {
cst->notpositioned = false;
cst->key = WT_STAT_KEY_MIN(cst);
+ if (cst->next_set != NULL)
+ WT_ERR((*cst->next_set)(session, cst, true, true));
} else if (cst->key < WT_STAT_KEY_MAX(cst))
++cst->key;
else if (cst->next_set != NULL)
@@ -244,8 +244,6 @@ __curstat_prev(WT_CURSOR *cursor)
if (cst->notinitialized) {
WT_ERR(__wt_curstat_init(
session, cursor->internal_uri, NULL, cst->cfg, cst));
- if (cst->next_set != NULL)
- WT_ERR((*cst->next_set)(session, cst, false, true));
cst->notinitialized = false;
}
@@ -253,6 +251,8 @@ __curstat_prev(WT_CURSOR *cursor)
if (cst->notpositioned) {
cst->notpositioned = false;
cst->key = WT_STAT_KEY_MAX(cst);
+ if (cst->next_set != NULL)
+ WT_ERR((*cst->next_set)(session, cst, false, true));
} else if (cst->key > WT_STAT_KEY_MIN(cst))
--cst->key;
else if (cst->next_set != NULL)
@@ -449,7 +449,6 @@ __curstat_join_next_set(WT_SESSION_IMPL *session, WT_CURSOR_STAT *cst,
WT_JOIN_STATS_GROUP *join_group;
ssize_t pos;
- WT_ASSERT(session, WT_STREQ(cst->iface.uri, "statistics:join"));
join_group = &cst->u.join_stats_group;
cjoin = join_group->join_cursor;
if (init)
@@ -504,14 +503,13 @@ __curstat_join_init(WT_SESSION_IMPL *session,
WT_CURSOR *curjoin, const char *cfg[], WT_CURSOR_STAT *cst)
{
WT_CURSOR_JOIN *cjoin;
- WT_DECL_RET;
WT_UNUSED(cfg);
if (curjoin == NULL && cst->u.join_stats_group.join_cursor != NULL)
curjoin = &cst->u.join_stats_group.join_cursor->iface;
if (curjoin == NULL || !WT_PREFIX_MATCH(curjoin->uri, "join:"))
- WT_ERR_MSG(session, EINVAL,
+ WT_RET_MSG(session, EINVAL,
"join cursor must be used with statistics:join");
cjoin = (WT_CURSOR_JOIN *)curjoin;
memset(&cst->u.join_stats_group, 0, sizeof(WT_JOIN_STATS_GROUP));
@@ -522,8 +520,7 @@ __curstat_join_init(WT_SESSION_IMPL *session,
cst->stats_count = sizeof(WT_JOIN_STATS) / sizeof(int64_t);
cst->stats_desc = __curstat_join_desc;
cst->next_set = __curstat_join_next_set;
-
-err: return (ret);
+ return (0);
}
/*
@@ -544,25 +541,28 @@ __wt_curstat_init(WT_SESSION_IMPL *session,
dsrc_uri = uri + strlen("statistics:");
if (WT_STREQ(dsrc_uri, "join"))
- return (__curstat_join_init(session, curjoin, cfg, cst));
+ WT_RET(__curstat_join_init(session, curjoin, cfg, cst));
- if (WT_PREFIX_MATCH(dsrc_uri, "colgroup:"))
- return (
+ else if (WT_PREFIX_MATCH(dsrc_uri, "colgroup:"))
+ WT_RET(
__wt_curstat_colgroup_init(session, dsrc_uri, cfg, cst));
- if (WT_PREFIX_MATCH(dsrc_uri, "file:"))
- return (__curstat_file_init(session, dsrc_uri, cfg, cst));
+ else if (WT_PREFIX_MATCH(dsrc_uri, "file:"))
+ WT_RET(__curstat_file_init(session, dsrc_uri, cfg, cst));
- if (WT_PREFIX_MATCH(dsrc_uri, "index:"))
- return (__wt_curstat_index_init(session, dsrc_uri, cfg, cst));
+ else if (WT_PREFIX_MATCH(dsrc_uri, "index:"))
+ WT_RET(__wt_curstat_index_init(session, dsrc_uri, cfg, cst));
- if (WT_PREFIX_MATCH(dsrc_uri, "lsm:"))
- return (__wt_curstat_lsm_init(session, dsrc_uri, cst));
+ else if (WT_PREFIX_MATCH(dsrc_uri, "lsm:"))
+ WT_RET(__wt_curstat_lsm_init(session, dsrc_uri, cst));
- if (WT_PREFIX_MATCH(dsrc_uri, "table:"))
- return (__wt_curstat_table_init(session, dsrc_uri, cfg, cst));
+ else if (WT_PREFIX_MATCH(dsrc_uri, "table:"))
+ WT_RET(__wt_curstat_table_init(session, dsrc_uri, cfg, cst));
- return (__wt_bad_object_type(session, uri));
+ else
+ return (__wt_bad_object_type(session, uri));
+
+ return (0);
}
/*
@@ -575,22 +575,22 @@ __wt_curstat_open(WT_SESSION_IMPL *session,
{
WT_CONNECTION_IMPL *conn;
WT_CURSOR_STATIC_INIT(iface,
- __curstat_get_key, /* get-key */
- __curstat_get_value, /* get-value */
- __curstat_set_key, /* set-key */
- __curstat_set_value, /* set-value */
- __wt_cursor_notsup, /* compare */
- __wt_cursor_notsup, /* equals */
- __curstat_next, /* next */
- __curstat_prev, /* prev */
- __curstat_reset, /* reset */
- __curstat_search, /* search */
- __wt_cursor_notsup, /* search-near */
- __wt_cursor_notsup, /* insert */
- __wt_cursor_notsup, /* update */
- __wt_cursor_notsup, /* remove */
- __wt_cursor_notsup, /* reconfigure */
- __curstat_close); /* close */
+ __curstat_get_key, /* get-key */
+ __curstat_get_value, /* get-value */
+ __curstat_set_key, /* set-key */
+ __curstat_set_value, /* set-value */
+ __wt_cursor_compare_notsup, /* compare */
+ __wt_cursor_equals_notsup, /* equals */
+ __curstat_next, /* next */
+ __curstat_prev, /* prev */
+ __curstat_reset, /* reset */
+ __curstat_search, /* search */
+ __wt_cursor_search_near_notsup, /* search-near */
+ __wt_cursor_notsup, /* insert */
+ __wt_cursor_notsup, /* update */
+ __wt_cursor_notsup, /* remove */
+ __wt_cursor_reconfigure_notsup, /* reconfigure */
+ __curstat_close); /* close */
WT_CONFIG_ITEM cval, sval;
WT_CURSOR *cursor;
WT_CURSOR_STAT *cst;