1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-17605 Statistics for InnoDB table is wrong if persistent statistics is used

The command SHOW INDEXES ignored setting of the system variable
use_stat_tables to the value of 'preferably' and and showed statistical
data received from the engine. Similarly queries over the table
STATISTICS from INFORMATION_SCHEMA ignored this setting. It happened
because the function fill_schema_table_by_open() did not read any data
from statistical tables.
This commit is contained in:
Igor Babaev
2019-04-22 17:10:42 -07:00
parent a4f7d85932
commit 279a907fd0
6 changed files with 204 additions and 1 deletions

View File

@ -2177,7 +2177,10 @@ inline bool statistics_for_command_is_needed(THD *thd)
{
if (thd->bootstrap || thd->variables.use_stat_tables == NEVER)
return FALSE;
if (thd->force_read_stats)
return TRUE;
switch(thd->lex->sql_command) {
case SQLCOM_SELECT:
case SQLCOM_INSERT: