1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed the bug that caused displaying incorrect values in

the column cardinality of the table information_schema.statistics.
This commit is contained in:
Igor Babaev
2012-05-17 16:54:26 -07:00
parent 2a1afc29f2
commit 9b79feba56
5 changed files with 92 additions and 2 deletions

View File

@@ -5441,9 +5441,12 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
TABLE *show_table= tables->table;
KEY *key_info=show_table->s->key_info;
if (show_table->file)
{
show_table->file->info(HA_STATUS_VARIABLE |
HA_STATUS_NO_LOCK |
HA_STATUS_TIME);
set_statistics_for_table(thd, show_table);
}
for (uint i=0 ; i < show_table->s->keys ; i++,key_info++)
{
KEY_PART_INFO *key_part= key_info->key_part;
@@ -5474,8 +5477,8 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
KEY *key=show_table->key_info+i;
if (key->rec_per_key[j])
{
ha_rows records=(show_table->file->stats.records /
key->rec_per_key[j]);
ha_rows records=((double) show_table->stat_records() /
key->real_rec_per_key(j));
table->field[9]->store((longlong) records, TRUE);
table->field[9]->set_notnull();
}