diff options
author | unknown <tsmith@quadxeon.mysql.com> | 2007-04-04 21:40:47 +0200 |
---|---|---|
committer | unknown <tsmith@quadxeon.mysql.com> | 2007-04-04 21:40:47 +0200 |
commit | 821355da3cc8c883bd95e2f01e7011a4ad33a23c (patch) | |
tree | 32d6f39cd3cf886c4be2b7f7ccae5fbd705771bb /include/my_time.h | |
parent | 73fb1aed614d77539debaa0c2f4445d09b6af010 (diff) | |
download | mariadb-git-821355da3cc8c883bd95e2f01e7011a4ad33a23c.tar.gz |
Bug #27638: slow logging to CSV table inserts bad query_time and lock_time values
When MySQL logged slow query information to a CSV table, it stored the
query_time and lock_time values with an incorrect formula.
If the time was over 59 seconds, this caused incorrect statistics (either the
slow query was not logged, or the time was far from correct). This change
fixes the method used to store those TIME values in the slow_log table.
mysql-test/r/log_tables-big.result:
BitKeeper file /benchmarks/ext3/TOSAVE/tsmith/bk/maint/51/mysql-test/r/log_tables-big.result
mysql-test/t/log_tables-big-master.opt:
BitKeeper file /benchmarks/ext3/TOSAVE/tsmith/bk/maint/51/mysql-test/t/log_tables-big-master.opt
mysql-test/t/log_tables-big.test:
BitKeeper file /benchmarks/ext3/TOSAVE/tsmith/bk/maint/51/mysql-test/t/log_tables-big.test
sql/time.cc:
initialize all TIME fields (except neg, which may store a
needed value) in calc_time_from_sec()
sql/log.cc:
Log_to_csv_event_handler::log_slow(): call store_time() instead of store() for query_time and lock_time
include/my_time.h:
Add TIME_MAX_VALUE_SECONDS definition
Diffstat (limited to 'include/my_time.h')
-rw-r--r-- | include/my_time.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/my_time.h b/include/my_time.h index d96c5822069..6aa25487cf1 100644 --- a/include/my_time.h +++ b/include/my_time.h @@ -72,6 +72,8 @@ typedef long my_time_t; #define TIME_MAX_SECOND 59 #define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \ TIME_MAX_SECOND) +#define TIME_MAX_VALUE_SECONDS (TIME_MAX_HOUR * 3600L + \ + TIME_MAX_MINUTE * 60L + TIME_MAX_SECOND) my_bool check_date(const MYSQL_TIME *ltime, my_bool not_zero_date, ulong flags, int *was_cut); |