mirror of https://gitee.com/bigwinds/arangodb
fix issue in community build
This commit is contained in:
parent
48be2caba9
commit
cda104475f
|
@ -92,6 +92,7 @@ int ShardingStrategyHashBase::getResponsibleShard(arangodb::velocypack::Slice sl
|
|||
int res = TRI_ERROR_NO_ERROR;
|
||||
usesDefaultShardKeys = _usesDefaultShardKeys;
|
||||
// calls virtual "hashByAttributes" function
|
||||
|
||||
uint64_t hash = hashByAttributes(slice, _sharding->shardKeys(), docComplete, res, key);
|
||||
// To improve our hash function result:
|
||||
hash = TRI_FnvHashBlock(hash, magicPhrase, magicLength);
|
||||
|
@ -153,9 +154,9 @@ uint64_t ShardingStrategyCommunityCompat::hashByAttributes(
|
|||
if (slice.isObject()) {
|
||||
for (auto const& attr : attributes) {
|
||||
VPackSlice sub = slice.get(attr).resolveExternal();
|
||||
VPackBuilder tempBuilder;
|
||||
if (sub.isNone()) {
|
||||
if (attr == StaticStrings::KeyString && !key.empty()) {
|
||||
VPackBuilder tempBuilder;
|
||||
tempBuilder.add(VPackValue(key));
|
||||
sub = tempBuilder.slice();
|
||||
} else {
|
||||
|
|
|
@ -323,7 +323,7 @@ ArangoCollection.prototype.removeByExample = function (example,
|
|||
var cluster = require('@arangodb/cluster');
|
||||
|
||||
var query = buildExampleQuery(this, example, limit);
|
||||
var opts = { waitForSync: waitForSync };
|
||||
var opts = { waitForSync };
|
||||
query.query += ' REMOVE doc IN @@collection OPTIONS ' + JSON.stringify(opts);
|
||||
|
||||
return require('internal').db._query(query).getExtra().stats.writesExecuted;
|
||||
|
@ -369,7 +369,7 @@ ArangoCollection.prototype.replaceByExample = function (example,
|
|||
}
|
||||
|
||||
var query = buildExampleQuery(this, example, limit);
|
||||
var opts = { waitForSync: waitForSync };
|
||||
var opts = { waitForSync };
|
||||
query.query += ' REPLACE doc WITH @newValue IN @@collection OPTIONS ' + JSON.stringify(opts);
|
||||
query.bindVars.newValue = newValue;
|
||||
|
||||
|
@ -425,7 +425,7 @@ ArangoCollection.prototype.updateByExample = function (example,
|
|||
}
|
||||
|
||||
var query = buildExampleQuery(this, example, limit);
|
||||
var opts = { waitForSync: waitForSync, keepNull: keepNull, mergeObjects: mergeObjects };
|
||||
var opts = { waitForSync, keepNull, mergeObjects };
|
||||
query.query += ' UPDATE doc WITH @newValue IN @@collection OPTIONS ' + JSON.stringify(opts);
|
||||
query.bindVars.newValue = newValue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue