From a36fb80466a46cb7f26596e979017245297ec711 Mon Sep 17 00:00:00 2001 From: liuneng <1398775315@qq.com> Date: Wed, 27 Mar 2024 11:32:48 +0800 Subject: [PATCH] try fix address error --- src/Analyzer/Passes/CaseWhenSimplifyPass.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Analyzer/Passes/CaseWhenSimplifyPass.cpp b/src/Analyzer/Passes/CaseWhenSimplifyPass.cpp index dfae894c9740..950ef0d25505 100644 --- a/src/Analyzer/Passes/CaseWhenSimplifyPass.cpp +++ b/src/Analyzer/Passes/CaseWhenSimplifyPass.cpp @@ -136,6 +136,8 @@ class CaseWhenSimplifyPassVisitor : public InDepthQueryTreeVisitorWithContextas(); + if (!else_node) + return; if (else_node->getValue().isNull()) { // else node is null, remove it @@ -183,6 +185,7 @@ class CaseWhenSimplifyPassVisitor : public InDepthQueryTreeVisitorWithContext equals_nodes; for (size_t pos : pos_list) { + chassert(keys[pos]); if (keys[pos]->getValue().isNull()) equals_nodes.emplace_back(createFunctionNode(is_null_function_resolver, case_column->clone())); else @@ -246,6 +249,7 @@ class CaseWhenSimplifyPassVisitor : public InDepthQueryTreeVisitorWithContextgetValue().isNull()) { column_is_not_null = true; @@ -299,7 +303,10 @@ class CaseWhenSimplifyPassVisitor : public InDepthQueryTreeVisitorWithContextgetValue()); + } } if (has_not_in) { @@ -366,7 +373,10 @@ class CaseWhenSimplifyPassVisitor : public InDepthQueryTreeVisitorWithContextgetValue()); + } } if (has_in) {