Skip to content

Commit 0d83327

Browse files
authored
[fix](prepare statement) Not supported such prepared statement if prepare a forward master sql (apache#26512) (apache#26638)
1 parent c355adb commit 0d83327

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,9 @@ private void executeByNereids(TUniqueId queryId) throws Exception {
519519
if (logicalPlan instanceof Forward) {
520520
redirectStatus = ((Forward) logicalPlan).toRedirectStatus();
521521
if (isForwardToMaster()) {
522+
if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
523+
throw new UserException("Forward master command is not supported for prepare statement");
524+
}
522525
if (isProxy) {
523526
// This is already a stmt forwarded from other FE.
524527
// If we goes here, means we can't find a valid Master FE(some error happens).
@@ -686,6 +689,9 @@ public void executeByLegacy(TUniqueId queryId) throws Exception {
686689
queryAnalysisSpan.end();
687690
}
688691
if (isForwardToMaster()) {
692+
if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
693+
throw new UserException("Forward master command is not supported for prepare statement");
694+
}
689695
if (isProxy) {
690696
// This is already a stmt forwarded from other FE.
691697
// If goes here, which means we can't find a valid Master FE(some error happens).

0 commit comments

Comments
 (0)