Commit 8767540a authored by Sergei Golubchik's avatar Sergei Golubchik

microseconds in log tables:

  TIMESTAMP -> TIMESTAMP(6)
  TIME -> TIME(6)
in general_log and slow_log tables.

include/my_sys.h:
  use constants
parent f06cac33
...@@ -894,17 +894,17 @@ extern ulong crc32(ulong crc, const uchar *buf, uint len); ...@@ -894,17 +894,17 @@ extern ulong crc32(ulong crc, const uchar *buf, uint len);
extern uint my_set_max_open_files(uint files); extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void); void my_free_open_file_info(void);
#define HRTIME_RESOLUTION 1000000 /* microseconds */ #define HRTIME_RESOLUTION 1000000ULL /* microseconds */
typedef struct {ulonglong val;} my_hrtime_t; typedef struct {ulonglong val;} my_hrtime_t;
void my_time_init(); void my_time_init();
extern my_hrtime_t my_hrtime(); extern my_hrtime_t my_hrtime();
extern ulonglong my_interval_timer(void); extern ulonglong my_interval_timer(void);
#define microsecond_interval_timer() (my_interval_timer()/1000) #define microsecond_interval_timer() (my_interval_timer()/1000)
#define hrtime_to_time(X) ((X).val/1000000) #define hrtime_to_time(X) ((X).val/HRTIME_RESOLUTION)
#define hrtime_from_time(X) ((ulonglong)((X)*1000000ULL)) #define hrtime_from_time(X) ((ulonglong)((X)*HRTIME_RESOLUTION))
#define hrtime_to_double(X) ((X).val/(double)HRTIME_RESOLUTION) #define hrtime_to_double(X) ((X).val/(double)HRTIME_RESOLUTION)
#define hrtime_sec_part(X) ((ulong)((X).val%1000000)) #define hrtime_sec_part(X) ((ulong)((X).val % HRTIME_RESOLUTION))
#define my_time(X) hrtime_to_time(my_hrtime()) #define my_time(X) hrtime_to_time(my_hrtime())
extern my_bool my_gethwaddr(uchar *to); extern my_bool my_gethwaddr(uchar *to);
......
...@@ -55,7 +55,7 @@ sleep(@long_query_time + 1) ...@@ -55,7 +55,7 @@ sleep(@long_query_time + 1)
0 0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%'; select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 select sleep(@long_query_time + 1) TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 select sleep(@long_query_time + 1)
# Switch to connection default # Switch to connection default
show global variables show global variables
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
......
...@@ -53,7 +53,7 @@ ERROR HY000: You can't use locks with log tables. ...@@ -53,7 +53,7 @@ ERROR HY000: You can't use locks with log tables.
show create table mysql.general_log; show create table mysql.general_log;
Table Create Table Table Create Table
general_log CREATE TABLE `general_log` ( general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL,
...@@ -62,7 +62,7 @@ general_log CREATE TABLE `general_log` ( ...@@ -62,7 +62,7 @@ general_log CREATE TABLE `general_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'
show fields from mysql.general_log; show fields from mysql.general_log;
Field Type Null Key Default Extra Field Type Null Key Default Extra
event_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP event_time timestamp(6) NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
user_host mediumtext NO NULL user_host mediumtext NO NULL
thread_id int(11) NO NULL thread_id int(11) NO NULL
server_id int(10) unsigned NO NULL server_id int(10) unsigned NO NULL
...@@ -71,10 +71,10 @@ argument mediumtext NO NULL ...@@ -71,10 +71,10 @@ argument mediumtext NO NULL
show create table mysql.slow_log; show create table mysql.slow_log;
Table Create Table Table Create Table
slow_log CREATE TABLE `slow_log` ( slow_log CREATE TABLE `slow_log` (
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`query_time` time NOT NULL, `query_time` time(6) NOT NULL,
`lock_time` time NOT NULL, `lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL, `rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL, `rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
...@@ -85,10 +85,10 @@ slow_log CREATE TABLE `slow_log` ( ...@@ -85,10 +85,10 @@ slow_log CREATE TABLE `slow_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log' ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='Slow log'
show fields from mysql.slow_log; show fields from mysql.slow_log;
Field Type Null Key Default Extra Field Type Null Key Default Extra
start_time timestamp NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP start_time timestamp(6) NO CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
user_host mediumtext NO NULL user_host mediumtext NO NULL
query_time time NO NULL query_time time(6) NO NULL
lock_time time NO NULL lock_time time(6) NO NULL
rows_sent int(11) NO NULL rows_sent int(11) NO NULL
rows_examined int(11) NO NULL rows_examined int(11) NO NULL
db varchar(512) NO NULL db varchar(512) NO NULL
...@@ -147,7 +147,7 @@ sleep(2) ...@@ -147,7 +147,7 @@ sleep(2)
0 0
select * from mysql.slow_log; select * from mysql.slow_log;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text
TIMESTAMP USER_HOST QUERY_TIME 00:00:00 1 0 mysql 0 0 1 select sleep(2) TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 mysql 0 0 1 select sleep(2)
set @@session.long_query_time = @saved_long_query_time; set @@session.long_query_time = @saved_long_query_time;
alter table mysql.general_log engine=myisam; alter table mysql.general_log engine=myisam;
ERROR HY000: You cannot 'ALTER' a log table if logging is enabled ERROR HY000: You cannot 'ALTER' a log table if logging is enabled
...@@ -164,7 +164,7 @@ set global slow_query_log='OFF'; ...@@ -164,7 +164,7 @@ set global slow_query_log='OFF';
show create table mysql.general_log; show create table mysql.general_log;
Table Create Table Table Create Table
general_log CREATE TABLE `general_log` ( general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL,
...@@ -174,10 +174,10 @@ general_log CREATE TABLE `general_log` ( ...@@ -174,10 +174,10 @@ general_log CREATE TABLE `general_log` (
show create table mysql.slow_log; show create table mysql.slow_log;
Table Create Table Table Create Table
slow_log CREATE TABLE `slow_log` ( slow_log CREATE TABLE `slow_log` (
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`query_time` time NOT NULL, `query_time` time(6) NOT NULL,
`lock_time` time NOT NULL, `lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL, `rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL, `rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
...@@ -191,7 +191,7 @@ alter table mysql.slow_log engine=myisam; ...@@ -191,7 +191,7 @@ alter table mysql.slow_log engine=myisam;
show create table mysql.general_log; show create table mysql.general_log;
Table Create Table Table Create Table
general_log CREATE TABLE `general_log` ( general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL,
...@@ -201,10 +201,10 @@ general_log CREATE TABLE `general_log` ( ...@@ -201,10 +201,10 @@ general_log CREATE TABLE `general_log` (
show create table mysql.slow_log; show create table mysql.slow_log;
Table Create Table Table Create Table
slow_log CREATE TABLE `slow_log` ( slow_log CREATE TABLE `slow_log` (
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`query_time` time NOT NULL, `query_time` time(6) NOT NULL,
`lock_time` time NOT NULL, `lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL, `rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL, `rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
...@@ -264,7 +264,7 @@ drop table mysql.slow_log; ...@@ -264,7 +264,7 @@ drop table mysql.slow_log;
ERROR 42S02: Unknown table 'slow_log' ERROR 42S02: Unknown table 'slow_log'
use mysql; use mysql;
CREATE TABLE `general_log` ( CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
...@@ -273,11 +273,11 @@ ON UPDATE CURRENT_TIMESTAMP, ...@@ -273,11 +273,11 @@ ON UPDATE CURRENT_TIMESTAMP,
`argument` mediumtext NOT NULL `argument` mediumtext NOT NULL
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
CREATE TABLE `slow_log` ( CREATE TABLE `slow_log` (
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`query_time` time NOT NULL, `query_time` time(6) NOT NULL,
`lock_time` time NOT NULL, `lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL, `rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL, `rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
...@@ -429,9 +429,9 @@ My own slow query sleep(2) ...@@ -429,9 +429,9 @@ My own slow query sleep(2)
My own slow query 0 My own slow query 0
SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3; SELECT * FROM mysql.slow_log WHERE seq >= 2 LIMIT 3;
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text seq start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text seq
START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 2 START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 2
START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3 START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 3
START_TIME USER_HOST QUERY_TIME 00:00:00 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4 START_TIME USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 SELECT "My own slow query", sleep(2) 4
SET GLOBAL slow_query_log = 0; SET GLOBAL slow_query_log = 0;
SET SESSION long_query_time =@saved_long_query_time; SET SESSION long_query_time =@saved_long_query_time;
FLUSH LOGS; FLUSH LOGS;
...@@ -525,10 +525,10 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`; ...@@ -525,10 +525,10 @@ DROP PROCEDURE IF EXISTS `db_17876.archiveGeneralLog`;
DROP DATABASE IF EXISTS `db_17876`; DROP DATABASE IF EXISTS `db_17876`;
CREATE DATABASE db_17876; CREATE DATABASE db_17876;
CREATE TABLE `db_17876.slow_log_data` ( CREATE TABLE `db_17876.slow_log_data` (
`start_time` timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `start_time` timestamp(6) default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`user_host` mediumtext , `user_host` mediumtext ,
`query_time` time , `query_time` time(6) ,
`lock_time` time , `lock_time` time(6) ,
`rows_sent` int(11) , `rows_sent` int(11) ,
`rows_examined` int(11) , `rows_examined` int(11) ,
`db` varchar(512) default NULL, `db` varchar(512) default NULL,
...@@ -538,7 +538,7 @@ CREATE TABLE `db_17876.slow_log_data` ( ...@@ -538,7 +538,7 @@ CREATE TABLE `db_17876.slow_log_data` (
`sql_text` mediumtext `sql_text` mediumtext
); );
CREATE TABLE `db_17876.general_log_data` ( CREATE TABLE `db_17876.general_log_data` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext, `user_host` mediumtext,
`thread_id` int(11) DEFAULT NULL, `thread_id` int(11) DEFAULT NULL,
`server_id` int(11) DEFAULT NULL, `server_id` int(11) DEFAULT NULL,
...@@ -547,7 +547,7 @@ CREATE TABLE `db_17876.general_log_data` ( ...@@ -547,7 +547,7 @@ CREATE TABLE `db_17876.general_log_data` (
); );
CREATE procedure `db_17876.archiveSlowLog`() CREATE procedure `db_17876.archiveSlowLog`()
BEGIN BEGIN
DECLARE start_time, query_time, lock_time CHAR(20); DECLARE start_time, query_time, lock_time CHAR(28);
DECLARE user_host MEDIUMTEXT; DECLARE user_host MEDIUMTEXT;
DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT; DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT;
DECLARE dbname MEDIUMTEXT; DECLARE dbname MEDIUMTEXT;
...@@ -580,7 +580,7 @@ TRUNCATE mysql.slow_log; ...@@ -580,7 +580,7 @@ TRUNCATE mysql.slow_log;
END // END //
CREATE procedure `db_17876.archiveGeneralLog`() CREATE procedure `db_17876.archiveGeneralLog`()
BEGIN BEGIN
DECLARE event_time CHAR(20); DECLARE event_time CHAR(28);
DECLARE user_host, argument MEDIUMTEXT; DECLARE user_host, argument MEDIUMTEXT;
DECLARE thread_id, server_id INT; DECLARE thread_id, server_id INT;
DECLARE sql_text BLOB; DECLARE sql_text BLOB;
......
...@@ -238,7 +238,7 @@ event CREATE TABLE `event` ( ...@@ -238,7 +238,7 @@ event CREATE TABLE `event` (
show create table general_log; show create table general_log;
Table Create Table Table Create Table
general_log CREATE TABLE `general_log` ( general_log CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
`server_id` int(10) unsigned NOT NULL, `server_id` int(10) unsigned NOT NULL,
...@@ -248,10 +248,10 @@ general_log CREATE TABLE `general_log` ( ...@@ -248,10 +248,10 @@ general_log CREATE TABLE `general_log` (
show create table slow_log; show create table slow_log;
Table Create Table Table Create Table
slow_log CREATE TABLE `slow_log` ( slow_log CREATE TABLE `slow_log` (
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`query_time` time NOT NULL, `query_time` time(6) NOT NULL,
`lock_time` time NOT NULL, `lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL, `rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL, `rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
......
...@@ -283,7 +283,7 @@ drop table mysql.slow_log; ...@@ -283,7 +283,7 @@ drop table mysql.slow_log;
use mysql; use mysql;
CREATE TABLE `general_log` ( CREATE TABLE `general_log` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`thread_id` int(11) NOT NULL, `thread_id` int(11) NOT NULL,
...@@ -293,11 +293,11 @@ CREATE TABLE `general_log` ( ...@@ -293,11 +293,11 @@ CREATE TABLE `general_log` (
) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'; ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
CREATE TABLE `slow_log` ( CREATE TABLE `slow_log` (
`start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP `start_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP, ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext NOT NULL, `user_host` mediumtext NOT NULL,
`query_time` time NOT NULL, `query_time` time(6) NOT NULL,
`lock_time` time NOT NULL, `lock_time` time(6) NOT NULL,
`rows_sent` int(11) NOT NULL, `rows_sent` int(11) NOT NULL,
`rows_examined` int(11) NOT NULL, `rows_examined` int(11) NOT NULL,
`db` varchar(512) NOT NULL, `db` varchar(512) NOT NULL,
...@@ -710,10 +710,10 @@ DROP DATABASE IF EXISTS `db_17876`; ...@@ -710,10 +710,10 @@ DROP DATABASE IF EXISTS `db_17876`;
CREATE DATABASE db_17876; CREATE DATABASE db_17876;
CREATE TABLE `db_17876.slow_log_data` ( CREATE TABLE `db_17876.slow_log_data` (
`start_time` timestamp default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, `start_time` timestamp(6) default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`user_host` mediumtext , `user_host` mediumtext ,
`query_time` time , `query_time` time(6) ,
`lock_time` time , `lock_time` time(6) ,
`rows_sent` int(11) , `rows_sent` int(11) ,
`rows_examined` int(11) , `rows_examined` int(11) ,
`db` varchar(512) default NULL, `db` varchar(512) default NULL,
...@@ -724,7 +724,7 @@ CREATE TABLE `db_17876.slow_log_data` ( ...@@ -724,7 +724,7 @@ CREATE TABLE `db_17876.slow_log_data` (
); );
CREATE TABLE `db_17876.general_log_data` ( CREATE TABLE `db_17876.general_log_data` (
`event_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`user_host` mediumtext, `user_host` mediumtext,
`thread_id` int(11) DEFAULT NULL, `thread_id` int(11) DEFAULT NULL,
`server_id` int(11) DEFAULT NULL, `server_id` int(11) DEFAULT NULL,
...@@ -736,7 +736,7 @@ DELIMITER //; ...@@ -736,7 +736,7 @@ DELIMITER //;
CREATE procedure `db_17876.archiveSlowLog`() CREATE procedure `db_17876.archiveSlowLog`()
BEGIN BEGIN
DECLARE start_time, query_time, lock_time CHAR(20); DECLARE start_time, query_time, lock_time CHAR(28);
DECLARE user_host MEDIUMTEXT; DECLARE user_host MEDIUMTEXT;
DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT; DECLARE rows_set, rows_examined, last_insert_id, insert_id, server_id INT;
DECLARE dbname MEDIUMTEXT; DECLARE dbname MEDIUMTEXT;
...@@ -776,7 +776,7 @@ END // ...@@ -776,7 +776,7 @@ END //
CREATE procedure `db_17876.archiveGeneralLog`() CREATE procedure `db_17876.archiveGeneralLog`()
BEGIN BEGIN
DECLARE event_time CHAR(20); DECLARE event_time CHAR(28);
DECLARE user_host, argument MEDIUMTEXT; DECLARE user_host, argument MEDIUMTEXT;
DECLARE thread_id, server_id INT; DECLARE thread_id, server_id INT;
DECLARE sql_text BLOB; DECLARE sql_text BLOB;
......
...@@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL ...@@ -66,7 +66,7 @@ CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL
-- Create general_log if CSV is enabled. -- Create general_log if CSV is enabled.
SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL, user_host MEDIUMTEXT NOT NULL, thread_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0');
PREPARE stmt FROM @str; PREPARE stmt FROM @str;
EXECUTE stmt; EXECUTE stmt;
...@@ -74,7 +74,7 @@ DROP PREPARE stmt; ...@@ -74,7 +74,7 @@ DROP PREPARE stmt;
-- Create slow_log if CSV is enabled. -- Create slow_log if CSV is enabled.
SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME NOT NULL, lock_time TIME NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); SET @str = IF (@@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP(6) NOT NULL, user_host MEDIUMTEXT NOT NULL, query_time TIME(6) NOT NULL, lock_time TIME(6) NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0');
PREPARE stmt FROM @str; PREPARE stmt FROM @str;
EXECUTE stmt; EXECUTE stmt;
......
...@@ -222,7 +222,7 @@ ALTER TABLE func ...@@ -222,7 +222,7 @@ ALTER TABLE func
SET @old_log_state = @@global.general_log; SET @old_log_state = @@global.general_log;
SET GLOBAL general_log = 'OFF'; SET GLOBAL general_log = 'OFF';
ALTER TABLE general_log ALTER TABLE general_log
MODIFY event_time TIMESTAMP NOT NULL, MODIFY event_time TIMESTAMP(6) NOT NULL,
MODIFY user_host MEDIUMTEXT NOT NULL, MODIFY user_host MEDIUMTEXT NOT NULL,
MODIFY thread_id INTEGER NOT NULL, MODIFY thread_id INTEGER NOT NULL,
MODIFY server_id INTEGER UNSIGNED NOT NULL, MODIFY server_id INTEGER UNSIGNED NOT NULL,
...@@ -233,10 +233,10 @@ SET GLOBAL general_log = @old_log_state; ...@@ -233,10 +233,10 @@ SET GLOBAL general_log = @old_log_state;
SET @old_log_state = @@global.slow_query_log; SET @old_log_state = @@global.slow_query_log;
SET GLOBAL slow_query_log = 'OFF'; SET GLOBAL slow_query_log = 'OFF';
ALTER TABLE slow_log ALTER TABLE slow_log
MODIFY start_time TIMESTAMP NOT NULL, MODIFY start_time TIMESTAMP(6) NOT NULL,
MODIFY user_host MEDIUMTEXT NOT NULL, MODIFY user_host MEDIUMTEXT NOT NULL,
MODIFY query_time TIME NOT NULL, MODIFY query_time TIME(6) NOT NULL,
MODIFY lock_time TIME NOT NULL, MODIFY lock_time TIME(6) NOT NULL,
MODIFY rows_sent INTEGER NOT NULL, MODIFY rows_sent INTEGER NOT NULL,
MODIFY rows_examined INTEGER NOT NULL, MODIFY rows_examined INTEGER NOT NULL,
MODIFY db VARCHAR(512) NOT NULL, MODIFY db VARCHAR(512) NOT NULL,
......
...@@ -355,7 +355,7 @@ void Log_to_csv_event_handler::cleanup() ...@@ -355,7 +355,7 @@ void Log_to_csv_event_handler::cleanup()
*/ */
bool Log_to_csv_event_handler:: bool Log_to_csv_event_handler::
log_general(THD *thd, time_t event_time, const char *user_host, log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
uint user_host_len, int thread_id, uint user_host_len, int thread_id,
const char *command_type, uint command_type_len, const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len, const char *sql_text, uint sql_text_len,
...@@ -436,7 +436,8 @@ bool Log_to_csv_event_handler:: ...@@ -436,7 +436,8 @@ bool Log_to_csv_event_handler::
DBUG_ASSERT(table->field[0]->type() == MYSQL_TYPE_TIMESTAMP); DBUG_ASSERT(table->field[0]->type() == MYSQL_TYPE_TIMESTAMP);
((Field_timestamp*) table->field[0])->store_TIME((my_time_t) event_time, 0); ((Field_timestamp*) table->field[0])->store_TIME(
hrtime_to_my_time(event_time), hrtime_sec_part(event_time));
/* do a write */ /* do a write */
if (table->field[1]->store(user_host, user_host_len, client_cs) || if (table->field[1]->store(user_host, user_host_len, client_cs) ||
...@@ -500,7 +501,6 @@ bool Log_to_csv_event_handler:: ...@@ -500,7 +501,6 @@ bool Log_to_csv_event_handler::
log_slow() log_slow()
thd THD of the query thd THD of the query
current_time current timestamp current_time current timestamp
query_start_arg command start timestamp
user_host the pointer to the string with user@host info user_host the pointer to the string with user@host info
user_host_len length of the user_host string. this is computed once user_host_len length of the user_host string. this is computed once
and passed to all general log event handlers and passed to all general log event handlers
...@@ -523,7 +523,7 @@ bool Log_to_csv_event_handler:: ...@@ -523,7 +523,7 @@ bool Log_to_csv_event_handler::
*/ */
bool Log_to_csv_event_handler:: bool Log_to_csv_event_handler::
log_slow(THD *thd, time_t current_time, time_t query_start_arg, log_slow(THD *thd, my_hrtime_t current_time,
const char *user_host, uint user_host_len, const char *user_host, uint user_host_len,
ulonglong query_utime, ulonglong lock_utime, bool is_command, ulonglong query_utime, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len) const char *sql_text, uint sql_text_len)
...@@ -537,6 +537,11 @@ bool Log_to_csv_event_handler:: ...@@ -537,6 +537,11 @@ bool Log_to_csv_event_handler::
Open_tables_state open_tables_backup; Open_tables_state open_tables_backup;
CHARSET_INFO *client_cs= thd->variables.character_set_client; CHARSET_INFO *client_cs= thd->variables.character_set_client;
bool save_time_zone_used; bool save_time_zone_used;
long query_time= (long) min(query_utime/1000000, TIME_MAX_VALUE_SECONDS);
long lock_time= (long) min(lock_utime/1000000, TIME_MAX_VALUE_SECONDS);
long query_time_micro= (long) (query_utime % 1000000);
long lock_time_micro= (long) (lock_utime % 1000000);
DBUG_ENTER("Log_to_csv_event_handler::log_slow"); DBUG_ENTER("Log_to_csv_event_handler::log_slow");
thd->push_internal_handler(& error_handler); thd->push_internal_handler(& error_handler);
...@@ -578,44 +583,34 @@ bool Log_to_csv_event_handler:: ...@@ -578,44 +583,34 @@ bool Log_to_csv_event_handler::
/* store the time and user values */ /* store the time and user values */
DBUG_ASSERT(table->field[0]->type() == MYSQL_TYPE_TIMESTAMP); DBUG_ASSERT(table->field[0]->type() == MYSQL_TYPE_TIMESTAMP);
((Field_timestamp*) table->field[0])->store_TIME((my_time_t) current_time, 0); ((Field_timestamp*) table->field[0])->store_TIME(
hrtime_to_my_time(current_time), hrtime_sec_part(current_time));
if (table->field[1]->store(user_host, user_host_len, client_cs)) if (table->field[1]->store(user_host, user_host_len, client_cs))
goto err; goto err;
if (query_start_arg) /*
{ A TIME field can not hold the full longlong range; query_time or
longlong query_time= (longlong) (query_utime/1000000); lock_time may be truncated without warning here, if greater than
longlong lock_time= (longlong) (lock_utime/1000000); 839 hours (~35 days)
/* */
A TIME field can not hold the full longlong range; query_time or MYSQL_TIME t;
lock_time may be truncated without warning here, if greater than t.neg= 0;
839 hours (~35 days)
*/ /* fill in query_time field */
MYSQL_TIME t; calc_time_from_sec(&t, query_time, query_time_micro);
t.neg= 0; if (table->field[2]->store_time(&t, MYSQL_TIMESTAMP_TIME))
goto err;
/* lock_time */
calc_time_from_sec(&t, lock_time, lock_time_micro);
if (table->field[3]->store_time(&t, MYSQL_TIMESTAMP_TIME))
goto err;
/* rows_sent */
if (table->field[4]->store((longlong) thd->sent_row_count, TRUE))
goto err;
/* rows_examined */
if (table->field[5]->store((longlong) thd->examined_row_count, TRUE))
goto err;
/* fill in query_time field */
calc_time_from_sec(&t, (long) min(query_time, (longlong) TIME_MAX_VALUE_SECONDS), 0);
if (table->field[2]->store_time(&t, MYSQL_TIMESTAMP_TIME))
goto err;
/* lock_time */
calc_time_from_sec(&t, (long) min(lock_time, (longlong) TIME_MAX_VALUE_SECONDS), 0);
if (table->field[3]->store_time(&t, MYSQL_TIMESTAMP_TIME))
goto err;
/* rows_sent */
if (table->field[4]->store((longlong) thd->sent_row_count, TRUE))
goto err;
/* rows_examined */
if (table->field[5]->store((longlong) thd->examined_row_count, TRUE))
goto err;
}
else
{
table->field[2]->set_null();
table->field[3]->set_null();
table->field[4]->set_null();
table->field[5]->set_null();
}
/* fill database field */ /* fill database field */
if (thd->db) if (thd->db)
{ {
...@@ -752,14 +747,14 @@ void Log_to_file_event_handler::init_pthread_objects() ...@@ -752,14 +747,14 @@ void Log_to_file_event_handler::init_pthread_objects()
/** Wrapper around MYSQL_LOG::write() for slow log. */ /** Wrapper around MYSQL_LOG::write() for slow log. */
bool Log_to_file_event_handler:: bool Log_to_file_event_handler::
log_slow(THD *thd, time_t current_time, time_t query_start_arg, log_slow(THD *thd, my_hrtime_t current_time,
const char *user_host, uint user_host_len, const char *user_host, uint user_host_len,
ulonglong query_utime, ulonglong lock_utime, bool is_command, ulonglong query_utime, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len) const char *sql_text, uint sql_text_len)
{ {
Silence_log_table_errors error_handler; Silence_log_table_errors error_handler;
thd->push_internal_handler(&error_handler); thd->push_internal_handler(&error_handler);
bool retval= mysql_slow_log.write(thd, current_time, query_start_arg, bool retval= mysql_slow_log.write(thd, hrtime_to_my_time(current_time),
user_host, user_host_len, user_host, user_host_len,
query_utime, lock_utime, is_command, query_utime, lock_utime, is_command,
sql_text, sql_text_len); sql_text, sql_text_len);
...@@ -774,7 +769,7 @@ bool Log_to_file_event_handler:: ...@@ -774,7 +769,7 @@ bool Log_to_file_event_handler::
*/ */
bool Log_to_file_event_handler:: bool Log_to_file_event_handler::
log_general(THD *thd, time_t event_time, const char *user_host, log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
uint user_host_len, int thread_id, uint user_host_len, int thread_id,
const char *command_type, uint command_type_len, const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len, const char *sql_text, uint sql_text_len,
...@@ -782,7 +777,8 @@ bool Log_to_file_event_handler:: ...@@ -782,7 +777,8 @@ bool Log_to_file_event_handler::
{ {
Silence_log_table_errors error_handler; Silence_log_table_errors error_handler;
thd->push_internal_handler(&error_handler); thd->push_internal_handler(&error_handler);
bool retval= mysql_log.write(event_time, user_host, user_host_len, bool retval= mysql_log.write(hrtime_to_time(event_time), user_host,
user_host_len,
thread_id, command_type, command_type_len, thread_id, command_type, command_type_len,
sql_text, sql_text_len); sql_text, sql_text_len);
thd->pop_internal_handler(); thd->pop_internal_handler();
...@@ -969,8 +965,6 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length, ...@@ -969,8 +965,6 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
if (*slow_log_handler_list) if (*slow_log_handler_list)
{ {
time_t current_time;
/* do not log slow queries from replication threads */ /* do not log slow queries from replication threads */
if (thd->slave_thread && !opt_log_slow_slave_statements) if (thd->slave_thread && !opt_log_slow_slave_statements)
return 0; return 0;
...@@ -990,17 +984,12 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length, ...@@ -990,17 +984,12 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
sctx->ip ? sctx->ip : "", "]", NullS) - sctx->ip ? sctx->ip : "", "]", NullS) -
user_host_buff); user_host_buff);
if (thd->start_utime) DBUG_ASSERT(thd->start_utime);
{ DBUG_ASSERT(thd->start_time);
query_utime= (current_utime - thd->start_utime); query_utime= (current_utime - thd->start_utime);
lock_utime= (thd->utime_after_lock - thd->start_utime); lock_utime= (thd->utime_after_lock - thd->start_utime);
current_time= thd->start_time + query_utime/1000000; my_hrtime_t current_time= { hrtime_from_time(thd->start_time) +
} thd->start_time_sec_part + query_utime };
else
{
query_utime= lock_utime= 0;
current_time= my_time(0);
}
if (!query) if (!query)
{ {
...@@ -1011,7 +1000,6 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length, ...@@ -1011,7 +1000,6 @@ bool LOGGER::slow_log_print(THD *thd, const char *query, uint query_length,
for (current_handler= slow_log_handler_list; *current_handler ;) for (current_handler= slow_log_handler_list; *current_handler ;)
error= (*current_handler++)->log_slow(thd, current_time, error= (*current_handler++)->log_slow(thd, current_time,
thd->start_time,
user_host_buff, user_host_len, user_host_buff, user_host_len,
query_utime, lock_utime, is_command, query_utime, lock_utime, is_command,
query, query_length) || error; query, query_length) || error;
...@@ -1029,7 +1017,7 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command, ...@@ -1029,7 +1017,7 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command,
char user_host_buff[MAX_USER_HOST_SIZE + 1]; char user_host_buff[MAX_USER_HOST_SIZE + 1];
Security_context *sctx= thd->security_ctx; Security_context *sctx= thd->security_ctx;
uint user_host_len= 0; uint user_host_len= 0;
time_t current_time; my_hrtime_t current_time;
DBUG_ASSERT(thd); DBUG_ASSERT(thd);
...@@ -1046,7 +1034,7 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command, ...@@ -1046,7 +1034,7 @@ bool LOGGER::general_log_write(THD *thd, enum enum_server_command command,
sctx->ip ? sctx->ip : "", "]", NullS) - sctx->ip ? sctx->ip : "", "]", NullS) -
user_host_buff; user_host_buff;
current_time= my_time(0); current_time= my_hrtime();
while (*current_handler) while (*current_handler)
error|= (*current_handler++)-> error|= (*current_handler++)->
log_general(thd, current_time, user_host_buff, log_general(thd, current_time, user_host_buff,
...@@ -2259,7 +2247,6 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host, ...@@ -2259,7 +2247,6 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
thd THD of the query thd THD of the query
current_time current timestamp current_time current timestamp
query_start_arg command start timestamp
user_host the pointer to the string with user@host info user_host the pointer to the string with user@host info
user_host_len length of the user_host string. this is computed once user_host_len length of the user_host string. this is computed once
and passed to all general log event handlers and passed to all general log event handlers
...@@ -2281,7 +2268,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host, ...@@ -2281,7 +2268,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host,
*/ */
bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time, bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
time_t query_start_arg, const char *user_host, const char *user_host,
uint user_host_len, ulonglong query_utime, uint user_host_len, ulonglong query_utime,
ulonglong lock_utime, bool is_command, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len) const char *sql_text, uint sql_text_len)
......
...@@ -211,7 +211,7 @@ class MYSQL_QUERY_LOG: public MYSQL_LOG ...@@ -211,7 +211,7 @@ class MYSQL_QUERY_LOG: public MYSQL_LOG
uint user_host_len, int thread_id, uint user_host_len, int thread_id,
const char *command_type, uint command_type_len, const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len); const char *sql_text, uint sql_text_len);
bool write(THD *thd, time_t current_time, time_t query_start_arg, bool write(THD *thd, time_t current_time,
const char *user_host, uint user_host_len, const char *user_host, uint user_host_len,
ulonglong query_utime, ulonglong lock_utime, bool is_command, ulonglong query_utime, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len); const char *sql_text, uint sql_text_len);
...@@ -425,14 +425,14 @@ class Log_event_handler ...@@ -425,14 +425,14 @@ class Log_event_handler
virtual bool init()= 0; virtual bool init()= 0;
virtual void cleanup()= 0; virtual void cleanup()= 0;
virtual bool log_slow(THD *thd, time_t current_time, virtual bool log_slow(THD *thd, my_hrtime_t current_time,
time_t query_start_arg, const char *user_host, const char *user_host,
uint user_host_len, ulonglong query_utime, uint user_host_len, ulonglong query_utime,
ulonglong lock_utime, bool is_command, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len)= 0; const char *sql_text, uint sql_text_len)= 0;
virtual bool log_error(enum loglevel level, const char *format, virtual bool log_error(enum loglevel level, const char *format,
va_list args)= 0; va_list args)= 0;
virtual bool log_general(THD *thd, time_t event_time, const char *user_host, virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
uint user_host_len, int thread_id, uint user_host_len, int thread_id,
const char *command_type, uint command_type_len, const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len, const char *sql_text, uint sql_text_len,
...@@ -454,14 +454,14 @@ class Log_to_csv_event_handler: public Log_event_handler ...@@ -454,14 +454,14 @@ class Log_to_csv_event_handler: public Log_event_handler
virtual bool init(); virtual bool init();
virtual void cleanup(); virtual void cleanup();
virtual bool log_slow(THD *thd, time_t current_time, virtual bool log_slow(THD *thd, my_hrtime_t current_time,
time_t query_start_arg, const char *user_host, const char *user_host,
uint user_host_len, ulonglong query_utime, uint user_host_len, ulonglong query_utime,
ulonglong lock_utime, bool is_command, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len); const char *sql_text, uint sql_text_len);
virtual bool log_error(enum loglevel level, const char *format, virtual bool log_error(enum loglevel level, const char *format,
va_list args); va_list args);
virtual bool log_general(THD *thd, time_t event_time, const char *user_host, virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
uint user_host_len, int thread_id, uint user_host_len, int thread_id,
const char *command_type, uint command_type_len, const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len, const char *sql_text, uint sql_text_len,
...@@ -486,14 +486,14 @@ class Log_to_file_event_handler: public Log_event_handler ...@@ -486,14 +486,14 @@ class Log_to_file_event_handler: public Log_event_handler
virtual bool init(); virtual bool init();
virtual void cleanup(); virtual void cleanup();
virtual bool log_slow(THD *thd, time_t current_time, virtual bool log_slow(THD *thd, my_hrtime_t current_time,
time_t query_start_arg, const char *user_host, const char *user_host,
uint user_host_len, ulonglong query_utime, uint user_host_len, ulonglong query_utime,
ulonglong lock_utime, bool is_command, ulonglong lock_utime, bool is_command,
const char *sql_text, uint sql_text_len); const char *sql_text, uint sql_text_len);
virtual bool log_error(enum loglevel level, const char *format, virtual bool log_error(enum loglevel level, const char *format,
va_list args); va_list args);
virtual bool log_general(THD *thd, time_t event_time, const char *user_host, virtual bool log_general(THD *thd, my_hrtime_t event_time, const char *user_host,
uint user_host_len, int thread_id, uint user_host_len, int thread_id,
const char *command_type, uint command_type_len, const char *command_type, uint command_type_len,
const char *sql_text, uint sql_text_len, const char *sql_text, uint sql_text_len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment