Skip to content

Commit ceafd7a

Browse files
committed
Add a lot of test cases
1 parent d7d80c1 commit ceafd7a

40 files changed

+2137
-43
lines changed

fixtures/mysql_bug_72180.json

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"ordering_operation": {
5+
"using_filesort": true,
6+
"grouping_operation": {
7+
"using_temporary_table": true,
8+
"using_filesort": true,
9+
"buffer_result": {
10+
"using_temporary_table": true,
11+
"nested_loop": [
12+
{
13+
"table": {
14+
"table_name": "st",
15+
"access_type": "ref",
16+
"possible_keys": [
17+
"PRIMARY",
18+
"state_idx",
19+
"state_st_idx"
20+
],
21+
"key": "state_st_idx",
22+
"used_key_parts": [
23+
"state"
24+
],
25+
"key_length": "4",
26+
"ref": [
27+
"const"
28+
],
29+
"rows": 26889,
30+
"filtered": 100,
31+
"using_index": true
32+
}
33+
},
34+
{
35+
"table": {
36+
"table_name": "content",
37+
"access_type": "ref",
38+
"possible_keys": [
39+
"ab_ce_idx",
40+
"transition_idx",
41+
"ab_plate_templ_idx"
42+
],
43+
"key": "transition_idx",
44+
"used_key_parts": [
45+
"transition_id"
46+
],
47+
"key_length": "4",
48+
"ref": [
49+
"transition_id"
50+
],
51+
"rows": 1,
52+
"filtered": 100
53+
}
54+
}
55+
]
56+
}
57+
}
58+
}
59+
}
60+
}
File renamed without changes.
File renamed without changes.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"cost_info": {
5+
"query_cost": "89796.80"
6+
},
7+
"duplicates_removal": {
8+
"using_temporary_table": true,
9+
"using_filesort": false,
10+
"table": {
11+
"table_name": "titles",
12+
"access_type": "index",
13+
"possible_keys": [
14+
"PRIMARY",
15+
"emp_no"
16+
],
17+
"key": "emp_no",
18+
"used_key_parts": [
19+
"emp_no"
20+
],
21+
"key_length": "4",
22+
"rows_examined_per_scan": 442724,
23+
"rows_produced_per_join": 442724,
24+
"filtered": "100.00",
25+
"using_index": true,
26+
"cost_info": {
27+
"read_cost": "1252.00",
28+
"eval_cost": "88544.80",
29+
"prefix_cost": "89796.80",
30+
"data_read_per_join": "27M"
31+
},
32+
"used_columns": [
33+
"emp_no",
34+
"title",
35+
"from_date"
36+
],
37+
"attached_condition": "(year(`employees`.`titles`.`from_date`) > '1990')"
38+
}
39+
}
40+
}
41+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"cost_info": {
5+
"query_cost": "531269.80"
6+
},
7+
"duplicates_removal": {
8+
"using_temporary_table": true,
9+
"using_filesort": false,
10+
"table": {
11+
"table_name": "titles",
12+
"access_type": "index",
13+
"possible_keys": [
14+
"PRIMARY",
15+
"emp_no"
16+
],
17+
"key": "PRIMARY",
18+
"used_key_parts": [
19+
"emp_no",
20+
"title",
21+
"from_date"
22+
],
23+
"key_length": "59",
24+
"rows_examined_per_scan": 442724,
25+
"rows_produced_per_join": 442724,
26+
"filtered": "100.00",
27+
"using_index": true,
28+
"cost_info": {
29+
"read_cost": "442725.00",
30+
"eval_cost": "88544.80",
31+
"prefix_cost": "531269.80",
32+
"data_read_per_join": "27M"
33+
},
34+
"used_columns": [
35+
"emp_no",
36+
"title",
37+
"from_date"
38+
],
39+
"attached_condition": "(year(`employees`.`titles`.`from_date`) > '1990')"
40+
}
41+
}
42+
}
43+
}

