diff --git a/VocBase/simple-collection.c b/VocBase/simple-collection.c index b8772a027a..cb0df87385 100644 --- a/VocBase/simple-collection.c +++ b/VocBase/simple-collection.c @@ -327,6 +327,10 @@ static TRI_doc_mptr_t CreateDocument (TRI_sim_collection_t* collection, // update indexes // ............................................................................. + // ----------------------------------------------------------------------------- + // update indexes + // ----------------------------------------------------------------------------- + // generate create header if (res == TRI_ERROR_NO_ERROR) { @@ -546,6 +550,10 @@ static TRI_doc_mptr_t const UpdateDocument (TRI_sim_collection_t* collection, // update indexes // ............................................................................. + // ----------------------------------------------------------------------------- + // update indexes + // ----------------------------------------------------------------------------- + // update the header if (res == TRI_ERROR_NO_ERROR) { TRI_doc_mptr_t update; @@ -935,6 +943,8 @@ static TRI_doc_mptr_t const CreateShapedJson (TRI_doc_collection_t* document, TRI_df_marker_t* result; TRI_sim_collection_t* collection; + TRI_set_errno(TRI_ERROR_NO_ERROR); + collection = (TRI_sim_collection_t*) document; if (type == TRI_DOC_MARKER_DOCUMENT) { @@ -1027,6 +1037,8 @@ static TRI_doc_mptr_t const UpdateShapedJson (TRI_doc_collection_t* document, TRI_doc_mptr_t const* header; TRI_sim_collection_t* collection; + TRI_set_errno(TRI_ERROR_NO_ERROR); + collection = (TRI_sim_collection_t*) document; // get an existing header pointer @@ -2167,6 +2179,10 @@ static int UpdateImmediateIndexes (TRI_sim_collection_t* collection, return TRI_ERROR_AVOCADO_UNIQUE_CONSTRAINT_VIOLATED; } + if (constraint) { + return TRI_VOC_ERROR_UNIQUE_VIOLATED; + } + return result; } @@ -2861,7 +2877,7 @@ static TRI_index_t* CreateSkiplistIndexSimCollection (TRI_sim_collection_t* coll if (idx != NULL) { TRI_DestroyVector(&paths); - TRI_DestroyVectorPointer(&fields); + TRI_DestroyVectorString(&names); LOG_TRACE("skiplist-index already created"); return idx; diff --git a/VocBase/vocbase.c b/VocBase/vocbase.c index eaa7a242c8..5df70055e9 100644 --- a/VocBase/vocbase.c +++ b/VocBase/vocbase.c @@ -788,6 +788,7 @@ TRI_vocbase_t* TRI_OpenVocBase (char const* path) { } // ............................................................................. + // setup vocbase structure // .............................................................................