add possibility to send graph, ignore it
This commit is contained in:
@@ -3739,6 +3739,13 @@ void CallCustomProcedure(const std::string_view fully_qualified_procedure_name,
|
||||
for (auto *expression : args) {
|
||||
args_list.emplace_back(expression->Accept(*evaluator));
|
||||
}
|
||||
const query::Graph *subgraph;
|
||||
if (!args_list.empty() && args_list.front().type() == TypedValue::Type::Graph) {
|
||||
subgraph = &args_list.front().ValueGraph();
|
||||
args_list.erase(args_list.begin());
|
||||
}
|
||||
|
||||
// if we have graph at first element, it is okay to have 1+ element here
|
||||
procedure::ConstructArguments(args_list, proc, fully_qualified_procedure_name, proc_args, graph);
|
||||
if (memory_limit) {
|
||||
SPDLOG_INFO("Running '{}' with memory limit of {}", fully_qualified_procedure_name,
|
||||
|
||||
@@ -577,6 +577,8 @@ struct mgp_graph {
|
||||
// `ctx` field is out of place here.
|
||||
memgraph::query::ExecutionContext *ctx;
|
||||
|
||||
// memgraph:::query::Graph *subraph;
|
||||
|
||||
static mgp_graph WritableGraph(memgraph::query::DbAccessor &acc, memgraph::storage::View view,
|
||||
memgraph::query::ExecutionContext &ctx) {
|
||||
return mgp_graph{&acc, view, &ctx};
|
||||
|
||||
@@ -235,6 +235,7 @@ void ConstructArguments(const std::vector<TypedValue> &args, const TCall &callab
|
||||
throw QueryRuntimeException("'{}' argument named '{}' at position {} must be of type {}.", fully_qualified_name,
|
||||
name, i, type->GetPresentableName());
|
||||
}
|
||||
// why do we move graph here?
|
||||
args_list.elems.emplace_back(std::move(arg), &graph);
|
||||
}
|
||||
// Fill missing optional arguments with their default values.
|
||||
|
||||
Reference in New Issue
Block a user