This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push: new e23c1339a8f [fix](group commit) Fix prepare stmt setNull return too many filtered rows error (#38262) (#38276) e23c1339a8f is described below commit e23c1339a8f24f22fd7173eca05db94af94991ca Author: meiyi <myime...@gmail.com> AuthorDate: Wed Jul 24 19:02:59 2024 +0800 [fix](group commit) Fix prepare stmt setNull return too many filtered rows error (#38262) (#38276) Pick https://github.com/apache/doris/pull/38262 --- .../src/main/java/org/apache/doris/qe/StmtExecutor.java | 4 ++++ .../insert_p0/insert_group_commit_with_prepare_stmt.out | 16 ++++++++-------- .../insert_group_commit_with_prepare_stmt.groovy | 4 ---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java index 3c74017c1ba..51d23fe908a 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java +++ b/fe/fe-core/src/main/java/org/apache/doris/qe/StmtExecutor.java @@ -47,6 +47,7 @@ import org.apache.doris.analysis.NativeInsertStmt; import org.apache.doris.analysis.NullLiteral; import org.apache.doris.analysis.OutFileClause; import org.apache.doris.analysis.PartitionNames; +import org.apache.doris.analysis.PlaceHolderExpr; import org.apache.doris.analysis.PrepareStmt; import org.apache.doris.analysis.PrepareStmt.PreparedType; import org.apache.doris.analysis.Queriable; @@ -334,6 +335,9 @@ public class StmtExecutor { } InternalService.PDataRow.Builder row = InternalService.PDataRow.newBuilder(); for (Expr expr : cols) { + if (expr instanceof PlaceHolderExpr) { + expr = ((PlaceHolderExpr) expr).getLiteral(); + } if (!expr.isLiteralOrCastExpr()) { throw new UserException( "do not support non-literal expr in transactional insert operation: " + expr.toSql()); diff --git a/regression-test/data/insert_p0/insert_group_commit_with_prepare_stmt.out b/regression-test/data/insert_p0/insert_group_commit_with_prepare_stmt.out index b13dfb13cff..5baa12fb3a1 100644 --- a/regression-test/data/insert_p0/insert_group_commit_with_prepare_stmt.out +++ b/regression-test/data/insert_p0/insert_group_commit_with_prepare_stmt.out @@ -1,25 +1,25 @@ -- This file is automatically generated. You should know what you did if you want to edit this -- !sql -- 1 a 10 -2 NULL 20 +2 \N 20 3 c \N 4 d 40 5 e \N 6 f 40 -- !sql -- -2 NULL 20 +2 \N 20 3 c \N 4 d 40 5 e \N 6 f 40 7 e -1 -8 NULL -1 +8 \N -1 -- !sql -- 1 a 10 -2 NULL 20 -2 NULL 20 +2 \N 20 +2 \N 20 3 c \N 3 c \N 4 d 40 @@ -31,8 +31,8 @@ -- !sql -- 1 a -1 1 a 10 -2 NULL 20 -2 NULL 20 +2 \N 20 +2 \N 20 3 c \N 3 c \N 4 d 40 @@ -41,5 +41,5 @@ 5 e \N 6 f 40 7 e -1 -8 NULL -1 +8 \N -1 diff --git a/regression-test/suites/insert_p0/insert_group_commit_with_prepare_stmt.groovy b/regression-test/suites/insert_p0/insert_group_commit_with_prepare_stmt.groovy index e686b752db5..6e05513a8d6 100644 --- a/regression-test/suites/insert_p0/insert_group_commit_with_prepare_stmt.groovy +++ b/regression-test/suites/insert_p0/insert_group_commit_with_prepare_stmt.groovy @@ -148,8 +148,6 @@ suite("insert_group_commit_with_prepare_stmt") { ); """ - sql """ set enable_insert_strict = false; """ - // 1. insert into def insert_stmt = prepareStatement """ INSERT INTO ${table} VALUES(?, ?, ?) """ assertEquals(com.mysql.cj.jdbc.ServerPreparedStatement, insert_stmt.class) @@ -212,8 +210,6 @@ suite("insert_group_commit_with_prepare_stmt") { ); """ - sql """ set enable_insert_strict = false; """ - // 1. insert into def insert_stmt = prepareStatement """ INSERT INTO ${table} VALUES(?, ?, ?) """ assertEquals(com.mysql.cj.jdbc.ServerPreparedStatement, insert_stmt.class) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org