From 6087b61e3bc14b24ffa98ec0ae1b2b1a5a8cc27d Mon Sep 17 00:00:00 2001 From: David Hall Date: Mon, 20 Apr 2020 17:20:26 -0500 Subject: [PATCH] MCOL-3757 Test for LIMIT in correlated subqueries The if() had been changed to something that didn't work. Changed it back --- dbcon/mysql/ha_mcs_execplan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index ecb2ff2bc..bb306c34e 100755 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -7993,7 +7993,8 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, } // We don't currently support limit with correlated subquery - if (gwi.subQuery && !gwi.correlatedTbNameVec.empty() && csep->hasOrderBy()) + if (csep->limitNum() != (uint64_t) - 1 && + gwi.subQuery && !gwi.correlatedTbNameVec.empty()) { gwi.fatalParseError = true; gwi.parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_NON_SUPPORT_LIMIT_SUB);