#At file:///home/rith/Work/MySQL/mysql-6.0-backup/ based on revid:charles.bell@stripped
2932 Ritheesh Vedire 2010-01-13
BUG#49398: Incorrect 1691 Can't open the backup logs as tables
error on BACKUP/RESTORE.
simple_open_n_lock_tables(..) was used to check if backup tables
are alright in MYSQL_BACKUP_LOG::check_backup_logs().
During LTM_LOCK_TABLES mode, backup log tables cannot be opened.
This patch makes the backup log tables to be opened even in LOCK_TABLES mode.
@ sql/log.cc
Replaced simple_open_n_lock_tables(...) with
open_performance_schema_table(...). The latter function backs up the
open tables state, making backup log tables to be opened even in LOCK_TABLES
mode.
modified:
sql/log.cc
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2009-12-23 16:01:48 +0000
+++ b/sql/log.cc 2010-01-13 05:22:05 +0000
@@ -4151,6 +4151,12 @@ my_bool MYSQL_BACKUP_LOG::check_backup_l
{
TABLE_LIST tables;
my_bool ret= FALSE;
+ TABLE *backup_log_table;
+ /*
+ Variable to reset and backup open tables state.
+ See open_performace_schema_table(..)
+ */
+ Open_tables_state open_tables_backup;
DBUG_ENTER("check_backup_logs");
@@ -4164,9 +4170,9 @@ my_bool MYSQL_BACKUP_LOG::check_backup_l
tables.init_one_table("mysql", strlen("mysql"),
"backup_history", strlen("backup_history"),
"backup_history", TL_READ);
- if (simple_open_n_lock_tables(thd, &tables))
+ if (!(backup_log_table= open_performance_schema_table(thd,
+ &tables, &open_tables_backup)))
{
- close_thread_tables(thd);
/*
Here we wish to change the error that is generated by the open method,
"table does not exist" to a specific error message for missing
@@ -4181,15 +4187,15 @@ my_bool MYSQL_BACKUP_LOG::check_backup_l
NULL);
DBUG_RETURN(ret);
}
- close_thread_tables(thd);
+ close_performance_schema_table(thd, &open_tables_backup);
/* Check mysql.backup_progress */
tables.init_one_table("mysql", strlen("mysql"),
"backup_progress", strlen("backup_progress"),
"backup_progress", TL_READ);
- if (simple_open_n_lock_tables(thd, &tables))
+ if (!(backup_log_table= open_performance_schema_table(thd,
+ &tables, &open_tables_backup)))
{
- close_thread_tables(thd);
/*
Here we wish to change the error that is generated by the open method,
"table does not exist" to a specific error message for missing
@@ -4204,7 +4210,7 @@ my_bool MYSQL_BACKUP_LOG::check_backup_l
NULL);
DBUG_RETURN(ret);
}
- close_thread_tables(thd);
+ close_performance_schema_table(thd, &open_tables_backup);
DBUG_RETURN(ret);
}
Attachment: [text/bzr-bundle]