summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <tsmith/tim@siva.hindu.god>2006-10-03 21:26:55 -0600
committerunknown <tsmith/tim@siva.hindu.god>2006-10-03 21:26:55 -0600
commit0d833887e2cf72e99168649165fdd6dd94425b95 (patch)
tree61f7835d92e367da53a8b8c288ddb6b68591ac92 /sql/sql_parse.cc
parentafc1f9f83a3dbc870c690b49d8645609ae6aa92a (diff)
downloadmariadb-git-0d833887e2cf72e99168649165fdd6dd94425b95.tar.gz
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
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 18d048df393..90cef7796fb 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -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";