diff options
author | unknown <Li-Bing.Song@sun.com> | 2010-03-28 19:57:33 +0800 |
---|---|---|
committer | unknown <Li-Bing.Song@sun.com> | 2010-03-28 19:57:33 +0800 |
commit | 454c003a5c5a31a8d59ba4ab54d3b3a90a609752 (patch) | |
tree | 656156db7cdeef9ce027bbc4cd40c78d35b284f9 /client/mysqlbinlog.cc | |
parent | 4775601012f81655643667d8635e46de120be7ae (diff) | |
download | mariadb-git-454c003a5c5a31a8d59ba4ab54d3b3a90a609752.tar.gz |
Bug #50407 mysqlbinlog --database=X produces bad output for SAVEPOINTs
When mysqlbinlog was given the --database=X flag, it always printed
'ROLLBACK TO', but the corresponding 'SAVEPOINT' statement was not
printed. The replicated filter(replicated-do/ignore-db) and binlog
filter (binlog-do/ignore-db) has the same problem. They are solved
in this patch together.
After this patch, We always check whether the query is 'SAVEPOINT'
statement or not. Because this is a literal check, 'SAVEPOINT' and
'ROLLBACK TO' statements are also binlogged in uppercase with no
any comments.
The binlog before this patch can be handled correctly except one case
that any comments are in front of the keywords. for example:
/* bla bla */ SAVEPOINT a;
/* bla bla */ ROLLBACK TO a;
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r-- | client/mysqlbinlog.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ada22f19a65..c8b9a7d34c5 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -730,9 +730,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev, switch (ev_type) { case QUERY_EVENT: - if (strncmp(((Query_log_event*)ev)->query, "BEGIN", 5) && - strncmp(((Query_log_event*)ev)->query, "COMMIT", 6) && - strncmp(((Query_log_event*)ev)->query, "ROLLBACK", 8) && + if (!((Query_log_event*)ev)->is_trans_keyword() && shall_skip_database(((Query_log_event*)ev)->db)) goto end; if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS) |