From e7bc7e931300c3b2d9910e89dada1d33e63c6b47 Mon Sep 17 00:00:00 2001 From: David Hall Date: Thu, 9 Apr 2020 15:30:44 -0500 Subject: [PATCH] MCOL-3924 Use the first parse error found Often, after an error is found, it cascades into a bunch of errors, and each overwrites the previous. This sometimes obfuscates the true problem. --- dbcon/mysql/ha_mcs_execplan.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dbcon/mysql/ha_mcs_execplan.cpp b/dbcon/mysql/ha_mcs_execplan.cpp index 6a40e4992..150c3b427 100755 --- a/dbcon/mysql/ha_mcs_execplan.cpp +++ b/dbcon/mysql/ha_mcs_execplan.cpp @@ -6883,7 +6883,7 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, return -1; } } - else + else if ( !gwi.fatalParseError ) { Message::Args args; args.add(ifp->func_name()); @@ -7478,14 +7478,15 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, if (nonSupportItem) { - Message::Args args; - - if (nonSupportItem->name.length) - args.add("'" + string(nonSupportItem->name.str) + "'"); - else - args.add(""); - - gwi.parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_NON_SUPPORT_GROUP_BY, args); + if (gwi.parseErrorText.length() == 0) + { + Message::Args args; + if (nonSupportItem->name.length) + args.add("'" + string(nonSupportItem->name.str) + "'"); + else + args.add(""); + gwi.parseErrorText = IDBErrorInfo::instance()->errorMsg(ERR_NON_SUPPORT_GROUP_BY, args); + } setError(gwi.thd, ER_CHECK_NOT_IMPLEMENTED, gwi.parseErrorText, gwi); return ER_CHECK_NOT_IMPLEMENTED; }