This function is only used to limit the query statement, and does not limit the execution of the explain statement. Support SQL block rule by user level:
by regex way to deny specify SQL
by setting partition_num, tablet_num, cardinality, check whether a sql reaches one of the limitations
SQL block rule CRUD
CREATE SQL_BLOCK_RULE test_rule PROPERTIES( "sql"="select * from order_analysis", "global"="false", "enable"="true", "sqlHash"="" )
When we execute the sql that we defined in the rule just now, an exception error will be returned. An example is as follows:
mysql> select * from order_analysis; ERROR 1064 (HY000): errCode = 2, detailMessage = sql match regex sql block rule: order_analysis_rule
CREATE SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "30", "cardinality"="10000000000","global"="false","enable"="true")
SHOW SQL_BLOCK_RULE [FOR RULE_NAME]
ALTER SQL_BLOCK_RULE test_rule PROPERTIES("sql"="select \\* from test_table","enable"="true")
ALTER SQL_BLOCK_RULE test_rule2 PROPERTIES("partition_num" = "10","tablet_num"="300","enable"="true")
,
,Please see the specific grammarDROP SQL BLOCK RULRDROP SQL_BLOCK_RULE test_rule1,test_rule2
If global=false is configured, the rules binding for the specified user needs to be configured, with multiple rules separated by ', '
SET PROPERTY [FOR 'jack'] 'sql_block_rules' = 'test_rule1,test_rule2'