Commit 97bbac8e authored by Marko Mäkelä's avatar Marko Mäkelä

Revert part of 05619f69

This fixes the following test failures related to index cardinality:
main.join main.stat_tables main.partition main.stat_tables_innodb
innodb.innodb_bug57252
parent 05619f69
...@@ -6636,7 +6636,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables, ...@@ -6636,7 +6636,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
{ {
show_table->file->info(HA_STATUS_VARIABLE | show_table->file->info(HA_STATUS_VARIABLE |
HA_STATUS_NO_LOCK | HA_STATUS_NO_LOCK |
HA_STATUS_CONST |
HA_STATUS_TIME); HA_STATUS_TIME);
set_statistics_for_table(thd, show_table); set_statistics_for_table(thd, show_table);
} }
...@@ -6671,15 +6670,15 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables, ...@@ -6671,15 +6670,15 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
"D" : "A"), 1, cs); "D" : "A"), 1, cs);
table->field[8]->set_notnull(); table->field[8]->set_notnull();
} }
if (key_info->algorithm != HA_KEY_ALG_LONG_HASH && KEY *key=show_table->key_info+i;
key_info->rec_per_key[j]) if (key->rec_per_key[j] && key->algorithm != HA_KEY_ALG_LONG_HASH)
{ {
ha_rows records= (ha_rows) ((double) show_table->stat_records() / ha_rows records= (ha_rows) ((double) show_table->stat_records() /
key_info->actual_rec_per_key(j)); key->actual_rec_per_key(j));
table->field[9]->store((longlong) records, TRUE); table->field[9]->store((longlong) records, TRUE);
table->field[9]->set_notnull(); table->field[9]->set_notnull();
} }
if (key_info->algorithm == HA_KEY_ALG_LONG_HASH) if (key->algorithm == HA_KEY_ALG_LONG_HASH)
table->field[13]->store(STRING_WITH_LEN("HASH"), cs); table->field[13]->store(STRING_WITH_LEN("HASH"), cs);
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