You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/05/26 02:27:32 UTC

[GitHub] [incubator-doris] carlvinhust2012 commented on a diff in pull request #9778: [Bug] sql block rule npe

carlvinhust2012 commented on code in PR #9778:
URL: https://github.com/apache/incubator-doris/pull/9778#discussion_r882261551


##########
regression-test/suites/sql_block_rule/test_sql_block_rule.groovy:
##########
@@ -0,0 +1,55 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_sql_block_rule", "sql_block_rule") {
+    sql """
+                USE regression_test
+              """
+
+    sql """
+                CREATE SQL_BLOCK_RULE test_rule_sql
+                PROPERTIES("sql"="SELECT \\\\* FROM table_2", "global"= "true", "enable"= "true")
+              """
+
+    test {
+        sql "SELECT * FROM table_2"
+        exception "sql match regex sql block rule: test_rule_sql"
+    }
+
+    sql """
+                DROP SQL_BLOCK_RULE test_rule_sql
+              """
+
+    sql """
+                CREATE SQL_BLOCK_RULE test_rule_num
+                PROPERTIES("tablet_num"="1", "global"= "true", "enable"= "true")
+              """
+
+    test {
+        sql "SELECT * FROM table_2"
+        exception "sql hits sql block rule: test_rule_num, reach tablet_num : 1"
+    }
+
+    qt_select """
+                SHOW SQL_BLOCK_RULE
+              """
+
+    sql """
+                DROP SQL_BLOCK_RULE test_rule_num
+              """
+

Review Comment:
   Add a normal case maybe better.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org