This is an automated email from the ASF dual-hosted git repository.
morrysnow 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 80e1f1b1963 [fix](mtmv) Mv check name (#34016)
80e1f1b1963 is described below
commit 80e1f1b19639323e976bd5f6017d309403c82e80
Author: zhangdong <[email protected]>
AuthorDate: Wed Apr 24 15:20:09 2024 +0800
[fix](mtmv) Mv check name (#34016)
---
.../nereids/trees/plans/commands/info/CreateMTMVInfo.java | 5 +++++
regression-test/suites/mtmv_p0/test_build_mtmv.groovy | 15 +++++++++++++++
2 files changed, 20 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
index ce02dff2470..b56265b999a 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/CreateMTMVInfo.java
@@ -140,6 +140,11 @@ public class CreateMTMVInfo {
public void analyze(ConnectContext ctx) {
// analyze table name
mvName.analyze(ctx);
+ try {
+ FeNameFormat.checkTableName(mvName.getTbl());
+ } catch (org.apache.doris.common.AnalysisException e) {
+ throw new AnalysisException(e.getMessage(), e);
+ }
if (!Env.getCurrentEnv().getAccessManager().checkTblPriv(ctx,
mvName.getCtl(), mvName.getDb(),
mvName.getTbl(), PrivPredicate.CREATE)) {
String message =
ErrorCode.ERR_TABLEACCESS_DENIED_ERROR.formatErrorMsg("CREATE",
diff --git a/regression-test/suites/mtmv_p0/test_build_mtmv.groovy
b/regression-test/suites/mtmv_p0/test_build_mtmv.groovy
index f0bf2c4e700..5e0702db25a 100644
--- a/regression-test/suites/mtmv_p0/test_build_mtmv.groovy
+++ b/regression-test/suites/mtmv_p0/test_build_mtmv.groovy
@@ -141,6 +141,21 @@ suite("test_build_mtmv") {
DROP MATERIALIZED VIEW ${mvName}
"""
+ // check mvName
+ try {
+ sql """
+ CREATE MATERIALIZED VIEW ` `
+ BUILD DEFERRED REFRESH COMPLETE ON MANUAL
+ DISTRIBUTED BY RANDOM BUCKETS 2
+ PROPERTIES ('replication_num' = '1')
+ AS
+ SELECT * from ${tableName};
+ """
+ Assert.fail();
+ } catch (Exception e) {
+ log.info(e.getMessage())
+ }
+
// use default value
sql """
CREATE MATERIALIZED VIEW ${mvName}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]