pingcap / parser

A MySQL Compatible SQL Parser
Apache License 2.0
1.41k stars 489 forks source link

parser: support SQL bind capture filter syntax #1274

Closed eurekaka closed 3 years ago

eurekaka commented 3 years ago

What problem does this PR solve?

Parser changes for https://github.com/pingcap/tidb/issues/15655

What is changed and how it works?

Add new syntax for baseline capture filter.

Check List

Tests

Code changes

Side effects

N/A

Related changes

tangenta commented 3 years ago

NOT IGNORE sounds counter-intuitive... Can we use ADD/REMOVE instead?

admin capture bindings remove table t1;
admin capture bindings remove table test.t1;
admin capture bindings add table t1;
admin capture bindings add table test.t1;
admin capture bindings remove database db1;
admin capture bindings add database db1;
admin capture bindings show;
eurekaka commented 3 years ago

NOT IGNORE sounds counter-intuitive... Can we use ADD/REMOVE instead?

admin capture bindings remove table t1;
admin capture bindings remove table test.t1;
admin capture bindings add table t1;
admin capture bindings add table test.t1;
admin capture bindings remove database db1;
admin capture bindings add database db1;
admin capture bindings show;

The capture filter is acting as a blacklist, so we need a negative keyword. The not ignore is to remove the item from the blacklist. If we use add / remove, users may think that only the added items are considered for baseline capture.

tangenta commented 3 years ago

Ok. Another question: is it possible to use a system table to represent the blacklist(like mysql.expr_pushdown_blacklist)? One of the advantages is that we can use INSERT/DELETE/SELECT to show the list, which is easier to learn.

eurekaka commented 3 years ago

Ok. Another question: is it possible to use a system table to represent the blacklist(like mysql.expr_pushdown_blacklist)? One of the advantages is that we can use INSERT/DELETE/SELECT to show the list, which is easier to learn.

Alright.