1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
#WL#12393: Logging: Add new command line option, --log-slow-extra,
# for richer slow logging
SET @save_sqlf=@@global.slow_query_log_file;
SET GLOBAL slow_query_log_file= '.../my_extra_slow1.log';
SET timestamp=10;
SELECT unix_timestamp(), sleep(2);
unix_timestamp() sleep(2)
10 0
[ PASS ] timestamp found
SET @@global.slow_query_log_file=@save_sqlf;
SET @save_sqlf=@@global.slow_query_log_file;
SET GLOBAL slow_query_log_file= '.../my_extra_slow2.log';
SET GLOBAL long_query_time=0;
DROP TABLE IF EXISTS islow;
CREATE TABLE islow(i INT) ENGINE=innodb;
INSERT INTO islow VALUES (1), (2), (3), (4), (5), (6), (7), (8);
SELECT * FROM islow;
i
1
2
3
4
5
6
7
8
SELECT * FROM islow;
i
1
2
3
4
5
6
7
8
SET GLOBAL slow_query_log=0;
SET GLOBAL long_query_time=1;
DROP TABLE islow;
#
# This is a hack to check the log result.
# We strip off time related fields (non-deterministic) and
# verify the rest are correct.
#
Rows_sent: 0 Rows_examined: 0 Thread_id: 0 Errno: 0 Killed: 0 Bytes_received: 33 Bytes_sent: 11 Read_first: 0 Read_last: 0 Read_key: 5 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 0 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
Rows_sent: 0 Rows_examined: 0 Thread_id: 0 Errno: 0 Killed: 0 Bytes_received: 46 Bytes_sent: 11 Read_first: 0 Read_last: 0 Read_key: 18 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 0 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
Rows_sent: 0 Rows_examined: 0 Thread_id: 0 Errno: 0 Killed: 0 Bytes_received: 70 Bytes_sent: 50 Read_first: 0 Read_last: 0 Read_key: 11 Read_next: 9 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 0 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
Rows_sent: 8 Rows_examined: 8 Thread_id: 0 Errno: 0 Killed: 0 Bytes_received: 26 Bytes_sent: 106 Read_first: 1 Read_last: 0 Read_key: 1 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 9 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
Rows_sent: 8 Rows_examined: 8 Thread_id: 0 Errno: 0 Killed: 0 Bytes_received: 26 Bytes_sent: 106 Read_first: 1 Read_last: 0 Read_key: 1 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 9 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
SET @@global.slow_query_log_file=@save_sqlf;
SET GLOBAL slow_query_log=1;
#
# Bug#30769965: WITH LOG_SLOW_EXTRA=ON ERRNO: INFO NOT GETTING UPDATED
# CORRECTLY FOR ERROR
#
SET @save_sqlf=@@global.slow_query_log_file;
SET GLOBAL slow_query_log_file= '.../my_extra_slow3.log';
SET long_query_time=0;
CREATE TABLE b(id INT NOT NULL AUTO_INCREMENT);
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
# Look for Errnos in slow log. There should be two,
# both SET and CREATE will be logged as slow.
# Found Errno: 0 in slow log
# Found Errno: 1075 in slow log
SET @@global.slow_query_log_file=@save_sqlf;
SET GLOBAL slow_query_log=1;
|