#At file:///Users/cbell/source/bzr/MS10/ based on revid:charles.bell@stripped
3051 Chuck Bell 2010-01-11
BUG#30938 (BACKUP DATABASE crashes server if a table with a unloaded
SE exists).
Backup of a database failed if it contained a table using invalid storage
engine (e.g. plugin not loaded or unknown engine). This was because code
collecting list of tables in a database (Backup_archive::add_db_items() in
sql_backup.cc) didn't exclude tables without a valid storage engine and later
kernel attempted to open such tables. This patch fixes this by filtering out
tables for which 'engine' field in I_S.TABLES is NULL.
Additionally, the way we access handlerton structure of table's storage engine
has been changed. Before, we located SE plugin sing its name and then read
handlerton pointer from the plugin:
plugin= ::ha_resolve_by_name(::current_thd,&name_lex);
m_hton= plugin ? plugin_data(plugin, handlerton*) : 0;
Now we open a table and read handlerton pointer from opened TABLE structure.
This is safer because it gives the open table code a chance to detect/deal with
non-existent or non-functional storage engines. If a table was opened
successfully we assume that its storage engine is fully functional.
Tables are opened just before they are added to the archive inside
Backup_archive::add_db_items(). Each table is closed after it has been added so
that only one table is open at a time.
original changeset: 2476.776.2
added:
mysql-test/std_data/bug30938.frm
=== added file 'mysql-test/std_data/bug30938.frm'
Binary files a/mysql-test/std_data/bug30938.frm 1970-01-01 00:00:00 +0000 and b/mysql-test/std_data/bug30938.frm 2010-01-11 20:45:04 +0000 differ
Attachment: [text/bzr-bundle] bzr/charles.bell@sun.com-20100111204504-l3qexy20zm4hhgi4.bundle
| Thread |
|---|
| • bzr commit into mysql-backup-backport branch (charles.bell:3051)Bug#30938 | Chuck Bell | 11 Jan |