branch-2.1: [fix](fe) multi statements different behavior in master and follower (#52144) (#52632)

pick https://github.com/apache/doris/pull/52144
This commit is contained in:
meiyi
2025-07-03 14:53:19 +08:00
committed by GitHub
parent 6404277795
commit b0e83ca7d1
3 changed files with 35 additions and 1 deletions

View File

@ -384,7 +384,9 @@ public abstract class ConnectProcessor {
auditAfterExec(auditStmt, executor.getParsedStmt(), executor.getQueryStatisticsForAuditLog(),
true);
// execute failed, skip remaining stmts
if (ctx.getState().getStateType() == MysqlStateType.ERR) {
if (ctx.getState().getStateType() == MysqlStateType.ERR || (!Env.getCurrentEnv().isMaster()
&& ctx.executor != null && ctx.executor.isForwardToMaster()
&& ctx.executor.getProxyStatusCode() != 0)) {
break;
}
} catch (Throwable throwable) {

View File

@ -202,3 +202,9 @@
44980 113.8777 again 1987-04-09 2010-01-02T04:03:06 false -0.01 0E-10
44980 113.8777 again 1987-04-09 2010-01-02T04:03:06 false -0.01 0E-10
-- !select1 --
1994-12-08 1 1
1994-12-14 1 1
1994-12-14 2 1
2000-12-08 1 1

View File

@ -112,4 +112,30 @@ suite("insert") {
b as (select * from a)
select id from a;
"""
sql """
DROP TABLE IF EXISTS source;
CREATE TABLE source (
l_shipdate DATE NOT NULL,
l_orderkey bigint NOT NULL,
l_linenumber int not null
)ENGINE=OLAP
DUPLICATE KEY(`l_shipdate`, `l_orderkey`)
COMMENT "OLAP"
DISTRIBUTED BY HASH(`l_orderkey`) BUCKETS 96
PROPERTIES (
"replication_num" = "1"
);
insert into source values('1994-12-08', 1,1) , ('1994-12-14',1,1), ('1994-12-14',2,1);
"""
try {
sql """ insert into source values('2000-12-08', 1, 1);
insert into source values('2000-12-09', 1, 1, 100);
insert into source values('2000-12-10', 1, 1); """
} catch (Exception e) {
logger.info("exception: " + e.getMessage())
}
order_qt_select1 """ select * from source; """
}