From 587d2768bf7680d18bf4dcf79ea693723b4a67f9 Mon Sep 17 00:00:00 2001 From: adofsauron Date: Thu, 27 Apr 2023 18:49:51 +0800 Subject: [PATCH] fix(tianmu): fix mysqld crash when query where JOIN::propagate_dependencies (#1628) --- storage/tianmu/core/query_compile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/storage/tianmu/core/query_compile.cpp b/storage/tianmu/core/query_compile.cpp index 859df32d7..22c95f251 100644 --- a/storage/tianmu/core/query_compile.cpp +++ b/storage/tianmu/core/query_compile.cpp @@ -1137,7 +1137,9 @@ QueryRouteTo Query::Compile(CompiledQuery *compiled_query, SELECT_LEX *selects_l List_iterator_fast li(*fields); for (Item *item = li++; item; item = li++) { if ((item->type() == Item::Type::FUNC_ITEM) && - (down_cast(item)->functype() == Item_func::Functype::FUNC_SP) && (!sl->is_distinct())) { + ((down_cast(item)->functype() == Item_func::Functype::FUNC_SP) || + (down_cast(item)->functype() == Item_func::Functype::SUSERVAR_FUNC)) && + (!sl->is_distinct())) { sl->add_active_options(SELECT_DISTINCT); sl->join->select_distinct = TRUE; use_tmp_when_no_join = true;