1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-05 12:42:17 +03:00

MWL#234: After-review fixes, including better names for the new system variables.

This commit is contained in:
unknown
2011-08-12 13:18:34 +02:00
parent c4d69f1775
commit b1a13cb15a
12 changed files with 178 additions and 160 deletions

View File

@ -671,7 +671,7 @@ print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
/**
Print "SET do_not_replicate=..." statement when needed.
Print "SET skip_replication=..." statement when needed.
Not all servers support this (only MariaDB from some version on). So we
mark the SET to only execute from the version of MariaDB that supports it,
@ -679,20 +679,20 @@ print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
get spurious errors on MySQL@Oracle servers of higher version that do not
support the flag.
So we start out assuming @@do_not_replicate is 0, and only output a SET
So we start out assuming @@skip_replication is 0, and only output a SET
statement when it changes.
*/
static void
print_do_not_replicate_statement(PRINT_EVENT_INFO *pinfo, const Log_event *ev)
print_skip_replication_statement(PRINT_EVENT_INFO *pinfo, const Log_event *ev)
{
int cur_val;
cur_val= (ev->flags & LOG_EVENT_DO_NOT_REPLICATE_F) != 0;
if (cur_val == pinfo->do_not_replicate)
cur_val= (ev->flags & LOG_EVENT_SKIP_REPLICATION_F) != 0;
if (cur_val == pinfo->skip_replication)
return; /* Not changed. */
fprintf(result_file, "/*!50400 SET do_not_replicate=%d*/%s\n",
fprintf(result_file, "/*!50400 SET skip_replication=%d*/%s\n",
cur_val, pinfo->delimiter);
pinfo->do_not_replicate= cur_val;
pinfo->skip_replication= cur_val;
}
/**
@ -828,7 +828,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
else
{
print_do_not_replicate_statement(print_event_info, ev);
print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info);
}
break;
@ -861,7 +861,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
else
{
print_do_not_replicate_statement(print_event_info, ev);
print_skip_replication_statement(print_event_info, ev);
ce->print(result_file, print_event_info, TRUE);
}
@ -958,10 +958,10 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
if (!shall_skip_database(exlq->db))
{
print_use_stmt(print_event_info, exlq);
print_do_not_replicate_statement(print_event_info, ev);
if (fname)
{
convert_path_to_forward_slashes(fname);
print_skip_replication_statement(print_event_info, ev);
exlq->print(result_file, print_event_info, fname);
}
else
@ -1062,13 +1062,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
/* FALL THROUGH */
}
case INTVAR_EVENT:
case RAND_EVENT:
case USER_VAR_EVENT:
case XID_EVENT:
print_do_not_replicate_statement(print_event_info, ev);
/* Fall through ... */
default:
print_skip_replication_statement(print_event_info, ev);
ev->print(result_file, print_event_info);
}
}