summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/schema/schema_truncate.c
diff options
context:
space:
mode:
authorDan Pasette <dan@10gen.com>2015-02-24 07:29:38 -0500
committerDan Pasette <dan@mongodb.com>2015-02-24 07:37:03 -0500
commit4a8b10a7bb9154c19b8a60cbda7b2f5d8f6b3d44 (patch)
tree92b81e2078786e72221a02ab9180374b672d06d4 /src/third_party/wiredtiger/src/schema/schema_truncate.c
parentc614b21cc563dbb400f7258124fc5d2ed58b4dce (diff)
downloadmongo-4a8b10a7bb9154c19b8a60cbda7b2f5d8f6b3d44.tar.gz
Import wiredtiger-wiredtiger-mongodb-3.0-rc10-4-g03cb722.tar.gz from wiredtiger branch mongodb-3.0
Diffstat (limited to 'src/third_party/wiredtiger/src/schema/schema_truncate.c')
-rw-r--r--src/third_party/wiredtiger/src/schema/schema_truncate.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/src/schema/schema_truncate.c b/src/third_party/wiredtiger/src/schema/schema_truncate.c
index 383e860cc7b..1eb76226aad 100644
--- a/src/third_party/wiredtiger/src/schema/schema_truncate.c
+++ b/src/third_party/wiredtiger/src/schema/schema_truncate.c
@@ -170,11 +170,15 @@ __wt_schema_range_truncate(
cursor = (start != NULL) ? start : stop;
uri = cursor->internal_uri;
- if (WT_PREFIX_MATCH(uri, "file:"))
+ if (WT_PREFIX_MATCH(uri, "file:")) {
+ if (start != NULL)
+ WT_CURSOR_NEEDKEY(start);
+ if (stop != NULL)
+ WT_CURSOR_NEEDKEY(stop);
WT_WITH_BTREE(session, ((WT_CURSOR_BTREE *)cursor)->btree,
ret = __wt_btcur_range_truncate(
(WT_CURSOR_BTREE *)start, (WT_CURSOR_BTREE *)stop));
- else if (WT_PREFIX_MATCH(uri, "table:"))
+ } else if (WT_PREFIX_MATCH(uri, "table:"))
ret = __wt_table_range_truncate(
(WT_CURSOR_TABLE *)start, (WT_CURSOR_TABLE *)stop);
else if ((dsrc = __wt_schema_get_source(session, uri)) != NULL &&
@@ -182,6 +186,6 @@ __wt_schema_range_truncate(
ret = dsrc->range_truncate(dsrc, &session->iface, start, stop);
else
ret = __wt_range_truncate(start, stop);
-
+err:
return (ret);
}