mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug #19764: SHOW commands end up in the slow log as table scans
Set a flag when a SHOW command is parsed, and check it in log_slow_statement(). SHOW commands are not counted as slow queries, even if they use table scans. mysql-test/t/show_check-master.opt: BitKeeper file /usr/home/tim/m/bk/b19764/50/mysql-test/t/show_check-master.opt mysql-test/r/show_check.result: Add test for bug #19764 mysql-test/t/show_check.test: Add test for bug #19764 sql/sql_lex.cc: Set lex->is_show_command= FALSE in lex_start sql/sql_lex.h: Add LEX->is_slow_command flag to prevent SHOW commands from being written to the slow queries log sql/sql_parse.cc: Don't log slow statement if it is a SHOW command sql/sql_yacc.yy: Set lex->is_show_command for all SHOW commands
This commit is contained in:
@@ -2150,10 +2150,10 @@ void log_slow_statement(THD *thd)
|
||||
thd->end_time(); // Set start time
|
||||
|
||||
/*
|
||||
Do not log administrative statements unless the appropriate option is
|
||||
set; do not log into slow log if reading from backup.
|
||||
Do not log administrative or SHOW statements unless the appropriate
|
||||
option is set; do not log into slow log if reading from backup.
|
||||
*/
|
||||
if (thd->enable_slow_log && !thd->user_time)
|
||||
if (thd->enable_slow_log && !thd->user_time && !thd->lex->is_show_command)
|
||||
{
|
||||
thd->proc_info="logging slow query";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user