diff options
author | Benety Goh <benety@mongodb.com> | 2015-01-22 18:13:01 -0500 |
---|---|---|
committer | Ramon Fernandez <ramon.fernandez@mongodb.com> | 2015-01-23 11:44:06 -0500 |
commit | 1e4e8de0866733c0fde8d481c4809633cc6c85cf (patch) | |
tree | f9fa7289b4b4f48b075946004ca82c8dda259248 | |
parent | dadbe696a8dc603a5014068f8b63eee17e259ff0 (diff) | |
download | mongo-1e4e8de0866733c0fde8d481c4809633cc6c85cf.tar.gz |
SERVER-17016 fixed db.collection.ensureIndex() for devnull storage engine
(cherry picked from commit 54edc490c9c44533717caefb5e8eea8661af2f45)
-rw-r--r-- | src/mongo/db/storage/devnull/devnull_kv_engine.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp index 1cd5e45adbb..6cc91b0813d 100644 --- a/src/mongo/db/storage/devnull/devnull_kv_engine.cpp +++ b/src/mongo/db/storage/devnull/devnull_kv_engine.cpp @@ -1,5 +1,3 @@ -// devnull_kv_engine.cpp - /** * Copyright (C) 2014 MongoDB Inc. * @@ -28,8 +26,11 @@ * it in the license file. */ +#include "mongo/platform/basic.h" + #include "mongo/db/storage/devnull/devnull_kv_engine.h" +#include "mongo/base/disallow_copying.h" #include "mongo/db/storage/in_memory/in_memory_record_store.h" #include "mongo/db/storage/record_store.h" #include "mongo/db/storage/sorted_data_interface.h" @@ -175,12 +176,25 @@ namespace mongo { BSONObj _dummy; }; + class DevNullSortedDataBuilderInterface : public SortedDataBuilderInterface { + MONGO_DISALLOW_COPYING(DevNullSortedDataBuilderInterface); + + public: + DevNullSortedDataBuilderInterface() { } + + virtual Status addKey(const BSONObj& key, const RecordId& loc) { + return Status::OK(); + } + }; + class DevNullSortedDataInterface : public SortedDataInterface { public: virtual ~DevNullSortedDataInterface() { } virtual SortedDataBuilderInterface* getBulkBuilder(OperationContext* txn, - bool dupsAllowed) { return NULL; } + bool dupsAllowed) { + return new DevNullSortedDataBuilderInterface(); + } virtual Status insert(OperationContext* txn, const BSONObj& key, |