mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-24 07:13:33 +03:00 
			
		
		
		
	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
		
			
				
	
	
		
			30 lines
		
	
	
		
			922 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			922 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| set session long_query_time=10;
 | |
| select get_lock('bug27638', 1);
 | |
| get_lock('bug27638', 1)
 | |
| 1
 | |
| set session long_query_time=1;
 | |
| truncate table mysql.slow_log;
 | |
| select get_lock('bug27638', 2);
 | |
| get_lock('bug27638', 2)
 | |
| 0
 | |
| select if (query_time between '00:00:01' and '00:00:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
 | |
| qt	sql_text
 | |
| OK	select get_lock('bug27638', 2)
 | |
| truncate table mysql.slow_log;
 | |
| select get_lock('bug27638', 60);
 | |
| get_lock('bug27638', 60)
 | |
| 0
 | |
| select if (query_time between '00:00:59' and '00:01:10', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
 | |
| qt	sql_text
 | |
| OK	select get_lock('bug27638', 60)
 | |
| truncate table mysql.slow_log;
 | |
| select get_lock('bug27638', 101);
 | |
| get_lock('bug27638', 101)
 | |
| 0
 | |
| select if (query_time between '00:01:40' and '00:01:50', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log;
 | |
| qt	sql_text
 | |
| OK	select get_lock('bug27638', 101)
 | |
| select release_lock('bug27638');
 | |
| release_lock('bug27638')
 | |
| 1
 |