mirror of https://gitee.com/bigwinds/arangodb
pass "isModificationQuery" around in cluster
This commit is contained in:
parent
bc87837778
commit
56e03af4c4
|
@ -406,6 +406,7 @@ void ExecutionPlan::toVelocyPack(VPackBuilder& builder, Ast* ast,
|
||||||
builder.add("estimatedCost", VPackValue(_root->getCost(nrItems)));
|
builder.add("estimatedCost", VPackValue(_root->getCost(nrItems)));
|
||||||
builder.add("estimatedNrItems", VPackValue(nrItems));
|
builder.add("estimatedNrItems", VPackValue(nrItems));
|
||||||
builder.add("initialize", VPackValue(_isResponsibleForInitialize));
|
builder.add("initialize", VPackValue(_isResponsibleForInitialize));
|
||||||
|
builder.add("isModificationQuery", VPackValue(ast->query()->isModificationQuery()));
|
||||||
|
|
||||||
builder.close();
|
builder.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,6 +199,12 @@ Query::Query(
|
||||||
<< "options: " << options->slice().toJson();
|
<< "options: " << options->slice().toJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// adjust the _isModificationQuery value from the slice we got
|
||||||
|
auto s = _queryBuilder->slice().get("isModificationQuery");
|
||||||
|
if (s.isBoolean()) {
|
||||||
|
_isModificationQuery = s.getBoolean();
|
||||||
|
}
|
||||||
|
|
||||||
_resourceMonitor.setMemoryLimit(_queryOptions.memoryLimit);
|
_resourceMonitor.setMemoryLimit(_queryOptions.memoryLimit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,6 +242,10 @@ Query* Query::clone(QueryPart part, bool withPlan) {
|
||||||
clone->_resourceMonitor = _resourceMonitor;
|
clone->_resourceMonitor = _resourceMonitor;
|
||||||
clone->_resourceMonitor.clear();
|
clone->_resourceMonitor.clear();
|
||||||
|
|
||||||
|
if (_isModificationQuery) {
|
||||||
|
clone->setIsModificationQuery();
|
||||||
|
}
|
||||||
|
|
||||||
if (_plan != nullptr) {
|
if (_plan != nullptr) {
|
||||||
if (withPlan) {
|
if (withPlan) {
|
||||||
// clone the existing plan
|
// clone the existing plan
|
||||||
|
|
|
@ -225,6 +225,9 @@ class Query {
|
||||||
/// @brief get the plan for the query
|
/// @brief get the plan for the query
|
||||||
ExecutionPlan* plan() const { return _plan.get(); }
|
ExecutionPlan* plan() const { return _plan.get(); }
|
||||||
|
|
||||||
|
/// @brief whether or not a query is a modification query
|
||||||
|
bool isModificationQuery() const { return _isModificationQuery; }
|
||||||
|
|
||||||
/// @brief mark a query as modification query
|
/// @brief mark a query as modification query
|
||||||
void setIsModificationQuery() { _isModificationQuery = true; }
|
void setIsModificationQuery() { _isModificationQuery = true; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue