@@ -39,7 +39,7 @@ func TestRuleSQLE00055(t *testing.T) {
39
39
INDEX idx_2 (a),
40
40
PRIMARY KEY (id)
41
41
);
42
- ` , newTestResult ().addResult (ruleName , "[id]" , "[id ]" ))
42
+ ` , newTestResult ().addResult (ruleName , "[[ id]] " , "Primary Key" , "[idx_1 ]" ))
43
43
44
44
//create table, with index, with no redundant index
45
45
runSingleRuleInspectCase (rule , t , "create table, with index, with no redundant index" , DefaultMysqlInspect (), `
@@ -61,7 +61,7 @@ func TestRuleSQLE00055(t *testing.T) {
61
61
INDEX idx_1 (id,v1,v2),
62
62
PRIMARY KEY (id, v1)
63
63
);
64
- ` , newTestResult ().addResult (ruleName , "[id v1 v2] " , "[id v1 ]" ))
64
+ ` , newTestResult ().addResult (ruleName , "[[ id v1]] " , "Primary Key" , "[idx_1 ]" ))
65
65
66
66
//create table, with index, with repeat index
67
67
runSingleRuleInspectCase (rule , t , "create table, with index, with repeat index" , DefaultMysqlInspect (), `
@@ -72,7 +72,7 @@ func TestRuleSQLE00055(t *testing.T) {
72
72
PRIMARY KEY (id),
73
73
INDEX idx_2 (id)
74
74
)ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COMMENT="unit test";
75
- ` , newTestResult ().addResult (ruleName , "[id]" , "[id ]" ))
75
+ ` , newTestResult ().addResult (ruleName , "[[ id]] " , "Primary Key" , "[idx_2 ]" ))
76
76
77
77
//create index, with no redundant index
78
78
runSingleRuleInspectCase (rule , t , "create index, with no redundant index" , DefaultMysqlInspect (), `
@@ -82,12 +82,12 @@ func TestRuleSQLE00055(t *testing.T) {
82
82
//create index, with redundant index
83
83
runSingleRuleInspectCase (rule , t , "create index, with column, with redundant index" , DefaultMysqlInspect (), `
84
84
CREATE INDEX idx_2 on exist_db.exist_tb_9(v1, v2(10));
85
- ` , newTestResult ().addResult (ruleName , "[v1 v2 v3 v4]" , "[v1 v2 ]" ))
85
+ ` , newTestResult ().addResult (ruleName , "[[ v1 v2 v3 v4]] " , "idx_1" , "[idx_2 ]" ))
86
86
87
87
//create index, with repeat index
88
88
runSingleRuleInspectCase (rule , t , "create index, with repeat index" , DefaultMysqlInspect (), `
89
89
CREATE INDEX idx_2 on exist_db.exist_tb_9(v1,v2,v3, v4);
90
- ` , newTestResult ().addResult (ruleName , "[v1 v2 v3 v4]" , "[v1 v2 v3 v4 ]" ))
90
+ ` , newTestResult ().addResult (ruleName , "[[ v1 v2 v3 v4]] " , "idx_1" , "[idx_2 ]" ))
91
91
92
92
//alter table, no index
93
93
runSingleRuleInspectCase (rule , t , "alter table, no index" , DefaultMysqlInspect (), `
@@ -104,14 +104,7 @@ ADD INDEX idx_3 (v4);
104
104
runSingleRuleInspectCase (rule , t , "alter table, add index, with redundant index" , DefaultMysqlInspect (), `
105
105
ALTER TABLE exist_db.exist_tb_9
106
106
ADD INDEX idx_3 (v1);
107
- ` , newTestResult ().addResult (ruleName , "[v1 v2 v3 v4]" , "[v1]" ))
108
-
109
- // Alter table, add index, with repeat index
110
- runSingleRuleInspectCase (rule , t , "alter table, add index, with repeat index" , DefaultMysqlInspect (), `
111
- ALTER TABLE exist_db.exist_tb_9
112
- ADD INDEX idx_2 (v2,v3),
113
- ADD INDEX idx_3 (v3);
114
- ` , newTestResult ().addResult (ruleName , "[v2 v3]" , "[v2 v3]" ).addResult (ruleName , "[v3]" , "[v3]" ))
107
+ ` , newTestResult ().addResult (ruleName , "[[v1 v2 v3 v4]]" , "idx_1" , "[idx_3]" ))
115
108
116
109
// Alter table, drop index, no effect on redundancy
117
110
runSingleRuleInspectCase (rule , t , "alter table, drop index, no effect on redundancy" , DefaultMysqlInspect (), `
0 commit comments