diff options
author | Keith Bostic <keith@wiredtiger.com> | 2013-04-04 13:20:05 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2013-04-04 13:20:05 -0400 |
commit | 2d9c226635fc41bb22dc8352f604794790400431 (patch) | |
tree | 5116a226f316497cf12497edd7d678f2620e8bfd /src/schema/schema_truncate.c | |
parent | cfed6309ea3704ee0fc46f3b9c92f46759e32764 (diff) | |
download | mongo-2d9c226635fc41bb22dc8352f604794790400431.tar.gz |
Write some custom data source documentation based on my Berkeley DB code.
Don't drop core for any uninitialized WT_DATA_SOURCE method and report a
consistent "not supported" error.
Diffstat (limited to 'src/schema/schema_truncate.c')
-rw-r--r-- | src/schema/schema_truncate.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/schema/schema_truncate.c b/src/schema/schema_truncate.c index 270ccdd51f6..27c692dca3c 100644 --- a/src/schema/schema_truncate.c +++ b/src/schema/schema_truncate.c @@ -104,7 +104,9 @@ __wt_schema_truncate( else if (WT_PREFIX_SKIP(tablename, "table:")) ret = __truncate_table(session, tablename); else if ((ret = __wt_schema_get_source(session, uri, &dsrc)) == 0) - ret = dsrc->truncate(dsrc, &session->iface, uri, cfg); + ret = dsrc->truncate == NULL ? + __wt_object_unsupported(session, uri) : + dsrc->truncate(dsrc, &session->iface, uri, cfg); /* If we didn't find a metadata entry, map that error to ENOENT. */ return (ret == WT_NOTFOUND ? ENOENT : ret); |