#At file:///home/rith/Work/MySQL/Bug51696/ based on revid:hema@stripped
3110 Ritheesh Vedire 2010-03-15
BUG#51696: RESTORE: rename SKIP_GAP_EVENT
SKIP_GAP_EVENT was introduced as an option for RESTORE
to signal discontinuity in the binary log. To make the option
more generic, it was decided to rename SKIP_GAP_EVENT as
SKIP_INCIDENT_EVENT and to eliminate 'gap event' and
its related terms from the backup code.
This patch replaces all the occurrences of 'gap event' with
'incident event'.
@ mysql-test/suite/rpl/r/rpl_backup.result
Updated result file.
@ mysql-test/suite/rpl/t/rpl_backup.test
Replaced SKIP_GAP_EVENT command option with
SKIP_INCIDENT_EVENT command option and updated
the comment.
@ sql/backup/backup_kernel.h
Replaced skip_gap_event variable with skip_incident_event.
@ sql/backup/kernel.cc
Replaced the term skip_gap_event with skip_incident_event
and updated the comment.
@ sql/lex.h
Replaced SKIP_GAP_EVENT and SKIP_GAP_EVENT_SYM with
SKIP_INCIDENT_EVENT and SKIP_INCIDENT_EVENT_SYM
respectively.
@ sql/si_objects.cc
Updated comment.
@ sql/sql_parse.cc
Renamed the 'gap event' variables to
'incident event' variables.
@ sql/sql_yacc.yy
Updated the grammar non-terminals with 'incident event' terms.
modified:
mysql-test/suite/rpl/r/rpl_backup.result
mysql-test/suite/rpl/t/rpl_backup.test
sql/backup/backup_kernel.h
sql/backup/kernel.cc
sql/lex.h
sql/si_objects.cc
sql/sql_parse.cc
sql/sql_yacc.yy
=== modified file 'mysql-test/suite/rpl/r/rpl_backup.result'
--- a/mysql-test/suite/rpl/r/rpl_backup.result 2010-02-11 14:04:43 +0000
+++ b/mysql-test/suite/rpl/r/rpl_backup.result 2010-03-15 09:12:57 +0000
@@ -508,7 +508,7 @@ backup_id
505
# Now let's run the restore and see if the slave stops.
# Backup_id = 506.
-RESTORE FROM 'rpl_bup_m4.bak' OVERWRITE SKIP_GAP_EVENT;
+RESTORE FROM 'rpl_bup_m4.bak' OVERWRITE SKIP_INCIDENT_EVENT;
backup_id
506
# Let's ensure replication is still running.
=== modified file 'mysql-test/suite/rpl/t/rpl_backup.test'
--- a/mysql-test/suite/rpl/t/rpl_backup.test 2010-01-06 15:03:50 +0000
+++ b/mysql-test/suite/rpl/t/rpl_backup.test 2010-03-15 09:12:57 +0000
@@ -502,10 +502,10 @@ SLAVE STOP;
--source include/wait_for_slave_to_stop.inc
#
-# Test case for BUG#39780 - Skip gap event on restore.
+# Test case for BUG#39780 - Skip incident event on restore.
#
-# The new SKIP_GAP_EVENT option for the RESTORE command
-# allows users to purposefully skip writing the gap event
+# The new SKIP_INCIDENT_EVENT option for the RESTORE command
+# allows users to purposefully skip writing the incident event
# when the restore is run on a master and the databases
# being restored do not exist on the slave nor are they
# intended to be on the slave.
@@ -552,7 +552,7 @@ BACKUP DATABASE not_replicated TO 'rpl_b
--echo # Now let's run the restore and see if the slave stops.
--echo # Backup_id = 506.
-RESTORE FROM 'rpl_bup_m4.bak' OVERWRITE SKIP_GAP_EVENT;
+RESTORE FROM 'rpl_bup_m4.bak' OVERWRITE SKIP_INCIDENT_EVENT;
--remove_file $MYSQLD_M_DATADIR/rpl_bup_m4.bak
=== modified file 'sql/backup/backup_kernel.h'
--- a/sql/backup/backup_kernel.h 2010-02-23 22:36:19 +0000
+++ b/sql/backup/backup_kernel.h 2010-03-15 09:12:57 +0000
@@ -34,7 +34,7 @@ int execute_backup_command(THD *thd,
LEX *lex,
String *backupdir,
bool overwrite,
- bool skip_gap_event);
+ bool skip_incident_event);
// Forward declarations.
=== modified file 'sql/backup/kernel.cc'
--- a/sql/backup/kernel.cc 2010-02-23 22:36:19 +0000
+++ b/sql/backup/kernel.cc 2010-03-15 09:12:57 +0000
@@ -168,14 +168,14 @@ static int send_reply(Backup_restore_ctx
/**
Call backup kernel API to execute backup related SQL statement.
- @param[in] thd current thread object reference.
- @param[in] lex results of parsing the statement.
- @param[in] backupdir value of the backupdir variable from server.
- @param[in] overwrite For restore: should overwrite DB with same name.
- For backup: should overwrite backup image file.
- @param[in] skip_gap_event whether or not restore should skip writing
- the gap event if run on a master in an active
- replication scenario
+ @param[in] thd current thread object reference.
+ @param[in] lex results of parsing the statement.
+ @param[in] backupdir value of the backupdir variable from server.
+ @param[in] overwrite For restore: should overwrite DB with same name.
+ For backup: should overwrite backup image file.
+ @param[in] skip_incident_event whether or not restore should skip writing
+ the incident event to the binary log.
+
@note This function sends response to the client (ok, result set or error).
@@ -191,7 +191,7 @@ execute_backup_command(THD *thd,
LEX *lex,
String *backupdir,
bool overwrite,
- bool skip_gap_event)
+ bool skip_incident_event)
{
int res= 0;
@@ -271,7 +271,7 @@ execute_backup_command(THD *thd,
DEBUG_SYNC(thd, "before_restore_prepare");
Restore_info *info= context.prepare_for_restore(backupdir, lex->backup_dir,
- thd->query(), skip_gap_event);
+ thd->query(), skip_incident_event);
// Error code insertion for ER_BACKUP_RESTORE_PREPARE.
DBUG_EXECUTE_IF("ER_BACKUP_RESTORE_PREPARE_2", info= 0;);
@@ -875,10 +875,11 @@ Backup_restore_ctx::prepare_for_backup(S
/**
Prepare for restore operation.
- @param[in] backupdir path to the file where backup image is stored
- @param[in] orig_loc path as specified on command line for backup image
- @param[in] query RESTORE query starting the operation
- @param[in] skip_gap_event TRUE means do not write gap event
+ @param[in] backupdir path to the file where backup image is stored
+ @param[in] orig_loc path as specified on command line for
+ backup image
+ @param[in] query RESTORE query starting the operation
+ @param[in] skip_incident_event TRUE means do not write incident event
@returns Pointer to a @c Restore_info instance containing catalogue of the
backup image (read from the image). NULL if errors were detected.
@@ -890,7 +891,7 @@ Restore_info*
Backup_restore_ctx::prepare_for_restore(String *backupdir,
LEX_STRING orig_loc,
const char *query,
- bool skip_gap_event)
+ bool skip_incident_event)
{
using namespace backup;
@@ -1047,7 +1048,7 @@ Backup_restore_ctx::prepare_for_restore(
obs::disable_slave_connections(TRUE);
DEBUG_SYNC(m_thd, "after_disable_slave_connections");
- if (!skip_gap_event)
+ if (!skip_incident_event)
{
Image_info::Db_iterator *dbit=info->get_dbs();
Image_info::Db *mydb;
=== modified file 'sql/lex.h'
--- a/sql/lex.h 2010-02-24 20:06:17 +0000
+++ b/sql/lex.h 2010-03-15 09:12:57 +0000
@@ -497,7 +497,7 @@ static SYMBOL symbols[] = {
{ "SIGNAL", SYM(SIGNAL_SYM)},
{ "SIGNED", SYM(SIGNED_SYM)},
{ "SIMPLE", SYM(SIMPLE_SYM)},
- { "SKIP_GAP_EVENT", SYM(SKIP_GAP_EVENT_SYM)},
+ { "SKIP_INCIDENT_EVENT", SYM(SKIP_INCIDENT_EVENT_SYM)},
{ "SLAVE", SYM(SLAVE)},
{ "SLOW", SYM(SLOW)},
{ "SNAPSHOT", SYM(SNAPSHOT_SYM)},
=== modified file 'sql/si_objects.cc'
--- a/sql/si_objects.cc 2010-02-23 22:36:19 +0000
+++ b/sql/si_objects.cc 2010-03-15 09:12:57 +0000
@@ -3744,8 +3744,8 @@ int write_incident_event(THD *thd, incid
Incident incident;
/*
- Generate an incident log event (gap event) to signal the slave
- that a restore has been issued on the master.
+ Generate an incident log event to signal the discontinuity
+ in the binary log.
*/
switch (incident_enum){
case NONE:
=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc 2010-02-24 20:06:17 +0000
+++ b/sql/sql_parse.cc 2010-03-15 09:12:57 +0000
@@ -2405,8 +2405,8 @@ case SQLCOM_PREPARE:
*/
bool overwrite_option= false;
- /* Used to specify if RESTORE should skup writing the gap event. */
- bool skip_gap_event= false;
+ /* Used to specify if RESTORE should skip writing the incident event. */
+ bool skip_incident_event= false;
List<Item> lit= lex->value_list;
Item *it= 0;
@@ -2429,9 +2429,9 @@ case SQLCOM_PREPARE:
case 1:
overwrite_option= true;
break;
- /* SKIP GAP EVENT option */
+ /* SKIP_INCIDENT_EVENT option */
case 2:
- skip_gap_event= true;
+ skip_incident_event= true;
break;
}
}
@@ -2440,7 +2440,7 @@ case SQLCOM_PREPARE:
(either ok, result set or error message).
*/
res= execute_backup_command(thd, lex, &backupdir, overwrite_option,
- skip_gap_event);
+ skip_incident_event);
thd->backup_in_progress= saved_backup_in_progress;
if (res)
goto error;
=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy 2010-02-24 20:06:17 +0000
+++ b/sql/sql_yacc.yy 2010-03-15 09:12:57 +0000
@@ -1253,7 +1253,7 @@ bool my_yyoverflow(short **a, YYSTYPE **
%token SIGNAL_SYM /* SQL-2003-R */
%token SIGNED_SYM
%token SIMPLE_SYM /* SQL-2003-N */
-%token SKIP_GAP_EVENT_SYM
+%token SKIP_INCIDENT_EVENT_SYM
%token SLAVE
%token SLOW
%token SMALLINT /* SQL-2003-R */
@@ -6854,7 +6854,7 @@ restore:
}
FROM
TEXT_STRING_sys
- opt_overwrite opt_skip_gap_event
+ opt_overwrite opt_skip_incident_event
{
Lex->backup_dir = $4;
}
@@ -6879,7 +6879,7 @@ opt_overwrite:
}
;
-opt_skip_gap_event:
+opt_skip_incident_event:
/* empty */
{
LEX *lex= Lex;
@@ -6887,7 +6887,7 @@ opt_skip_gap_event:
lex->value_list.push_back(it);
}
- | SKIP_GAP_EVENT_SYM
+ | SKIP_INCIDENT_EVENT_SYM
{
LEX *lex= Lex;
Item *it= new Item_int((int8) 2);
Attachment: [text/bzr-bundle]
Thread |
---|
• bzr commit into mysql-next-mr-backup branch (ritheesh.vedire:3110)Bug#51696 | Ritheesh Vedire | 15 Mar |