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:
@ -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:
|
||||
|
Reference in New Issue
Block a user