diff options
author | Igor Babaev <igor@askmonty.org> | 2012-04-19 09:49:53 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2012-04-19 09:49:53 -0700 |
commit | 9f53c310d8fb76963d88e8a87a650d93469cdab2 (patch) | |
tree | da7f80bf3f7f249bcff56beca934a9345c38d738 /sql/sql_statistics.cc | |
parent | 9e74665a2d91e299d1b9c5c2695855426aad78eb (diff) | |
download | mariadb-git-9f53c310d8fb76963d88e8a87a650d93469cdab2.tar.gz |
Fixed a problem for Q18 from DBT3/SF30 with innodb database instance:
the server crashed when running the query with persistent statistics
enabled.
The field KEY::read_stat.avg_frequency must be initialized to NULL
for the keys of temporary tables.
Diffstat (limited to 'sql/sql_statistics.cc')
-rw-r--r-- | sql/sql_statistics.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 27aa77ae1a3..3c6f5829e6b 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -1636,6 +1636,7 @@ void set_statistics_for_table(THD *thd, TABLE *table) key_info < key_info_end; key_info++) { key_info->is_statistics_from_stat_tables= - (use_stat_table_mode > 1 && key_info->read_stat.avg_frequency[0] > 0.5); + (use_stat_table_mode > 1 && key_info->read_stat.avg_frequency && + key_info->read_stat.avg_frequency[0] > 0.5); } } |