Skip to content

Commit 97bbac8

Browse files
committed
Revert part of 05619f6
This fixes the following test failures related to index cardinality: main.join main.stat_tables main.partition main.stat_tables_innodb innodb.innodb_bug57252
1 parent 05619f6 commit 97bbac8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

sql/sql_show.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6636,7 +6636,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
66366636
{
66376637
show_table->file->info(HA_STATUS_VARIABLE |
66386638
HA_STATUS_NO_LOCK |
6639-
HA_STATUS_CONST |
66406639
HA_STATUS_TIME);
66416640
set_statistics_for_table(thd, show_table);
66426641
}
@@ -6671,15 +6670,15 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
66716670
"D" : "A"), 1, cs);
66726671
table->field[8]->set_notnull();
66736672
}
6674-
if (key_info->algorithm != HA_KEY_ALG_LONG_HASH &&
6675-
key_info->rec_per_key[j])
6673+
KEY *key=show_table->key_info+i;
6674+
if (key->rec_per_key[j] && key->algorithm != HA_KEY_ALG_LONG_HASH)
66766675
{
66776676
ha_rows records= (ha_rows) ((double) show_table->stat_records() /
6678-
key_info->actual_rec_per_key(j));
6677+
key->actual_rec_per_key(j));
66796678
table->field[9]->store((longlong) records, TRUE);
66806679
table->field[9]->set_notnull();
66816680
}
6682-
if (key_info->algorithm == HA_KEY_ALG_LONG_HASH)
6681+
if (key->algorithm == HA_KEY_ALG_LONG_HASH)
66836682
table->field[13]->store(STRING_WITH_LEN("HASH"), cs);
66846683
else
66856684
{

0 commit comments

Comments
 (0)