fixtures/planet_mysql_5994296.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"cost_info": {
5+
"query_cost": "89796.80"
6+
},
7+
"duplicates_removal": {
8+
"using_temporary_table": true,
9+
"using_filesort": false,
10+
"table": {
11+
"table_name": "titles",
12+
"access_type": "index",
13+
"possible_keys": [
14+
"PRIMARY",
15+
"emp_no"
16+
],
17+
"key": "emp_no",
18+
"used_key_parts": [
19+
"emp_no"
20+
],
21+
"key_length": "4",
22+
"rows_examined_per_scan": 442724,
23+
"rows_produced_per_join": 442724,
24+
"filtered": "100.00",
25+
"using_index": true,
26+
"cost_info": {
27+
"read_cost": "1252.00",
28+
"eval_cost": "88544.80",
29+
"prefix_cost": "89796.80",
30+
"data_read_per_join": "27M"
31+
},
32+
"used_columns": [
33+
"emp_no",
34+
"title",
35+
"from_date"
36+
],
37+
"attached_condition": "(year(`employees`.`titles`.`from_date`) > '1990')"
38+
}
39+
}
40+
}
41+
}

fixtures/unofficialmysqlguid.json

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"cost_info": {
5+
"query_cost": "53.80"
6+
},
7+
"table": {
8+
"table_name": "Country",
9+
"access_type": "ALL",
10+
"rows_examined_per_scan": 239,
11+
"rows_produced_per_join": 11,
12+
"filtered": "4.76",
13+
"cost_info": {
14+
"read_cost": "51.52",
15+
"eval_cost": "2.28",
16+
"prefix_cost": "53.80",
17+
"data_read_per_join": "2K"
18+
},
19+
"used_columns": [
20+
"Code",
21+
"Name",
22+
"Continent",
23+
"Region",
24+
"SurfaceArea",
25+
"IndepYear",
26+
"Population",
27+
"LifeExpectancy",
28+
"GNP",
29+
"GNPOld",
30+
"LocalName",
31+
"GovernmentForm",
32+
"HeadOfState",
33+
"Capital",
34+
"Code2"
35+
],
36+
"attached_condition": "((`world`.`Country`.`Continent` = 'Asia') and (`world`.`Country`.`Population` > 5000000))"
37+
}
38+
}
39+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"cost_info": {
5+
"query_cost": "53.80"
6+
},
7+
"table": {
8+
"table_name": "Country",
9+
"access_type": "ALL",
10+
"possible_keys": [
11+
"p"
12+
],
13+
"rows_examined_per_scan": 239,
14+
"rows_produced_per_join": 15,
15+
"filtered": "6.46",
16+
"cost_info": {
17+
"read_cost": "50.71",
18+
"eval_cost": "3.09",
19+
"prefix_cost": "53.80",
20+
"data_read_per_join": "3K"
21+
},
22+
"used_columns": [
23+
"Code",
24+
"Name",
25+
"Continent",
26+
"Region",
27+
"SurfaceArea",
28+
"IndepYear",
29+
"Population",
30+
"LifeExpectancy",
31+
"GNP",
32+
"GNPOld",
33+
"LocalName",
34+
"GovernmentForm",
35+
"HeadOfState",
36+
"Capital",
37+
"Code2"
38+
],
39+
"attached_condition": "((`world`.`Country`.`Continent` = 'Asia') and (`world`.`Country`.`Population` > 5000000))"
40+
}
41+
}
42+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"query_block": {
3+
"select_id": 1,
4+
"cost_info": {
5+
"query_cost": "325.01"
6+
},
7+
"table": {
8+
"table_name": "Country",
9+
"access_type": "range",
10+
"possible_keys": [
11+
"p"
12+
],
13+
"key": "p",
14+
"used_key_parts": [
15+
"Population"
16+
],
17+
"key_length": "4",
18+
"rows_examined_per_scan": 108,
19+
"rows_produced_per_join": 15,
20+
"filtered": "14.29",
21+
"index_condition": "(`world`.`Country`.`Population` > 5000000)",
22+
"cost_info": {
23+
"read_cost": "309.58",
24+
"eval_cost": "15.43",
25+
"prefix_cost": "325.01",
26+
"data_read_per_join": "3K"
27+
},
28+
"used_columns": [
29+
"Code",
30+
"Name",
31+
"Continent",
32+
"Region",
33+
"SurfaceArea",
34+
"IndepYear",
35+
"Population",
36+
"LifeExpectancy",
37+
"GNP",
38+
"GNPOld",
39+
"LocalName",
40+
"GovernmentForm",
41+
"HeadOfState",
42+
"Capital",
43+
"Code2"
44+
],
45+
"attached_condition": "(`world`.`Country`.`Continent` = 'Asia')"
46+
}
47+
}
48+
}

0 commit comments

Comments
 (0)