summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-07-29 16:53:42 +1000
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-07-29 16:53:42 +1000
commitc285f5484bbe84b11e0146a7aa4e7bcd8738743d (patch)
treed0c78fef73dc6103d0f54c22f97c00153deaccb3 /api
parent449650285d9ceb2fcc9d9f27791c0dcb66e11bd1 (diff)
downloadmongo-c285f5484bbe84b11e0146a7aa4e7bcd8738743d.tar.gz
Make the LevelDB API more resilient to invalid configurations. Also clean up after the test so that "make check" has a better chance of succeeding.
Diffstat (limited to 'api')
-rw-r--r--api/leveldb/Makefile.am3
-rw-r--r--api/leveldb/leveldb_wt.cc5
2 files changed, 8 insertions, 0 deletions
diff --git a/api/leveldb/Makefile.am b/api/leveldb/Makefile.am
index 2d75c2b4628..44aa69bbd48 100644
--- a/api/leveldb/Makefile.am
+++ b/api/leveldb/Makefile.am
@@ -76,3 +76,6 @@ leveldb_test_SOURCES = leveldb_test.cc
leveldb_test_LDADD = libwiredtiger_leveldb.la
TESTS = $(noinst_PROGRAMS)
+
+clean-local:
+ rm -rf WTLDB_HOME
diff --git a/api/leveldb/leveldb_wt.cc b/api/leveldb/leveldb_wt.cc
index ac868d4e0d7..8f8067ed5ce 100644
--- a/api/leveldb/leveldb_wt.cc
+++ b/api/leveldb/leveldb_wt.cc
@@ -208,7 +208,12 @@ wtleveldb_create(
s_table << "leaf_page_max=" << options.block_size << ",";
s_table << "leaf_item_max=" << options.block_size / 4 << ",";
if (options.compression == leveldb::kSnappyCompression)
+#ifdef HAVE_LIBSNAPPY
s_table << "block_compressor=snappy,";
+#else
+ return WiredTigerErrorToStatus(ENOTSUP,
+ "WiredTiger must be built with snappy support");
+#endif
#ifdef HAVE_ROCKSDB
if (options.compression == leveldb::kZlibCompression)
s_table << "block_compressor=zlib,";