1
0
Fork 0

Merge branch 'vpack' of ssh://github.com/ArangoDB/ArangoDB into vpack

This commit is contained in:
Max Neunhoeffer 2015-12-17 12:14:25 +01:00
commit ec7f6be918
2 changed files with 6 additions and 5 deletions

View File

@ -1579,7 +1579,6 @@ static void CreateVocBase (const v8::FunctionCallbackInfo<v8::Value>& args,
VPackBuilder builder; VPackBuilder builder;
builder.openObject();
VPackSlice infoSlice; VPackSlice infoSlice;
if (2 <= args.Length()) { if (2 <= args.Length()) {
if (! args[1]->IsObject()) { if (! args[1]->IsObject()) {
@ -1590,7 +1589,6 @@ static void CreateVocBase (const v8::FunctionCallbackInfo<v8::Value>& args,
if (res != TRI_ERROR_NO_ERROR) { if (res != TRI_ERROR_NO_ERROR) {
TRI_V8_THROW_EXCEPTION(res); TRI_V8_THROW_EXCEPTION(res);
} }
builder.close();
infoSlice = builder.slice(); infoSlice = builder.slice();
if (infoSlice.hasKey("journalSize")) { if (infoSlice.hasKey("journalSize")) {
@ -1608,7 +1606,6 @@ static void CreateVocBase (const v8::FunctionCallbackInfo<v8::Value>& args,
#endif #endif
} }
else { else {
builder.close();
infoSlice = builder.slice(); infoSlice = builder.slice();
} }

View File

@ -2337,8 +2337,12 @@ TRI_document_collection_t* TRI_CreateDocumentCollection (TRI_vocbase_t* vocbase,
// check if we can generate the key generator // check if we can generate the key generator
std::shared_ptr<arangodb::velocypack::Buffer<uint8_t> const> buffer = parameters.keyOptions(); std::shared_ptr<arangodb::velocypack::Buffer<uint8_t> const> buffer = parameters.keyOptions();
VPackSlice const slice(buffer->data());
std::unique_ptr<TRI_json_t> json(triagens::basics::VelocyPackHelper::velocyPackToJson(slice)); std::unique_ptr<TRI_json_t> json;
if (buffer != nullptr) {
VPackSlice const slice(buffer->data());
json.reset(triagens::basics::VelocyPackHelper::velocyPackToJson(slice));
}
KeyGenerator* keyGenerator = KeyGenerator::factory(json.get()); KeyGenerator* keyGenerator = KeyGenerator::factory(json.get());
if (keyGenerator == nullptr) { if (keyGenerator == nullptr) {