summaryrefslogtreecommitdiff
path: root/sql/log_event.cc
diff options
context:
space:
mode:
authorunknown <Li-Bing.Song@sun.com>2010-03-28 19:57:33 +0800
committerunknown <Li-Bing.Song@sun.com>2010-03-28 19:57:33 +0800
commit454c003a5c5a31a8d59ba4ab54d3b3a90a609752 (patch)
tree656156db7cdeef9ce027bbc4cd40c78d35b284f9 /sql/log_event.cc
parent4775601012f81655643667d8635e46de120be7ae (diff)
downloadmariadb-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 'sql/log_event.cc')
-rw-r--r--sql/log_event.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc
index e560580a909..a8e227fa99b 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -3063,10 +3063,7 @@ int Query_log_event::do_apply_event(Relay_log_info const *rli,
::do_apply_event(), then the companion SET also have so
we don't need to reset_one_shot_variables().
*/
- if (!strncmp(query_arg, "BEGIN", q_len_arg) ||
- !strncmp(query_arg, "COMMIT", q_len_arg) ||
- !strncmp(query_arg, "ROLLBACK", q_len_arg) ||
- rpl_filter->db_ok(thd->db))
+ if (is_trans_keyword() || rpl_filter->db_ok(thd->db))
{
thd->set_time((time_t)when);
thd->set_query((char*)query_arg, q_len_arg);