summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <jcole@tetra.spaceapes.com>2001-02-16 15:47:37 -0600
committerunknown <jcole@tetra.spaceapes.com>2001-02-16 15:47:37 -0600
commit3d30ff09fd589e6229a3109a96f4f0fc477b3ace (patch)
tree0d2a5deaa57fadd5bb8774a1131036293ef371e9 /sql/sql_parse.cc
parent790efcea7f6eda03f66fd0fe4298b65b991261dd (diff)
parent2f894668708804050ca580663f8ef4fcd7df7151 (diff)
downloadmariadb-git-3d30ff09fd589e6229a3109a96f4f0fc477b3ace.tar.gz
Merge work.mysql.com:/home/bk/mysql
into tetra.spaceapes.com:/usr/home/jcole/bk/mysql BitKeeper/etc/logging_ok: auto-union sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index ae8846f4039..ebf49583e7b 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -562,6 +562,9 @@ bool do_command(THD *thd)
bool error=0;
NET *net;
enum enum_server_command command;
+ // commands which will always take a long time should be marked with
+ // this so that they will not get logged to the slow query log
+ bool slow_command=FALSE;
DBUG_ENTER("do_command");
net= &thd->net;
@@ -605,6 +608,7 @@ bool do_command(THD *thd)
break;
case COM_TABLE_DUMP:
{
+ slow_command = TRUE;
char* data = packet + 1;
uint db_len = *data;
uint tbl_len = *(data + db_len + 1);
@@ -745,6 +749,7 @@ bool do_command(THD *thd)
}
case COM_BINLOG_DUMP:
{
+ slow_command = TRUE;
if(check_access(thd, FILE_ACL, any_db))
break;
mysql_log.write(thd,command, 0);
@@ -849,16 +854,18 @@ bool do_command(THD *thd)
thd->proc_info="closing tables";
close_thread_tables(thd); /* Free tables */
}
- thd->proc_info="cleaning up";
if (thd->fatal_error)
send_error(net,0); // End of memory ?
time_t start_of_query=thd->start_time;
thd->end_time(); // Set start time
+
/* If not reading from backup and if the query took too long */
- if (!thd->user_time)
+ if (!slow_command && !thd->user_time) // do not log 'slow_command' queries
{
+ thd->proc_info="logging slow query";
+
if ((ulong) (thd->start_time - thd->time_after_lock) > long_query_time ||
((thd->lex.options &
(QUERY_NO_INDEX_USED | QUERY_NO_GOOD_INDEX_USED)) &&
@@ -868,7 +875,7 @@ bool do_command(THD *thd)
mysql_slow_log.write(thd, thd->query, thd->query_length, start_of_query);
}
}
- thd->proc_info="cleaning up2";
+ thd->proc_info="cleaning up";
VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list
thd->proc_info=0;
thd->command=COM_SLEEP;