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;
|
int res = TRI_ERROR_NO_ERROR;
|
||||||
usesDefaultShardKeys = _usesDefaultShardKeys;
|
usesDefaultShardKeys = _usesDefaultShardKeys;
|
||||||
// calls virtual "hashByAttributes" function
|
// calls virtual "hashByAttributes" function
|
||||||
|
|
||||||
uint64_t hash = hashByAttributes(slice, _sharding->shardKeys(), docComplete, res, key);
|
uint64_t hash = hashByAttributes(slice, _sharding->shardKeys(), docComplete, res, key);
|
||||||
// To improve our hash function result:
|
// To improve our hash function result:
|
||||||
hash = TRI_FnvHashBlock(hash, magicPhrase, magicLength);
|
hash = TRI_FnvHashBlock(hash, magicPhrase, magicLength);
|
||||||
|
@ -153,9 +154,9 @@ uint64_t ShardingStrategyCommunityCompat::hashByAttributes(
|
||||||
if (slice.isObject()) {
|
if (slice.isObject()) {
|
||||||
for (auto const& attr : attributes) {
|
for (auto const& attr : attributes) {
|
||||||
VPackSlice sub = slice.get(attr).resolveExternal();
|
VPackSlice sub = slice.get(attr).resolveExternal();
|
||||||
|
VPackBuilder tempBuilder;
|
||||||
if (sub.isNone()) {
|
if (sub.isNone()) {
|
||||||
if (attr == StaticStrings::KeyString && !key.empty()) {
|
if (attr == StaticStrings::KeyString && !key.empty()) {
|
||||||
VPackBuilder tempBuilder;
|
|
||||||
tempBuilder.add(VPackValue(key));
|
tempBuilder.add(VPackValue(key));
|
||||||
sub = tempBuilder.slice();
|
sub = tempBuilder.slice();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -323,7 +323,7 @@ ArangoCollection.prototype.removeByExample = function (example,
|
||||||
var cluster = require('@arangodb/cluster');
|
var cluster = require('@arangodb/cluster');
|
||||||
|
|
||||||
var query = buildExampleQuery(this, example, limit);
|
var query = buildExampleQuery(this, example, limit);
|
||||||
var opts = { waitForSync: waitForSync };
|
var opts = { waitForSync };
|
||||||
query.query += ' REMOVE doc IN @@collection OPTIONS ' + JSON.stringify(opts);
|
query.query += ' REMOVE doc IN @@collection OPTIONS ' + JSON.stringify(opts);
|
||||||
|
|
||||||
return require('internal').db._query(query).getExtra().stats.writesExecuted;
|
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 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.query += ' REPLACE doc WITH @newValue IN @@collection OPTIONS ' + JSON.stringify(opts);
|
||||||
query.bindVars.newValue = newValue;
|
query.bindVars.newValue = newValue;
|
||||||
|
|
||||||
|
@ -425,7 +425,7 @@ ArangoCollection.prototype.updateByExample = function (example,
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = buildExampleQuery(this, example, limit);
|
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.query += ' UPDATE doc WITH @newValue IN @@collection OPTIONS ' + JSON.stringify(opts);
|
||||||
query.bindVars.newValue = newValue;
|
query.bindVars.newValue = newValue;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue