Skip to content

Commit

Permalink
[fix](prepare statement) Not supported such prepared statement if pre…
Browse files Browse the repository at this point in the history
…pare a forward master sql (apache#26512) (apache#26638)
  • Loading branch information
mymeiyi authored Nov 9, 2023
1 parent c355adb commit 0d83327
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,9 @@ private void executeByNereids(TUniqueId queryId) throws Exception {
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).
Expand Down Expand Up @@ -686,6 +689,9 @@ public void executeByLegacy(TUniqueId queryId) throws Exception {
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).
Expand Down

0 comments on commit 0d83327

Please sign in to comment.