diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-05-19 19:19:44 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-05-19 19:19:44 +0200 |
commit | 8767540a43b28c977714e2f35aadcfd1bcefef5f (patch) | |
tree | dd91d0bdef77bbf878cb53e2453042d1b7ff73c6 /scripts | |
parent | f06cac336ba7a27493fc753d2bf37e87137a1cdc (diff) | |
download | mariadb-git-8767540a43b28c977714e2f35aadcfd1bcefef5f.tar.gz |
microseconds in log tables:
TIMESTAMP -> TIMESTAMP(6)
TIME -> TIME(6)
in general_log and slow_log tables.
include/my_sys.h:
use constants
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_system_tables.sql | 4 | ||||
-rw-r--r-- | scripts/mysql_system_tables_fix.sql | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index a81c0964fdd..cc7c1e3fd4b 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -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. -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; EXECUTE stmt; @@ -74,7 +74,7 @@ DROP PREPARE stmt; -- 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; EXECUTE stmt; diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index f8f71861f2f..8e7adb1f0c6 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -222,7 +222,7 @@ ALTER TABLE func SET @old_log_state = @@global.general_log; SET GLOBAL general_log = 'OFF'; ALTER TABLE general_log - MODIFY event_time TIMESTAMP NOT NULL, + MODIFY event_time TIMESTAMP(6) NOT NULL, MODIFY user_host MEDIUMTEXT NOT NULL, MODIFY thread_id INTEGER NOT NULL, MODIFY server_id INTEGER UNSIGNED NOT NULL, @@ -233,10 +233,10 @@ SET GLOBAL general_log = @old_log_state; SET @old_log_state = @@global.slow_query_log; SET GLOBAL slow_query_log = 'OFF'; ALTER TABLE slow_log - MODIFY start_time TIMESTAMP NOT NULL, + MODIFY start_time TIMESTAMP(6) NOT NULL, MODIFY user_host MEDIUMTEXT NOT NULL, - MODIFY query_time TIME NOT NULL, - MODIFY lock_time TIME NOT NULL, + MODIFY query_time TIME(6) NOT NULL, + MODIFY lock_time TIME(6) NOT NULL, MODIFY rows_sent INTEGER NOT NULL, MODIFY rows_examined INTEGER NOT NULL, MODIFY db VARCHAR(512) NOT NULL, |