Commit 223fa6a8 authored by Sergei Petrunia's avatar Sergei Petrunia

Make tests pass

- Fix bad tests in statistics_json test: make them meaningful and make them
  work on windows
- Fix analyze_debug.test: correctly handle errors during ANALYZE
parent e0f42d32
...@@ -3174,22 +3174,12 @@ Percentage 0.0 99.9 50 JSON_HB { ...@@ -3174,22 +3174,12 @@ Percentage 0.0 99.9 50 JSON_HB {
"99.9" "99.9"
] ]
} }
explain extended select * from Country where 'Code' between 'BBC' and 'GGG'; analyze select * from Country use index () where Code between 'BBC' and 'GGG';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 100.00
Warnings:
Note 1003 select `world`.`Country`.`Code` AS `Code`,`world`.`Country`.`Name` AS `Name`,`world`.`Country`.`SurfaceArea` AS `SurfaceArea`,`world`.`Country`.`Population` AS `Population`,`world`.`Country`.`Capital` AS `Capital` from `world`.`Country` where 1
analyze select * from Country where 'Code' between 'BBC' and 'GGG';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE Country ALL NULL NULL NULL NULL 239 239.00 100.00 100.00 1 SIMPLE Country ALL NULL NULL NULL NULL 239 239.00 25.49 25.52 Using where
explain extended select * from Country where 'Code' < 'BBC'; analyze select * from Country use index () where Code < 'BBC';
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 select `world`.`Country`.`Code` AS `Code`,`world`.`Country`.`Name` AS `Name`,`world`.`Country`.`SurfaceArea` AS `SurfaceArea`,`world`.`Country`.`Population` AS `Population`,`world`.`Country`.`Capital` AS `Capital` from `world`.`Country` where 0
analyze select * from Country where 'Code' < 'BBC';
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 1 SIMPLE Country ALL NULL NULL NULL NULL 239 239.00 5.88 7.11 Using where
set histogram_type=@save_histogram_type; set histogram_type=@save_histogram_type;
set histogram_size=@save_histogram_size; set histogram_size=@save_histogram_size;
DROP SCHEMA world; DROP SCHEMA world;
...@@ -85,10 +85,8 @@ ANALYZE TABLE Country, City, CountryLanguage persistent for all; ...@@ -85,10 +85,8 @@ ANALYZE TABLE Country, City, CountryLanguage persistent for all;
--enable_result_log --enable_result_log
SELECT column_name, min_value, max_value, hist_size, hist_type, histogram FROM mysql.column_stats; SELECT column_name, min_value, max_value, hist_size, hist_type, histogram FROM mysql.column_stats;
explain extended select * from Country where 'Code' between 'BBC' and 'GGG'; analyze select * from Country use index () where Code between 'BBC' and 'GGG';
analyze select * from Country where 'Code' between 'BBC' and 'GGG'; analyze select * from Country use index () where Code < 'BBC';
explain extended select * from Country where 'Code' < 'BBC';
analyze select * from Country where 'Code' < 'BBC';
set histogram_type=@save_histogram_type; set histogram_type=@save_histogram_type;
set histogram_size=@save_histogram_size; set histogram_size=@save_histogram_size;
......
...@@ -1045,7 +1045,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, ...@@ -1045,7 +1045,8 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
else else
compl_result_code= HA_ADMIN_FAILED; compl_result_code= HA_ADMIN_FAILED;
free_statistics_for_table(thd, table->table); if (table->table)
free_statistics_for_table(thd, table->table);
if (compl_result_code) if (compl_result_code)
result_code= HA_ADMIN_FAILED; result_code= HA_ADMIN_FAILED;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment