Bug #58150 MEB: Restore does not issue warning msg if character set is missing from server
Submitted: 11 Nov 2010 23:44 Modified: 19 Nov 2010 18:37
Reporter: Hema Sridharan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Enterprise Backup Severity:S3 (Non-critical)
Version:MEB 3.5.next OS:Linux
Assigned to: Assigned Account CPU Architecture:Any

[11 Nov 2010 23:44] Hema Sridharan
Description:
Create databases and tables.
Create table columns using different character sets like cp1251 and 
collation cp1251_general_ci
Load some data in tables.
Execute MySQL Enterprise backup(ibbackup)
Verify the charset and collations of tables using information_schema 
database

Now delete the cp1251 charset from mysql server and then execute the 
restore operation.
Restore will be successful and not even issue a warning message about 
missing character set .
The tables created using this character set will not be usable after 
restore.

Ideally, restore should issue a warning message about the missing 
character set as some tables are created using this charset.

How to repeat:
Please find the attached test case to reproduce the behaviour.

The result of the test case shows

....
....
....
# Restart server.

SHOW DATABASES;
Database
information_schema
db2
db3
mtr
mysql
test
SHOW TABLES FROM db2;
Tables_in_db2
t1
SHOW TABLES FROM db3;
Tables_in_db3
t1
SELECT * FROM db2.t1;
id      a
1       po
2       hh
meb.charset                              [ fail ]
       Test ended at 2010-11-11 22:25:07

CURRENT_TEST: meb.charset
mysqltest: At line 101: query 'SELECT * FROM db3.t1' failed: 1273: 
Unknown collation 'cp1251_general_ci' in table 't1' definition

From the above, we can notice that table db3.t1 becomes unusable as 
character set cp1251 is deleted. Ideally restore should warn user about 
the missing character set atleast at the point where there are some 
tables created using same char set in the restored db.
[11 Nov 2010 23:46] Hema Sridharan
Test case to reproduce the error

Attachment: charset_bug.test..txt (text/plain), 2.91 KiB.

[16 Nov 2010 14:26] Satya B
Our restore is 'offline'. So we can't do much to warn about the missing charset files.

Some of the solutions can be:
-----------------------------

Backup checksums:
-----------------
When Backup checksum is implemented, we can detect the checksum doesn't match at restore stage and flag an error.

But this is WORSE because we now refuse to start because of missing charset which might be used by only some tables.

Backup Manifest File:
---------------------
After WL#5511, We have detailed list of files backed up, So any file missing at restore can be verified and flag a warning or error. But this is another feature request/WL.