summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/session/session_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/session/session_api.c')
-rw-r--r--src/third_party/wiredtiger/src/session/session_api.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/src/session/session_api.c b/src/third_party/wiredtiger/src/session/session_api.c
index b7daf0e2e02..5ce6135cfca 100644
--- a/src/third_party/wiredtiger/src/session/session_api.c
+++ b/src/third_party/wiredtiger/src/session/session_api.c
@@ -818,6 +818,8 @@ __session_reset(WT_SESSION *wt_session)
WT_TRET(__wt_session_reset_cursors(session, true));
+ WT_TRET(__wt_schema_sweep_tables(session));
+
/* Release common session resources. */
WT_TRET(__wt_session_release_resources(session));
@@ -1105,7 +1107,6 @@ int
__wt_session_range_truncate(WT_SESSION_IMPL *session,
const char *uri, WT_CURSOR *start, WT_CURSOR *stop)
{
- WT_CURSOR *cursor;
WT_DECL_RET;
int cmp;
bool local_start;
@@ -1134,12 +1135,13 @@ __wt_session_range_truncate(WT_SESSION_IMPL *session,
}
/*
- * Cursor truncate is only supported for some objects, check for the
- * supporting methods we need, range_truncate and compare.
+ * Cursor truncate is only supported for some objects, check for a
+ * supporting compare method.
*/
- cursor = start == NULL ? stop : start;
- if (cursor->compare == NULL)
- WT_ERR(__wt_bad_object_type(session, cursor->uri));
+ if (start != NULL && start->compare == NULL)
+ WT_ERR(__wt_bad_object_type(session, start->uri));
+ if (stop != NULL && stop->compare == NULL)
+ WT_ERR(__wt_bad_object_type(session, stop->uri));
/*
* If both cursors set, check they're correctly ordered with respect to
@@ -1150,6 +1152,9 @@ __wt_session_range_truncate(WT_SESSION_IMPL *session,
* reference the same object and the keys are set.
*/
if (start != NULL && stop != NULL) {
+ /* quiet clang scan-build */
+ WT_ASSERT(session, start->compare != NULL);
+
WT_ERR(start->compare(start, stop, &cmp));
if (cmp > 0)
WT_ERR_MSG(session, EINVAL,