2014-11-01 17:21:55 |
Elena Stepanova |
description |
MySQL [test]> set global general_log = 1, log_output = 'TABLE';
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> exit
Bye
# Better do it in 2 sessions, to avoid the problems caused by the other bug with global variables
$ ml test --port=3307
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.6.21-69.0-debug-log Source distribution
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [test]> select @@sql_log_off;
+---------------+
| @@sql_log_off |
+---------------+
| 0 |
+---------------+
1 row in set (0.00 sec)
MySQL [test]> truncate table mysql.general_log;
Query OK, 0 rows affected (0.19 sec)
MySQL [test]> select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.13 sec)
MySQL [test]> set statement SQL_LOG_OFF = 1 for select 2;
+---+
| 2 |
+---+
| 2 |
+---+
1 row in set (0.00 sec)
MySQL [test]> set SQL_LOG_OFF = 1;
Query OK, 0 rows affected (0.01 sec)
MySQL [test]> select 3;
+---+
| 3 |
+---+
| 3 |
+---+
1 row in set (0.00 sec)
MySQL [test]> select * from mysql.general_log;
+---------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
| event_time | user_host | thread_id | server_id | command_type | argument |
+---------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
| 2014-11-01 21:17:32 | root[root] @ localhost [::1] | 21 | 1 | Query | select 1 |
| 2014-11-01 21:17:32 | root[root] @ localhost [::1] | 21 | 1 | Query | set statement SQL_LOG_OFF = 1 for select 2 |
| 2014-11-01 21:17:32 | root[root] @ localhost [::1] | 21 | 1 | Query | set SQL_LOG_OFF = 1 |
+---------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
3 rows in set (0.00 sec) |
MySQL [test]> set global general_log = 1, log_output = 'TABLE';
Query OK, 0 rows affected (0.00 sec)
MySQL [test]> exit
Bye
# Better do it in 2 sessions, to avoid the problems caused by the other bug with global variables
$ ml test --port=3307
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.6.21-69.0-debug-log Source distribution
Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [test]> select @@sql_log_off;
+---------------+
| @@sql_log_off |
+---------------+
| 0 |
+---------------+
1 row in set (0.00 sec)
MySQL [test]> truncate table mysql.general_log;
Query OK, 0 rows affected (0.19 sec)
MySQL [test]> select 1;
+---+
| 1 |
+---+
| 1 |
+---+
1 row in set (0.13 sec)
MySQL [test]> set statement SQL_LOG_OFF = 1 for select 2;
+---+
| 2 |
+---+
| 2 |
+---+
1 row in set (0.00 sec)
MySQL [test]> set SQL_LOG_OFF = 1;
Query OK, 0 rows affected (0.01 sec)
MySQL [test]> select 3;
+---+
| 3 |
+---+
| 3 |
+---+
1 row in set (0.00 sec)
MySQL [test]> select * from mysql.general_log;
+---------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
| event_time | user_host | thread_id | server_id | command_type | argument |
+---------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
| 2014-11-01 21:17:32 | root[root] @ localhost [::1] | 21 | 1 | Query | select 1 |
| 2014-11-01 21:17:32 | root[root] @ localhost [::1] | 21 | 1 | Query | set statement SQL_LOG_OFF = 1 for select 2 |
| 2014-11-01 21:17:32 | root[root] @ localhost [::1] | 21 | 1 | Query | set SQL_LOG_OFF = 1 |
+---------------------+------------------------------+-----------+-----------+--------------+--------------------------------------------+
3 rows in set (0.00 sec)
Logging to file is also affected, table is just simpler for a test case. |
|