1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Make mysqlbinlog omit redundant use around BEGIN/SAVEPOINT/COMMIT/ROLLBACK in 5.0 binlogs

This is a merge of percona patch mysqlbinlog_fix.patch.

Apparently, MySQL 5.0 does not flag BEGIN/SAVEPOINT/COMMIT/ROLLBACK statements
in its binlogs with LOG_EVENT_SUPPRESS_USE_F like 5.1+ does. This causes
unnecessary `use` statements around such statements when the binlog is dumped
by mysqlbinlog.

Fix by always suppressing the output of `use` for these statements.
This commit is contained in:
unknown
2011-01-13 14:15:07 +01:00
parent bacb41a6b7
commit a5b05b45f2
2 changed files with 15 additions and 8 deletions

View File

@ -842,8 +842,19 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case QUERY_EVENT:
{
Query_log_event *qe= (Query_log_event*)ev;
if (!qe->is_trans_keyword() && shall_skip_database(qe->db))
goto end;
if (!qe->is_trans_keyword())
{
if (shall_skip_database(qe->db))
goto end;
}
else
{
/*
In case the event for one of these statements is obtained
from binary log 5.0, make it compatible with 5.1
*/
qe->flags|= LOG_EVENT_SUPPRESS_USE_F;
}
print_use_stmt(print_event_info, qe->db, qe->db_len);
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{