This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new e41bfd8149 [Bug] Update Stmt Fail use in predicate query (#11414)
e41bfd8149 is described below
commit e41bfd8149e3c7896042d0179b818770bf6b2067
Author: HappenLee <[email protected]>
AuthorDate: Tue Aug 2 15:14:36 2022 +0800
[Bug] Update Stmt Fail use in predicate query (#11414)
Co-authored-by: lihaopeng <[email protected]>
---
fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java | 2 +-
regression-test/data/update/test_update_unique.out | 4 ++--
regression-test/suites/update/test_update_unique.groovy | 1 +
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
b/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
index 3a2fbcffb7..23b182f9df 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/UpdateStmt.java
@@ -198,8 +198,8 @@ public class UpdateStmt extends DdlStmt {
if (whereExpr == null) {
throw new AnalysisException("Where clause is required");
}
- whereExpr = analyzer.getExprRewriter().rewrite(whereExpr, analyzer,
ExprRewriter.ClauseType.WHERE_CLAUSE);
whereExpr.analyze(analyzer);
+ whereExpr = analyzer.getExprRewriter().rewrite(whereExpr, analyzer,
ExprRewriter.ClauseType.WHERE_CLAUSE);
if (!whereExpr.getType().equals(Type.BOOLEAN)) {
throw new AnalysisException("Where clause is not a valid statement
return bool");
}
diff --git a/regression-test/data/update/test_update_unique.out
b/regression-test/data/update/test_update_unique.out
index dbe9d2d25f..6df338a346 100644
--- a/regression-test/data/update/test_update_unique.out
+++ b/regression-test/data/update/test_update_unique.out
@@ -1,7 +1,7 @@
-- This file is automatically generated. You should know what you did if you
want to edit this
-- !select_uniq_table --
-1 2 1 2000-01-01
-2 2 1 2000-01-01
+1 2 1 1999-01-01
+2 2 1 1999-01-01
-- !desc_uniq_table --
k INT Yes true \N
diff --git a/regression-test/suites/update/test_update_unique.groovy
b/regression-test/suites/update/test_update_unique.groovy
index df0b2bc186..b695572d5d 100644
--- a/regression-test/suites/update/test_update_unique.groovy
+++ b/regression-test/suites/update/test_update_unique.groovy
@@ -32,6 +32,7 @@ suite("test_update_unique", "update") {
sql "insert into ${tbName} values(2, 1, 1, '2000-01-01');"
sql "UPDATE ${tbName} SET value1 = 2 WHERE k=1;"
sql "UPDATE ${tbName} SET value1 = value1+1 WHERE k=2;"
+ sql "UPDATE ${tbName} SET date_value = '1999-01-01' WHERE k in (1,2);"
qt_select_uniq_table "select * from ${tbName} order by k"
qt_desc_uniq_table "desc ${tbName}"
sql "DROP TABLE ${tbName}"
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]