mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
f26177e890
|
@ -957,6 +957,7 @@ static int InsertDocument (TRI_transaction_collection_t* trxCollection,
|
|||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
// insertion into secondary indexes failed
|
||||
DeletePrimaryIndex(document, header, true);
|
||||
DeleteSecondaryIndexes(document, header, true);
|
||||
document->_headers->release(document->_headers, header, true);
|
||||
|
||||
return res;
|
||||
|
|
|
@ -149,13 +149,6 @@ struct TRI_vocbase_defaults_s;
|
|||
#define TRI_WAIT_SYNCHRONISER_WAITER_VOCBASE(a, b) \
|
||||
TRI_TimedWaitCondition(&(a)->_syncWaitersCondition, (b))
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief signals the synchroniser waiters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_BROADCAST_SYNCHRONISER_WAITER_VOCBASE(a) \
|
||||
TRI_BroadcastCondition(&(a)->_syncWaitersCondition)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief reduces the number of sync waiters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -235,6 +235,66 @@ function HashIndexSuite() {
|
|||
catch (err) {
|
||||
assertEqual(errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code, err.errorNum);
|
||||
}
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test: combination of indexes
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testMultiIndexViolation1 : function () {
|
||||
collection.ensureUniqueConstraint("a");
|
||||
collection.ensureSkiplist("b");
|
||||
|
||||
collection.save({ a : "test1", b : 1});
|
||||
try {
|
||||
collection.save({ a : "test1", b : 1});
|
||||
fail();
|
||||
}
|
||||
catch (err1) {
|
||||
}
|
||||
|
||||
var doc1 = collection.save({ a : "test2", b : 1});
|
||||
assertTrue(doc1._key !== "");
|
||||
|
||||
try {
|
||||
collection.save({ a : "test1", b : 1});
|
||||
fail();
|
||||
}
|
||||
catch (err2) {
|
||||
}
|
||||
|
||||
var doc2 = collection.save({ a : "test3", b : 1});
|
||||
assertTrue(doc2._key !== "");
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test: combination of indexes
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testMultiIndexViolation2 : function () {
|
||||
collection.ensureUniqueSkiplist("a");
|
||||
collection.ensureHashIndex("b");
|
||||
|
||||
collection.save({ a : "test1", b : 1});
|
||||
try {
|
||||
collection.save({ a : "test1", b : 1});
|
||||
fail();
|
||||
}
|
||||
catch (err1) {
|
||||
}
|
||||
|
||||
var doc1 = collection.save({ a : "test2", b : 1});
|
||||
assertTrue(doc1._key !== "");
|
||||
|
||||
try {
|
||||
collection.save({ a : "test1", b : 1});
|
||||
fail();
|
||||
}
|
||||
catch (err2) {
|
||||
}
|
||||
|
||||
var doc2 = collection.save({ a : "test3", b : 1});
|
||||
assertTrue(doc2._key !== "");
|
||||
}
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue