summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
author <Li-Bing.Song@sun.com>2010-03-28 19:57:33 +0800
committer <Li-Bing.Song@sun.com>2010-03-28 19:57:33 +0800
commit2049d1afc05ae8164353263f6e9ae7c0cd9b961b (patch)
tree656156db7cdeef9ce027bbc4cd40c78d35b284f9 /client/mysqlbinlog.cc
parent8d22c5f3efe4ab127cbe7bc3064b856e9f4849ff (diff)
downloadmariadb-git-2049d1afc05ae8164353263f6e9ae7c0cd9b961b.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.cc4
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)