Clear query executions if not in explicit transaction (#70)

This commit is contained in:
antonio2368 2021-01-12 19:10:32 +01:00 committed by GitHub
parent 647388792a
commit 7bff678cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1175,9 +1175,6 @@ Interpreter::PrepareResult Interpreter::Prepare(
const std::string &query_string,
const std::map<std::string, storage::PropertyValue> &params) {
if (!in_explicit_transaction_) {
// TODO(antonio2368): Should this throw?
CHECK(!ActiveQueryExecutions()) << "Only one active execution allowed "
"while not in explicit transaction!";
query_executions_.clear();
}

View File

@ -416,6 +416,9 @@ std::map<std::string, TypedValue> Interpreter::Pull(TStream *result_stream,
break;
}
// As the transaction is done we can clear all the executions
// NOTE: we cannot clear query_execution inside the Abort and Commit
// methods as we will delete summary contained in them which we need
// after our query finished executing.
query_executions_.clear();
} else {
// We can only clear this execution as some of the queries