Bug #58106 Wrong directory info in general_log_file/slow_query_log_file.
Submitted: 10 Nov 2010 10:24 Modified: 10 Nov 2010 11:44
Reporter: Horst Hunger Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.1-bugteam OS:Any
Assigned to: CPU Architecture:Any

[10 Nov 2010 10:24] Horst Hunger
Description:
AN assignment of a variable like "@v", having file and directory infos, to the system variables "general_log_file" or "slow_query_log_file" stores a worng directory info in the system variable. See the following mysql dialog:

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET @start=@@global.slow_query_log_file;
Query OK, 0 rows affected (0.00 sec)           

mysql> select @start;
+---------------------------------------------------------------------------+
| @start                                                                    |
+---------------------------------------------------------------------------+
| /home/horst/bzr/mysql-5.1-bugteam/mysql-test/var/mysqld.1/mysqld-slow.log |
+---------------------------------------------------------------------------+
1 row in set (0.00 sec)                                                      

mysql> SET @@global.slow_query_log_file= 'test.log';
Query OK, 0 rows affected (0.00 sec)                

mysql> select @@global.slow_query_log_file;
+------------------------------+           
| @@global.slow_query_log_file |           
+------------------------------+           
| test.log                     |           
+------------------------------+           
1 row in set (0.00 sec)                    

mysql> SET @@global.slow_query_log_file= @start;
Query OK, 0 rows affected (0.07 sec)            

mysql> select @@global.slow_query_log_file;
+----------------------------------------------------------------------+
| @@global.slow_query_log_file                                         |
+----------------------------------------------------------------------+
| /home/horst/bzr/mysql-5.1-bugteam/mysql-test/var/run/mysqld-slow.log |
+----------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SET @start=@@global.general_log_file;
Query OK, 0 rows affected (0.00 sec)

mysql> select @@global.general_log_file;
+----------------------------------------------------------------------+
| @@global.general_log_file                                            |
+----------------------------------------------------------------------+
| /home/horst/bzr/mysql-5.1-bugteam/mysql-test/var/mysqld.1/mysqld.log |
+----------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> SET @@global.general_log_file='test.log';
Query OK, 0 rows affected (0.03 sec)

mysql> select @@global.general_log_file;
+---------------------------+
| @@global.general_log_file |
+---------------------------+
| test.log                  |
+---------------------------+
1 row in set (0.00 sec)

mysql> SET @@global.general_log_file=@start;
Query OK, 0 rows affected (0.05 sec)

mysql> select @@global.general_log_file;
+-----------------------------------------------------------------+
| @@global.general_log_file                                       |
+-----------------------------------------------------------------+
| /home/horst/bzr/mysql-5.1-bugteam/mysql-test/var/run/mysqld.log |
+-----------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select @start;
+----------------------------------------------------------------------+
| @start                                                               |
+----------------------------------------------------------------------+
| /home/horst/bzr/mysql-5.1-bugteam/mysql-test/var/mysqld.1/mysqld.log |
+----------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> exit
Bye

Please, replace the LET assignment in the sys_vars tests with the corresponding SET assignments:
log_output_func.test,
slow_query_log_file_basic.test and
general_log_file_basic.test.

How to repeat:
repeat the mysql dialog above.

Suggested fix:
In 5.5-bugteam the mysql dialog shows the expected result. So, look at the code there.
[10 Nov 2010 11:44] Sveta Smirnova
Thank you for the reprot.

Verified as described.