Combine redundant dbfwfilter tests

The fwf test now only tests the functionality of the rules themselves, not
the parsing. The fwf_syntax test handles the testing of the parser. The
fwf2 test was removed as it was almost identical with the original fwf
test.
This commit is contained in:
Markus Mäkelä
2017-09-19 14:10:19 +03:00
parent 773bae1615
commit 049eb68254
19 changed files with 24 additions and 161 deletions

View File

@ -0,0 +1,3 @@
drop table if exists t1;
create table t1(id int);
alter table t1 add column b int;

View File

@ -0,0 +1,2 @@
grant select on *.* to 'skysql'@'localhost';
revoke select on *.* from 'skysql'@'localhost';

View File

@ -0,0 +1,2 @@
use test;
load data local infile 'test.csv' into table test.t1;

View File

@ -0,0 +1,12 @@
select sum(1) from test.t1;
select avg(1) from test.t1;
select sum(avg(1)) from test.t1;
select my_function(1) from test.t1;
select my_function("1") from test.t1;
select * from test.t1 where 1 = 1;
select * from test.t1 where 1 >= 1;
select * from test.t1 where 1 <= 1;
select * from test.t1 where 1 != 1;
select * from test.t1 where 1 <> 1;
select function(*) from test.t1;
select insert(*) from test.t1;

View File

@ -0,0 +1 @@
select 1;

View File

@ -0,0 +1,3 @@
select * from mysql.user;
use mysql;
set @var = 1;

View File

@ -0,0 +1,3 @@
select * from mysql.user;
use mysql;
set @var = 1;

View File

@ -0,0 +1,2 @@
select * from mysql.user;
set @var = 1;

View File

@ -0,0 +1,8 @@
drop table if exists test.t1;
create table test.t1(id int);
drop function if exists my_function;
create function my_function (arg int) returns int deterministic return arg * arg;
select "sum(1)";
select (1);
select * from(select 1) as a;
insert into test.t1 values (1);

View File

@ -0,0 +1,2 @@
drop table if exists t1;
create table t1 (id int);

View File

@ -0,0 +1,4 @@
rule test1 deny regex '.*' on_queries drop
rule test2 deny regex '.*' on_queries create
rule test3 deny regex '.*' on_queries alter
users %@% match any rules test1 test2 test3

View File

@ -0,0 +1,3 @@
rule test1 deny regex '.*' on_queries grant
rule test2 deny regex '.*' on_queries revoke
users %@% match any rules test1 test2

View File

@ -0,0 +1,3 @@
rule test1 deny regex '.*' on_queries use
rule test2 deny regex '.*' on_queries load
users %@% match any rules test1 test2

View File

@ -0,0 +1,5 @@
rule test1 deny function sum avg on_queries select
rule test2 deny function my_function on_queries select
rule test3 deny function = >= <= != <> on_queries select
rule test4 deny function `function` `insert`
users %@% match any rules test1 test2 test3 test4

View File

@ -0,0 +1,2 @@
rule no_selects deny on_queries select
users %@% match any rules no_selects