[fix](prepare statement) Not supported such prepared statement if prepare a forward master sql (#26512)

This commit is contained in:
meiyi
2023-11-07 19:41:44 +08:00
committed by GitHub
parent 2bb3ef1981
commit 5e9a23e643

View File

@ -531,6 +531,9 @@ public class StmtExecutor {
if (logicalPlan instanceof Forward) {
redirectStatus = ((Forward) logicalPlan).toRedirectStatus();
if (isForwardToMaster()) {
if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
throw new UserException("Forward master command is not supported for prepare statement");
}
if (isProxy) {
// This is already a stmt forwarded from other FE.
// If we goes here, means we can't find a valid Master FE(some error happens).
@ -704,6 +707,9 @@ public class StmtExecutor {
queryAnalysisSpan.end();
}
if (isForwardToMaster()) {
if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
throw new UserException("Forward master command is not supported for prepare statement");
}
if (isProxy) {
// This is already a stmt forwarded from other FE.
// If goes here, which means we can't find a valid Master FE(some error happens).