mirror of https://gitee.com/bigwinds/arangodb
Broken client API and server default was wrong (#3748)
This commit is contained in:
parent
ecb18dfded
commit
ce537af092
|
@ -356,6 +356,11 @@ ArangoDatabase.prototype._create = function (name, properties, type, options) {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof type === 'object') {
|
||||
options = type;
|
||||
type = undefined;
|
||||
}
|
||||
|
||||
let urlAddons = [];
|
||||
if (typeof options === "object" && options !== null) {
|
||||
|
|
|
@ -374,8 +374,7 @@ function ClusterCollectionSuite () {
|
|||
/// @brief test create
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testCreateInsufficientDBServers : function () {
|
||||
|
||||
testCreateInsufficientDBServersDefault : function () {
|
||||
try {
|
||||
db._create("bigreplication", {replicationFactor: 8});
|
||||
fail();
|
||||
|
@ -386,6 +385,32 @@ function ClusterCollectionSuite () {
|
|||
db._drop('bigreplication');
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test create
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testCreateInsufficientDBServersIgnoreReplicationFactor : function () {
|
||||
// should not throw (just a warning)
|
||||
db._create("bigreplication", {replicationFactor: 8}, {enforceReplicationFactor: false});
|
||||
db._drop('bigreplication');
|
||||
},
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test create
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
testCreateInsufficientDBServersEnforceReplicationFactor : function () {
|
||||
try {
|
||||
db._create("bigreplication", {replicationFactor: 8}, {enforceReplicationFactor: true});
|
||||
fail();
|
||||
}
|
||||
catch (err) {
|
||||
assertEqual(ERRORS.ERROR_CLUSTER_INSUFFICIENT_DBSERVERS.code, err.errorNum);
|
||||
}
|
||||
db._drop('bigreplication');
|
||||
},
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief test creation / deleting of documents with replication set
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue