From ecd235de79e2149c3c291c7eb119ae9f2380a01c Mon Sep 17 00:00:00 2001 From: gitccl <60637740+gitccl@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:54:30 +0800 Subject: [PATCH] fix segmentation fault when meeting 'select * from t where 2 > 1' (#114) --- src/observer/sql/executor/execute_stage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/observer/sql/executor/execute_stage.cpp b/src/observer/sql/executor/execute_stage.cpp index 5484fba..a9fc784 100644 --- a/src/observer/sql/executor/execute_stage.cpp +++ b/src/observer/sql/executor/execute_stage.cpp @@ -290,6 +290,8 @@ IndexScanOperator *try_to_create_index_scan_operator(FilterStmt *filter_stmt) if (left->type() == ExprType::FIELD && right->type() == ExprType::VALUE) { } else if (left->type() == ExprType::VALUE && right->type() == ExprType::FIELD) { std::swap(left, right); + } else { + continue; } FieldExpr &left_field_expr = *(FieldExpr *)left; const Field &field = left_field_expr.field(); -- GitLab