add tests

This commit is contained in:
Timofey Turenko
2017-05-17 18:16:06 +03:00
committed by Markus Mäkelä
parent dbfd631fed
commit 8c6ca38a8a
594 changed files with 48376 additions and 0 deletions

View File

@ -0,0 +1 @@
select * from mysql.user;

View File

@ -0,0 +1,4 @@
load data infile;
LOAD data infile;
LOAD DATA infile;
LOAD DATA INFILE;

View File

@ -0,0 +1,3 @@
SELECT sum(x1) FROM t1;
SELECT concat(x1,sum(x1)) FROM t1;
SELECT concat(sum(x1),avg(x1)) FROM t1;

View File

@ -0,0 +1 @@
select * from mysql.user;

View File

@ -0,0 +1,3 @@
update t1 set x1=1 where fl=0;
SELECT x1 FROM t1;
select t1.x1 as 'something' from t1 as t1 limit 1;

View File

@ -0,0 +1 @@
SELECT x1 FROM t1;

View File

@ -0,0 +1,3 @@
DELETE FROM t1;
SELECT fl FROM t1;
UPDATE t1 SET f1=1;

View File

@ -0,0 +1 @@
SELECT fl FROM t1;

View File

@ -0,0 +1 @@
UPDATE t1 SET fl=1;

View File

@ -0,0 +1 @@
SELECT fl FROM t1 WHERE fl = 0 AND x1 = 1 OR x1=2

View File

@ -0,0 +1,3 @@
UPDATE t1 SET x1=1 where fl=0;
SELECT x1 FROM t1;
SELECT * FROM t1;

View File

@ -0,0 +1,6 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
select sleep(5);
delete from t1 where x1 like '_';
select user from mysql.user;
SELECT COUNT( * )

View File

@ -0,0 +1 @@
SELECT 1;

View File

@ -0,0 +1,3 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
SELECT fl FROM t1;

View File

@ -0,0 +1,2 @@
select user from mysql.user;
delete from t1 where x1 like '_';

View File

@ -0,0 +1,6 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
select sleep(5);
SELECT fl FROM t1;
SELECT * FROM t1;
select t1.fl as 'something' from t1 as t1 limit 1;

View File

@ -0,0 +1,6 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
select sleep(5);
delete from t1 where x1=0;
SELECT fl FROM t1;
SELECT * FROM t1;

View File

@ -0,0 +1,5 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 INT, fl INT);
DELETE FROM t1 WHERE x1=0;
SELECT fl FROM t1 WHERE x1=0;
UPDATE t1 SET fl=1 WHERE x1=0;

View File

@ -0,0 +1,5 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
delete from t1;
UPDATE t1 SET fl=1;
SELECT fl FROM t1 where x1=0;

View File

@ -0,0 +1,6 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
select sleep(5);
delete from t1;
SELECT fl FROM t1;
UPDATE t1 SET fl=1 WHERE x1=0;

View File

@ -0,0 +1 @@
SELECT fl FROM t1 WHERE fl = 0 AND x1 = 1 ;

View File

@ -0,0 +1,4 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (x1 int, fl int);
select sleep(5);
SELECT fl FROM t1;

View File

@ -0,0 +1,2 @@
rule test1 deny wildcard
users %@% match all rules test1

View File

@ -0,0 +1,3 @@
rule regex_rule deny regex '^(?i)load.*data.*infile*'
rule files2 deny regex '^(?i)load.data.*local.*infile'
users %@% match any rules regex_rule

View File

@ -0,0 +1,2 @@
rule no_func deny functions sum avg
users %@% match any rules no_func

View File

@ -0,0 +1,2 @@
rule test2 deny wildcard on_queries select
users %@% match all rules test2

View File

@ -0,0 +1,2 @@
rule test3 deny columns x1
users %@% match all rules test3

View File

@ -0,0 +1,2 @@
rule test4 deny columns x1 on_queries select
users %@% match all rules test4

View File

@ -0,0 +1,2 @@
rule test7 deny no_where_clause on_queries select|delete|update
users %@% match all rules test7

View File

@ -0,0 +1,2 @@
rule test9 deny no_where_clause on_queries select
users %@% match all rules test9

View File

@ -0,0 +1,2 @@
rule test11 deny no_where_clause on_queries update
users %@% match all rules test11

View File

@ -0,0 +1,2 @@
rule test12 deny regex ".*FROM.*t1.*WHERE.*OR.*" on_queries select
users %@% match all rules test12

View File

@ -0,0 +1,3 @@
rule no_wildcard deny wildcard
rule no_x1 deny columns x1
users %@% match any rules no_wildcard no_x1

View File

@ -0,0 +1,2 @@
rule r1 deny regex 'select'
users %@% match any rules r1

View File

@ -0,0 +1,2 @@
rule testrule deny no_where_clause at_times ###time### on_queries delete
users skysql@% match strict_all rules testrule

View File

@ -0,0 +1,2 @@
rule testrule deny limit_queries 10 7 5
users skysql@% match strict_all rules testrule

View File

@ -0,0 +1,2 @@
rule r1 deny regex 'select.*1'
users %@% match any rules r1

View File

@ -0,0 +1,2 @@
rule test1 deny wildcard1
users %@% match all rules test1