Bug #53766 No error message issued when backing up non existing db / tables using ibbackup
Submitted: 18 May 2010 21:25 Modified: 9 Jan 2015 16:26
Reporter: Hema Sridharan Email Updates:
Status: Unsupported Impact on me:
None 
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:mysql-5.1-meb, MEB 3.1.0 OS:Any
Assigned to: CPU Architecture:Any

[18 May 2010 21:25] Hema Sridharan
Description:
* Create database dbb and InnoDB tables td1 and tf1
* Now execute backup for non existing table t1 using "include regexp" option of ibbackup tool.
* The result is that ibbackup successfully passes without any error message. This will mislead the users. Ideally, the user should expect an error message when trying to backup tables / databases that does not exist. 

How to repeat:
mysql> CREATE DATABASE dbb;
Query OK, 1 row affected (0.00 sec)

mysql> CREATE TABLE dbb.td1(id INT)ENGINE=INNODB;
Query OK, 0 rows affected (0.14 sec)

mysql> INSERT INTO dbb.td1 VALUES (1),(2),(3),(4),(5),(6),(7),(8),
    -> (9),(10),(11),(12),(13),(14),(15);
Query OK, 15 rows affected (0.01 sec)
Records: 15  Duplicates: 0  Warnings: 0

mysql> CREATE TABLE dbb.tf1(id int)ENGINE=INNODB;
Query OK, 0 rows affected (0.13 sec)

mysql> INSERT INTO dbb.tf1 VALUES(10),(20);
Query OK, 2 rows affected (0.03 sec)
Records: 2  Duplicates: 0  Warnings: 0

Now execute ibbackup for non existing table t1 in dbb
------------------------------------------------------------------------
[hs221732@fimafeng10]/export/home2/tmp/mysql-5.1-meb/mysql-test/suite/meb/include: ./ibbackup --include 'dbb\.t1.*' source-inno.cnf backup-inno.cnf
MySQL Enterprise Backup version 3.1.0
Copyright (c) 2002, 2010, Oracle and/or its affiliates.
Type ibbackup --license for detailed license terms, --help for help

Contents of source-inno.cnf:
innodb_data_home_dir got value /export/home2/tmp/mysql-5.1-meb/mysql-test/var/mysqld.1/data/
innodb_data_file_path got value ibdata1:10M:autoextend
datadir got value /export/home2/tmp/mysql-5.1-meb/mysql-test/var/mysqld.1/data/
innodb_log_group_home_dir got value /export/home2/tmp/mysql-5.1-meb/mysql-test/var/mysqld.1/data/
innodb_log_files_in_group got value 2
innodb_log_file_size got value 5242880

Contents of backup-inno.cnf:
innodb_data_home_dir got value /export/home2/tmp/mysql-5.1-meb/mysql-test/backup
innodb_data_file_path got value ibdata1:10M:autoextend
datadir got value /export/home2/tmp/mysql-5.1-meb/mysql-test/backup
innodb_log_group_home_dir got value /export/home2/tmp/mysql-5.1-meb/mysql-test/backup
innodb_log_files_in_group got value 2
innodb_log_file_size got value 20971520

Value of include option: 'dbb\.t1.*'

ibbackup: Found checkpoint at lsn 0 50914
ibbackup: Starting log scan from lsn 0 50688
100518 22:30:55  ibbackup: Copying log...
100518 22:30:55  ibbackup: Log copied, lsn 0 50914
ibbackup: We wait 1 second before starting copying the data files...
100518 22:30:56  ibbackup: Copying /export/home2/tmp/mysql-5.1-meb/mysql-test/var/mysqld.1/data/ibdata1
ibbackup: A copied database page was modified at 0 50914
ibbackup: Scanned log up to lsn 0 50914
ibbackup: Was able to parse the log up to lsn 0 50914
ibbackup: Maximum page number for a log record 0
100518 22:30:57  ibbackup: Full backup completed!
--------------------------------------------------------------------------

Note: 
* Backup gets completed successfully with out issuing error message.
* Test successfully passes even for combination ofnon existing database + table

The backup directory shows the following,
ibbackup_logfile  ibdata1
[28 May 2010 6:47] Sveta Smirnova
Thank you for the report.

Verified as described.
[2 Jun 2010 22:05] Hema Sridharan
Note that --include option behaves the same way for innobackup also