From 969201f3a896cd1a487d7958453e651c3d10f544 Mon Sep 17 00:00:00 2001 From: leijsen <20215135@stud.tjut.edu.cn> Date: Tue, 9 Jul 2024 09:11:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E5=8F=A5=E5=92=8CIN=E6=83=85=E5=86=B5?= =?UTF-8?q?=E7=9A=84is=5Frhs=5Fval=E3=80=81is=5FIN=E7=9A=84=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/analyze/analyze.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/analyze/analyze.cpp b/src/analyze/analyze.cpp index 1093126..076e6aa 100644 --- a/src/analyze/analyze.cpp +++ b/src/analyze/analyze.cpp @@ -184,13 +184,12 @@ void Analyze::get_clause(const std::vector<std::shared_ptr<ast::BinaryExpr>> &sv } else if (auto rhs_select = std::dynamic_pointer_cast<ast::SelectStmt>(expr->select_stmt)) { cond.is_subquery = true; + cond.is_rhs_val = true; Context *context = context; auto res = sub_query_execute(rhs_select, context); // åˆ¤æ–æ˜¯ä¸æ˜¯IN if (cond.op == OP_IN) { cond.is_In = true; - } - else { cond.is_rhs_val = true; } if (res.size() > 1 && !cond.is_In) { @@ -209,7 +208,7 @@ void Analyze::get_clause(const std::vector<std::shared_ptr<ast::BinaryExpr>> &sv // 判æ–id in (1, 2)的情况 else if (auto rhs_list = std::make_shared<std::vector<std::shared_ptr<ast::Value>>>(expr->vals)) { cond.is_In = true; - cond.is_rhs_val = false; + cond.is_rhs_val = true; cond.is_subquery = false; for (auto &val : *rhs_list) { cond.rhs_vals.push_back(convert_sv_value(val)); -- GitLab