1
0
Fork 0

fix issue in community build

This commit is contained in:
jsteemann 2018-07-30 14:15:51 +02:00
parent 48be2caba9
commit cda104475f
2 changed files with 5 additions and 4 deletions

View File

@ -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 {

View File

@ -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;