diff options
author | Michael Cahill <michael.cahill@mongodb.com> | 2016-03-25 08:19:12 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@mongodb.com> | 2016-03-25 08:19:12 +1100 |
commit | 43e885a0f9a3ad046eae1726b005ca1280624be3 (patch) | |
tree | f03d31a7b36c476484f26ea5259777aeb7b13201 /src/schema/schema_truncate.c | |
parent | 5cdd3e320cb19cd54111c2572a3d6e33d3009ad4 (diff) | |
parent | 9cf8eb2f15c6df7da90c19c86ccf7516ed126183 (diff) | |
download | mongodb-3.2.5.tar.gz |
Merge branch 'mongodb-3.4' into mongodb-3.2mongodb-3.2.5
Diffstat (limited to 'src/schema/schema_truncate.c')
-rw-r--r-- | src/schema/schema_truncate.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/schema/schema_truncate.c b/src/schema/schema_truncate.c index e7752b60ca4..d9a798b6ed8 100644 --- a/src/schema/schema_truncate.c +++ b/src/schema/schema_truncate.c @@ -131,22 +131,19 @@ int __wt_schema_range_truncate( WT_SESSION_IMPL *session, WT_CURSOR *start, WT_CURSOR *stop) { - WT_CURSOR *cursor; WT_DATA_SOURCE *dsrc; WT_DECL_RET; const char *uri; - cursor = (start != NULL) ? start : stop; - uri = cursor->internal_uri; + uri = start->internal_uri; if (WT_PREFIX_MATCH(uri, "file:")) { - if (start != NULL) - WT_CURSOR_NEEDKEY(start); + WT_CURSOR_NEEDKEY(start); if (stop != NULL) WT_CURSOR_NEEDKEY(stop); - WT_WITH_BTREE(session, ((WT_CURSOR_BTREE *)cursor)->btree, + WT_WITH_BTREE(session, ((WT_CURSOR_BTREE *)start)->btree, ret = __wt_btcur_range_truncate( - (WT_CURSOR_BTREE *)start, (WT_CURSOR_BTREE *)stop)); + (WT_CURSOR_BTREE *)start, (WT_CURSOR_BTREE *)stop)); } else if (WT_PREFIX_MATCH(uri, "table:")) ret = __wt_table_range_truncate( (WT_CURSOR_TABLE *)start, (WT_CURSOR_TABLE *)stop); |