pick #39245 to branch-2.1
This commit is contained in:
@ -671,6 +671,10 @@ public class StmtExecutor {
|
||||
if (logicalPlan instanceof Forward) {
|
||||
redirectStatus = ((Forward) logicalPlan).toRedirectStatus();
|
||||
if (isForwardToMaster()) {
|
||||
// before forward to master, we also need to set profileType in this node
|
||||
if (logicalPlan instanceof InsertIntoTableCommand) {
|
||||
profileType = ProfileType.LOAD;
|
||||
}
|
||||
if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
|
||||
throw new UserException("Forward master command is not supported for prepare statement");
|
||||
}
|
||||
@ -856,6 +860,13 @@ public class StmtExecutor {
|
||||
analyze(context.getSessionVariable().toThrift());
|
||||
|
||||
if (isForwardToMaster()) {
|
||||
// before forward to master, we also need to set profileType in this node
|
||||
if (parsedStmt instanceof InsertStmt) {
|
||||
InsertStmt insertStmt = (InsertStmt) parsedStmt;
|
||||
if (!insertStmt.getQueryStmt().isExplain()) {
|
||||
profileType = ProfileType.LOAD;
|
||||
}
|
||||
}
|
||||
if (context.getCommand() == MysqlCommand.COM_STMT_PREPARE) {
|
||||
throw new UserException("Forward master command is not supported for prepare statement");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user