Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heuristic rules that ref blingbling #127

Closed
martianzhang opened this issue Nov 25, 2018 · 7 comments
Closed

heuristic rules that ref blingbling #127

martianzhang opened this issue Nov 25, 2018 · 7 comments

Comments

@martianzhang
Copy link
Contributor

martianzhang commented Nov 25, 2018

Feature Description

Reference blingbling, SOAR should add these heuristic rules.

Use Case(s)

--rule-allow-delete-has-join            是否允许DELETE语句中使用JOIN. 默认: false
--rule-allow-delete-has-sub-clause      是否允许DELETE语句中使用子查询. 默认: false
--rule-allow-delete-many-table          是否允许同时删除多个表数据. 默认: false
--rule-allow-full-text                  是否允许使用全文索引. 默认: false
--rule-allow-update-has-join            是否允许UPDATE语句中使用JOIN. 默认: false
--rule-allow-update-has-sub-clause      是否允许UPDATE语句中使用子查询. 默认: false
--rule-collate string                   通用允许的collate, 默认(多个用逗号隔开) (default "utf8_general_ci,utf8mb4_general_ci")
--rule-insert-rows int                  每批允许 insert 的行数 (default 1000)
--rule-text-type-column-count int       允许使用text/blob字段个数. 如果在rule-not-allow-column-type相关text字段.该参数将不其作用 (default 2)
--rule-not-allow-column-type string     不允许的字段类型, 至此的类型: decimal, tinyint, smallint, int, float, double, timestamp, bigint, mediumint, date, time, datetime, year, newdate, varchar, bit, json, newdecimal, enum, set, tinyblob, mediumblob, longblob, blob, tinytext, mediumtext, longtext, text, geometry (default "tinytext,mediumtext,logtext,tinyblob,mediumblob,longblob")

Thanks to @daiguadaidai

@daiguadaidai
Copy link

not thanks me, we should thanks PingCap。ha~~~

@martianzhang
Copy link
Contributor Author

6f6f804 support --rule-insert-rows

@martianzhang
Copy link
Contributor Author

JOI.007 should be

--rule-allow-delete-many-table          是否允许同时删除多个表数据. 默认: false

@martianzhang
Copy link
Contributor Author

5eb250b

--rule-collate string                   通用允许的collate, 默认(多个用逗号隔开) (default "utf8_general_ci,utf8mb4_general_ci")

@martianzhang
Copy link
Contributor Author

a90d206

--rule-text-type-column-count int       允许使用text/blob字段个数. 如果在rule-not-allow-column-type相关text字段.该参数将不其作用 (default 2)

@martianzhang
Copy link
Contributor Author

COL.018 建表语句中使用了不推荐的字段类型

--rule-not-allow-column-type string     不允许的字段类型, 至此的类型: decimal, tinyint, smallint, int, float, double, timestamp, bigint, mediumint, date, time, datetime, year, newdate, varchar, bit, json, newdecimal, enum, set, tinyblob, mediumblob, longblob, blob, tinytext, mediumtext, longtext, text, geometry (default "tinytext,mediumtext,logtext,tinyblob,mediumblob,longblob")

@martianzhang martianzhang changed the title more and more heuristic rules heuristic rules that ref blingbling Dec 16, 2018
@martianzhang
Copy link
Contributor Author

如下启发式建议没有很好的理论支持或业内公识,暂不会在SOAR中合并。

--rule-allow-after-clause               是否允许after子句. 默认: true (default true)
--rule-allow-change-column              是否允许Alter Change子句. 默认: true (default true)
--rule-allow-insert-ignore              是否允许 INSERT IGNORE 语句. 默认: true (default true)
--rule-allow-insert-replace             是否允许 INSERT REPLACE 语句. 默认: true (default true)
--rule-allow-insert-select              是否允许 INSERT SELECT 语句. 默认: true (default true)
--rule-allow-rename-index               是否允许重命名索引. 默认: true (default true)
--rule-allow-rename-table               是否允许重命名表, 默认: true (default true)
--rule-have-column-name string          必须要的字段, 默认(多个用逗号隔开)
--rule-need-default-value-name string   必须要有默认值的字段名, 默认(多个用逗号隔开) (default "created_at,updated_at,create_time,update_time,create_at,update_at,created_time,updated_time")
--rule-need-index-column-name string    必须要有索引的字段名, 默认(多个用逗号隔开) (default "created_at,updated_at,create_time,update_time,create_at,update_at,created_time,updated_time")
--rule-not-null-column-name string      必须为not null 的索引名, 默认(多个用逗号隔开) (default "created_at,updated_at,create_time,update_time,create_at,update_at,created_time,updated_time")
--rule-not-null-column-type string      必须为not null的字段类型, 默认(多个用逗号隔开). 可填写的类型有: decimal, tinyint, smallint, int, float, double, timestamp, bigint, mediumint, date, time, datetime, year, newdate, varchar, bit, json, newdecimal, enum, set, tinyblob, mediumblob, longblob, blob, tinytext, mediumtext, longtext, text, geometry (default "varchar")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants