Skip to content
Snippets Groups Projects
Commit e05e3420 authored by Simon Liu's avatar Simon Liu Committed by dangleptr
Browse files

Issue #1126 graphd crashed (#1128)

Fixed an issue that encountered an unimplemented grammar that could cause a crash.
parent 759cc263
No related branches found
No related tags found
No related merge requests found
......@@ -164,11 +164,11 @@ std::unique_ptr<Executor> Executor::makeExecutor(Sentence *sentence) {
executor = std::make_unique<LimitExecutor>(sentence, ectx());
break;
case Sentence::Kind::kUnknown:
LOG(FATAL) << "Sentence kind unknown";
break;
LOG(ERROR) << "Sentence kind unknown";
return nullptr;
default:
LOG(FATAL) << "Sentence kind illegal: " << kind;
break;
LOG(ERROR) << "Sentence kind illegal: " << kind;
return nullptr;
}
return executor;
}
......
......@@ -23,7 +23,9 @@ Status SequentialExecutor::prepare() {
for (auto i = 0U; i < sentences_->sentences_.size(); i++) {
auto *sentence = sentences_->sentences_[i].get();
auto executor = makeExecutor(sentence);
DCHECK(executor != nullptr);
if (executor == nullptr) {
return Status::Error("The statement has not been implemented");
}
auto status = executor->prepare();
if (!status.ok()) {
FLOG_ERROR("Prepare executor `%s' failed: %s",
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment