Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
  • Loading branch information
jackysp committed Jan 13, 2022
1 parent c871db2 commit 01ad77d
Showing 1 changed file with 71 additions and 71 deletions.
142 changes: 71 additions & 71 deletions plugin/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,14 @@ func TestAuditLogNormal(t *testing.T) {
sql: "DROP SESSION BINDING FOR SELECT * FROM t1 WHERE a = 123",
stmtType: "DropBinding",
},
//{
// {
// sql: "LOAD STATS '/tmp/stats.json'",
// stmtType: "other",
//},
//{
// },
// {
// sql: "DROP STATS t",
// stmtType: "other",
//},
// },
{
sql: "RENAME TABLE t2 TO t5",
stmtType: "other",
Expand All @@ -209,18 +209,18 @@ func TestAuditLogNormal(t *testing.T) {
dbs: "test",
tables: "t1",
},
//{
// {
// sql: "FLASHBACK TABLE t TO t1",
// stmtType: "other",
// dbs: "test",
// tables: "t1",
//},
//{
// },
// {
// sql: "RECOVER TABLE t1",
// stmtType: "other",
// dbs: "test",
// tables: "t1,t2",
//},
// },
{
sql: "ALTER DATABASE test DEFAULT CHARACTER SET = utf8mb4",
stmtType: "other",
Expand All @@ -230,20 +230,20 @@ func TestAuditLogNormal(t *testing.T) {
sql: "ADMIN RELOAD opt_rule_blacklist",
stmtType: "other",
},
//{
// {
// sql: "ADMIN PLUGINS ENABLE audit_test",
// stmtType: "other",
//},
// },
{
sql: "ADMIN FLUSH bindings",
stmtType: "other",
},
//{
// {
// sql: "ADMIN REPAIR TABLE t1 CREATE TABLE (id int)",
// stmtType: "other",
// dbs: "test",
// tables: "t1",
//},
// },
{
sql: "ADMIN SHOW SLOW RECENT 10",
stmtType: "other",
Expand All @@ -252,27 +252,27 @@ func TestAuditLogNormal(t *testing.T) {
sql: "ADMIN SHOW DDL JOBS",
stmtType: "other",
},
//{
// {
// sql: "ADMIN CANCEL DDL JOBS 1",
// stmtType: "other",
//},
// },
{
sql: "ADMIN CHECKSUM TABLE t1",
stmtType: "other",
//dbs: "test",
//tables: "t1",
// dbs: "test",
// tables: "t1",
},
{
sql: "ADMIN CHECK TABLE t1",
stmtType: "other",
//dbs: "test",
//tables: "t1",
// dbs: "test",
// tables: "t1",
},
{
sql: "ADMIN CHECK INDEX t1 a",
stmtType: "other",
//dbs: "test",
//tables: "t1",
// dbs: "test",
// tables: "t1",
},
{
sql: "CREATE USER 'newuser' IDENTIFIED BY 'newuserpassword'",
Expand Down Expand Up @@ -316,10 +316,10 @@ func TestAuditLogNormal(t *testing.T) {
sql: "SET PASSWORD FOR 'newuser' = 'test'",
stmtType: "Set",
},
//{
// {
// sql: "SET ROLE ALL",
// stmtType: "other",
//},
// },
{
sql: "DROP USER 'newuser'",
stmtType: "other",
Expand All @@ -333,26 +333,26 @@ func TestAuditLogNormal(t *testing.T) {
{
sql: "SPLIT TABLE t1 BETWEEN (0) AND (1000000000) REGIONS 16",
stmtType: "other",
//dbs: "test",
//tables: "t1",
// dbs: "test",
// tables: "t1",
},
//{
// {
// sql: "BACKUP DATABASE `test` TO '.'",
// stmtType: "other",
// dbs: "test",
//},
//{
// },
// {
// sql: "RESTORE DATABASE * FROM '.'",
// stmtType: "other",
//},
//{
// },
// {
// sql: "CHANGE DRAINER TO NODE_STATE ='paused' FOR NODE_ID 'drainer1'",
// stmtType: "other",
//},
//{
// },
// {
// sql: "CHANGE PUMP TO NODE_STATE ='paused' FOR NODE_ID 'pump1'",
// stmtType: "other",
//},
// },
{
sql: "BEGIN",
stmtType: "Begin",
Expand All @@ -369,30 +369,30 @@ func TestAuditLogNormal(t *testing.T) {
sql: "COMMIT",
stmtType: "Commit",
},
//{
// {
// sql: "SHOW DRAINER STATUS",
// stmtType: "Show",
//},
//{
// },
// {
// sql: "SHOW PUMP STATUS",
// stmtType: "Show",
//},
//{
// },
// {
// sql: "SHOW GRANTS",
// stmtType: "Show",
//},
// },
{
sql: "SHOW PROCESSLIST",
stmtType: "Show",
},
//{
// {
// sql: "SHOW BACKUPS",
// stmtType: "Show",
//},
//{
// },
// {
// sql: "SHOW RESTORES",
// stmtType: "Show",
//},
// },
{
sql: "show analyze status",
stmtType: "Show",
Expand Down Expand Up @@ -421,10 +421,10 @@ func TestAuditLogNormal(t *testing.T) {
sql: "show fields from t1",
stmtType: "Show",
},
//{
// {
// sql: "SHOW CONFIG",
// stmtType: "Show",
//},
// },
{
sql: "SHOW CREATE TABLE t1",
stmtType: "Show",
Expand Down Expand Up @@ -467,10 +467,10 @@ func TestAuditLogNormal(t *testing.T) {
sql: "SHOW PROFILES",
stmtType: "Show",
},
//{
// {
// sql: "SHOW PUMP STATUS",
// stmtType: "Show",
//},
// },
{
sql: "SHOW SCHEMAS",
stmtType: "Show",
Expand Down Expand Up @@ -585,12 +585,12 @@ func TestAuditLogNormal(t *testing.T) {
sql: "DO 1",
stmtType: "other",
},
//{
// {
// sql: "LOAD DATA LOCAL INFILE 'data.csv' INTO TABLE t1 FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES (id)",
// stmtType: "LoadData",
// dbs: "test",
// tables: "t1",
//},
// },
{
sql: "SELECT * FROM t1",
stmtType: "Select",
Expand All @@ -609,39 +609,39 @@ func TestAuditLogNormal(t *testing.T) {
},
{
sql: "EXPLAIN ANALYZE SELECT * FROM t1 WHERE a = 1",
stmtType: "Explain",
//dbs: "test",
//tables: "t1",
stmtType: "ExplainAnalyzeSQL",
// dbs: "test",
// tables: "t1",
},
{
sql: "EXPLAIN SELECT * FROM t1",
stmtType: "Explain",
//dbs: "test",
//tables: "t1",
stmtType: "ExplainSQL",
// dbs: "test",
// tables: "t1",
},
{
sql: "EXPLAIN SELECT * FROM t1 WHERE a = 1",
stmtType: "Explain",
//dbs: "test",
//tables: "t1",
stmtType: "ExplainSQL",
// dbs: "test",
// tables: "t1",
},
{
sql: "DESC SELECT * FROM t1 WHERE a = 1",
stmtType: "Explain",
//dbs: "test",
//tables: "t1",
stmtType: "ExplainSQL",
// dbs: "test",
// tables: "t1",
},
{
sql: "DESCRIBE SELECT * FROM t1 WHERE a = 1",
stmtType: "Explain",
//dbs: "test",
//tables: "t1",
stmtType: "ExplainSQL",
// dbs: "test",
// tables: "t1",
},
{
sql: "trace format='row' select * from t1",
stmtType: "Trace",
//dbs: "test",
//tables: "t1",
// dbs: "test",
// tables: "t1",
},
{
sql: "flush status",
Expand All @@ -651,18 +651,18 @@ func TestAuditLogNormal(t *testing.T) {
sql: "FLUSH TABLES",
stmtType: "other",
},
//{
// {
// sql: "KILL TIDB 2",
// stmtType: "other",
//},
//{
// },
// {
// sql: "SHUTDOWN",
// stmtType: "Shutdow",
//},
//{
// },
// {
// sql: "ALTER INSTANCE RELOAD TLS",
// stmtType: "other",
//},
// },
}

testResults := make([]normalTest, 0)
Expand Down

0 comments on commit 01ad77d

Please sign in to comment.