summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-08-12 19:35:59 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-08-12 19:37:24 +0300
commit97bbac8ec61f1903f713eb1ed5330b3a60c11924 (patch)
treea5b514253e37a8caa8fa9895316ba0ba33bf6256 /sql/sql_show.cc
parent05619f6989590727a470c23475fc987f52b56988 (diff)
downloadmariadb-git-97bbac8ec61f1903f713eb1ed5330b3a60c11924.tar.gz
Revert part of 05619f6989590727a470c23475fc987f52b56988
This fixes the following test failures related to index cardinality: main.join main.stat_tables main.partition main.stat_tables_innodb innodb.innodb_bug57252
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 966e366e681..718ed4218f1 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -6636,7 +6636,6 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
{
show_table->file->info(HA_STATUS_VARIABLE |
HA_STATUS_NO_LOCK |
- HA_STATUS_CONST |
HA_STATUS_TIME);
set_statistics_for_table(thd, show_table);
}
@@ -6671,15 +6670,15 @@ static int get_schema_stat_record(THD *thd, TABLE_LIST *tables,
"D" : "A"), 1, cs);
table->field[8]->set_notnull();
}
- if (key_info->algorithm != HA_KEY_ALG_LONG_HASH &&
- key_info->rec_per_key[j])
+ KEY *key=show_table->key_info+i;
+ if (key->rec_per_key[j] && key->algorithm != HA_KEY_ALG_LONG_HASH)
{
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]->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);
else
{