diff options
author | unknown <monty@nosik.monty.fi> | 2007-08-02 07:55:33 +0300 |
---|---|---|
committer | unknown <monty@nosik.monty.fi> | 2007-08-02 07:55:33 +0300 |
commit | 926664fe2c802bd7ffc6d9a6b56372ba2e142b23 (patch) | |
tree | 5c544cc45c47bbd06c8b4d216aab02fe9307f8de /sql/sql_parse.cc | |
parent | ccada6ff956e2fed0347051890445049ec9ed8df (diff) | |
parent | f9ea427508fa5451bd22c0d6366a855a4d88800d (diff) | |
download | mariadb-git-926664fe2c802bd7ffc6d9a6b56372ba2e142b23.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/my/mysql-5.1
client/client_priv.h:
Auto merged
client/mysqldump.c:
Auto merged
client/mysqlslap.c:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/lib/mtr_report.pl:
Auto merged
mysql-test/t/disabled.def:
Auto merged
sql/event_data_objects.cc:
Auto merged
sql/event_queue.cc:
Auto merged
sql/ha_partition.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/log.cc:
Auto merged
sql/log.h:
Auto merged
sql/mysql_priv.h:
Auto merged
sql/set_var.cc:
Auto merged
sql/slave.cc:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_insert.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_plugin.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_table.cc:
Auto merged
sql/sql_cache.cc:
Manual merge
Removed comment about bug in old code (not relevant)
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index c98d22d9091..05c0ee49438 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1316,7 +1316,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, void log_slow_statement(THD *thd) { - time_t start_of_query; DBUG_ENTER("log_slow_statement"); /* @@ -1327,25 +1326,24 @@ void log_slow_statement(THD *thd) if (unlikely(thd->in_sub_stmt)) DBUG_VOID_RETURN; // Don't set time for sub stmt - start_of_query= thd->start_time; - 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. */ if (thd->enable_slow_log && !thd->user_time) { - thd->proc_info="logging slow query"; + ulonglong end_utime_of_query= thd->current_utime(); - if ((ulong) (thd->start_time - thd->time_after_lock) > - thd->variables.long_query_time || - ((thd->server_status & - (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) && - opt_log_queries_not_using_indexes)) + thd->proc_info="logging slow query"; + if (((end_utime_of_query - thd->utime_after_lock) > + thd->variables.long_query_time || + ((thd->server_status & + (SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) && + opt_log_queries_not_using_indexes)) && + thd->examined_row_count >= thd->variables.min_examined_row_limit) { thd->status_var.long_query_count++; - slow_log_print(thd, thd->query, thd->query_length, start_of_query); + slow_log_print(thd, thd->query, thd->query_length, end_utime_of_query); } } DBUG_VOID_RETURN; |