Bug #39344 CLI error when using log_backup_output=TABLE option.
Submitted: 9 Sep 2008 15:40 Modified: 3 Mar 2009 14:30
Reporter: Hema Sridharan Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Backup Severity:S3 (Non-critical)
Version:mysql-6.0-backup OS:Linux
Assigned to: Chuck Bell CPU Architecture:Any

[9 Sep 2008 15:40] Hema Sridharan
Description:
New command line options for Backup:
--log_backup_output        : Specifies log output as 
                             [NONE|FILE|TABLE|FILE,TABLE]
                             Default is TABLE.

When we use set global log_backup_output=table, the command errors out. This does not happen for the the options of FILE and NONE.

How to repeat:
mysql> set global log_backup_output=FILE;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'log_backup_output';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| log_backup_output | FILE  |
+-------------------+-------+
1 row in set (0.00 sec)

mysql> set global log_backup_output=NONE;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'log_backup_output';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| log_backup_output | NONE  |
+-------------------+-------+
1 row in set (0.00 sec)

mysql> set global log_backup_output=TABLE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE' at line 1
mysql> set global log_backup_output=FILE,TABLE;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE' at line 1

Workaround will be to use quotes in the 'TABLE' and 'FILE,TABLE' option.

mysql> set global log_backup_output='TABLE';
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'log_backup_output';
+-------------------+-------+
| Variable_name     | Value |
+-------------------+-------+
| log_backup_output | TABLE |
+-------------------+-------+
1 row in set (0.00 sec)

mysql> set global log_backup_output='FILE,TABLE';
Query OK, 0 rows affected (0.00 sec)
mysql> show variables like 'log_backup_output';
+-------------------+------------+
| Variable_name     | Value      |
+-------------------+------------+
| log_backup_output | FILE,TABLE |
+-------------------+------------+
1 row in set (0.00 sec)

The TABLE option should also work without using quotes.

Note: When we leave a blank space between FILE,TABLE option, error occurs:
mysql> set global log_backup_output='FILE, TABLE';
ERROR 1231 (42000): Variable 'log_backup_output' can't be set to the value of ' TABLE'
[3 Mar 2009 1:51] Chuck Bell
The behavior is normal. One should always use quotes when assigning variables that accept strings. This can be seen with the log_output variable.
[3 Mar 2009 14:30] Chuck Bell
This works as designed.
[3 Mar 2009 17:47] Philip Stoev
The reason TABLE does not work and FILE works is that TABLE is a reserved SQL word. This means that it can not appear stand-alone without quotes in an SQL string without confusing the parser.

To the best of my knowledge, there is no easy way to fix this without ugly hacks into the lexer and the parser.