Bug #58116 "SET GLOBAL slow_query_log := ON" does not work for files
Submitted: 10 Nov 2010 16:02 Modified: 10 Nov 2010 16:07
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.48 OS:Linux
Assigned to: CPU Architecture:Any

[10 Nov 2010 16:02] Christian Hammers
Description:
The slow_query_log and slow_query_log_file are listet as dynamic variable in 
http://dev.mysql.com/doc/refman/5.1/en/dynamic-system-variables.html
and thus it should be possible to enable them at runtime without having to restart
the server. That does not work.

How to repeat:
mysql> SET GLOBAL slow_query_log := ON;
ERROR 1146 (42S02): Table 'mysql.slow_log' doesn't exist

mysql> SET GLOBAL log_slow_queries := ON;
ERROR 1146 (42S02): Table 'mysql.slow_log' doesn't exist

mysql> SHOW VARIABLES LIKE "%log%";
+-----------------------------------------+--------------------------------+
| Variable_name                           | Value                          |
+-----------------------------------------+--------------------------------+
| back_log                                | 50                             |
| binlog_cache_size                       | 32768                          |
| binlog_direct_non_transactional_updates | OFF                            |
| binlog_format                           | STATEMENT                      |
| expire_logs_days                        | 10                             |
| general_log                             | OFF                            |
| general_log_file                        | /var/run/mysqld/mysqld.log     |
| innodb_flush_log_at_trx_commit          | 1                              |
| innodb_locks_unsafe_for_binlog          | OFF                            |
| innodb_log_buffer_size                  | 1048576                        |
| innodb_log_file_size                    | 104857600                      |
| innodb_log_files_in_group               | 2                              |
| innodb_log_group_home_dir               | ./                             |
| innodb_mirrored_log_groups              | 1                              |
| log                                     | OFF                            |
| log_bin                                 | ON                             |
| log_bin_trust_function_creators         | OFF                            |
| log_bin_trust_routine_creators          | OFF                            |
| log_error                               | /srv/mysql/cc-maildb2-test.err |
| log_output                              | FILE                           |
| log_queries_not_using_indexes           | OFF                            |
| log_slave_updates                       | OFF                            |
| log_slow_queries                        | OFF                            |
| log_warnings                            | 1                              |
| max_binlog_cache_size                   | 18446744073709547520           |
| max_binlog_size                         | 1073741824                     |
| max_relay_log_size                      | 0                              |
| relay_log                               | /srv/mysql/mysqld-relay-bin    |
| relay_log_index                         |                                |
| relay_log_info_file                     | relay-log.info                 |
| relay_log_purge                         | ON                             |
| relay_log_space_limit                   | 0                              |
| slow_query_log                          | OFF                            |
| slow_query_log_file                     | /var/log/mysql/mysql-slow.log  |
| sql_log_bin                             | ON                             |
| sql_log_off                             | OFF                            |
| sql_log_update                          | ON                             |
| sync_binlog                             | 0                              |
+-----------------------------------------+--------------------------------+
38 rows in set (0.00 sec)

mysql> select version();
+------------+
| version()  |
+------------+
| 5.1.48-log |
+------------+
1 row in set (0.28 sec)
[10 Nov 2010 16:07] Christian Hammers
Hm, it does work though if I create the missing slow_low table. It is not used but it seems to be neccessary. Don't know why mysql_install_db did not create it.