Bug #54743 Use of special characters in backup dir results in innobackup to fail
Submitted: 23 Jun 2010 15:17 Modified: 9 Jan 2015 16:02
Reporter: Hema Sridharan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:mysql-5.1-meb, MEB 3.1.0, MEB 3.5 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[23 Jun 2010 15:17] Hema Sridharan
Description:
Create database and tables
Create backup directory name that has some special characters in it. Something like 'meb!@%^*_-+=~{}[],?:dir'
Execute innobackup and backup fails for some characters that includes 
&, #, (, ), <, >, ", \ , /, $, ;

Also note that test passes for other special characters including *, %, !, @, ^, +, =, ~, _, -, { , } , ?, . , , ,:

How to repeat:
Please find 2 attached test cases where one test passes and other one fails. Both test uses different set of special characters.

Suggested fix:
There is no documentation about support of special characters in MEB manuals. So I executed few tests to see if these characters are supported and noticed from the results of backup that some of them are supported and some of them are not.

Ideally when MEB supports these characters usage in backup directory names, I would expect the support for all special characters, which is not the case currently. Unix supports all the characters in a directory name and we expect to get the same behaviour in MEB directory names.
[23 Jun 2010 15:18] Hema Sridharan
Find the test attached where special chars are used in backup dir name that passes

Attachment: inb_chars1.test (application/test, text), 2.75 KiB.

[23 Jun 2010 15:18] Hema Sridharan
Find the test attached where special chars are used in backup dir name that  fails

Attachment: inb_chars2.test (application/test, text), 2.74 KiB.

[23 Jun 2010 19:55] Sveta Smirnova
Thank you for the report.

With which error fails problem test?

I ask because if I use it not modified it fails with 

mysqltest: At line 18: Empty variable

But if I modify 

--let BACKUP_TARGET_DIR = $MYSQLTEST_VARDIR/tmp/'#()<>&;$'

to

--let BACKUP_TARGET_DIR = $MYSQLTEST_VARDIR/tmp/'#()<>&;\$'

it fails with 

mysqltest: At line 52: command "$INNOBACKUP --port=$MASTER_MYPORT --user=root --no-timestamp $SERVER_CNF $BACKUP_TARGET_DIR > $BACKUP_LOG 2>&1" failed

Output from before failure:
exec of 'perl suite/meb/include/innobackup.pl perl -w /users/ssmirnova/blade12/src/innodb-innobackup/innobackup --ibbackup=/users/ssmirnova/blade12/src/mysql_enterprise_backup-3.1/back/ibbackup --port=130
00 --user=root --no-timestamp /users/ssmirnova/blade12/src/mysql-5.1-meb/mysql-test/var/my.cnf /users/ssmirnova/blade12/src/mysql-5.1-meb/mysql-test/var/tmp/'#()<>&;$' > /users/ssmirnova/blade12/src/mysql
-5.1-meb/mysql-test/var/tmp/backup.log 2>&1' failed, error: 512, status: 2, errno: 0

Which looks like failure you wanted to show. Please confirm or reject if I test in the right way.
[23 Jun 2010 20:03] Hema Sridharan
Sveta,

This is correct. When I run the test, I get an error as
'CURRENT_TEST: meb.inb_chars2
mysqltest: At line 18: Empty variable'

The use of characters '\' and '/' gives different error altogether, so please don't use that. Even the mkdir fails when using these 2 characters.

Excluding the above 2 chars and use rest of the characters gives error as "Empty Variable"
[24 Jun 2010 5:27] Sveta Smirnova
Hema,

this is not MEB bug in this case. "Empty variable" error is easily repeatable with one-line test:

--let BACKUP_TARGET_DIR = $MYSQLTEST_VARDIR/tmp/'#()<>&;$'

So this is rather MTR syntax.
[24 Jun 2010 16:55] Hema Sridharan
Hi Sveta,

I performed some manual testing using special characters in the backup dir name.

I get the following results
-----------------------------------------------------------------
$: /innobackup /home/hs221732/hotbackup/source-inno.cnf --no-timestamp /tmp/'meb#<>:dir' --socket=/export/home/tmp/MEB/mysql-5.1-meb-wl5376/mysql-test/var/tmp/mysqld.1.sock --user=root --ibbackup=/home/hs221732/hotbackup/3.5/back/ibbackup

InnoDB Backup Utility v1.7-beta1; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.

This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.

IMPORTANT: Please check that the backup run completes successfully.
           At the end of a successful backup run innobackup
           prints "innobackup completed OK!".

innobackup: Using mysql  Ver 14.12 Distrib 5.0.22, for redhat-linux-gnu (x86_64) using readline 5.0
innobackup: Using mysql server version 5.1.47-debug-log
innobackup: Using InnoDB Hot Backup 3.5-beta7

innobackup: Created backup directory /tmp/meb#<>:dir
100624 18:35:16  innobackup: Starting mysql with options:  --unbuffered --user=root --socket=/export/home/tmp/MEB/mysql-5.1-meb-wl5376/mysql-test/var/tmp/mysqld.1.sock
100624 18:35:16  innobackup: Connected to database with mysql child process (pid=21286)
sh: :dir/mysql-stdout: No such file or directory
sh: :dir/mysql-stderr: No such file or directory
innobackup: Error: mysql child process has died:  at ./innobackup line 925.

--------------------------------------------------------------------

From the above we can see that, although the backup dir name gets created, innobackup does not proceed further due to error in line 925.

Please note that innobackup fails for only some of the special characters as mentioned in description.

In such case, I request you to please verify this bug again.

Thanks,
Hema.S