summaryrefslogtreecommitdiff
path: root/client/mysqlbinlog.cc
diff options
context:
space:
mode:
authorunknown <Dao-Gang.Qu@sun.com>2009-09-30 10:31:25 +0800
committerunknown <Dao-Gang.Qu@sun.com>2009-09-30 10:31:25 +0800
commit508527a94c551e1cb0e69906544e99077c2d468a (patch)
tree9f3aa4dc57ee9f9cf6417662e1c8ff5583895aed /client/mysqlbinlog.cc
parent97f4c17f9ce110e7f4b5e7a30c386038e6e45031 (diff)
parentde04eb6c37016ac5c42fe75bceaa95842da94f15 (diff)
downloadmariadb-git-508527a94c551e1cb0e69906544e99077c2d468a.tar.gz
Bug #46998 mysqlbinlog can't output BEGIN even if the database is included in a transaction
The 'BEGIN/COMMIT/ROLLBACK' log event could be filtered out if the database is not selected by --database option of mysqlbinlog command. This can result in problem if there are some statements in the transaction are not filtered out. To fix the problem, mysqlbinlog will output 'BEGIN/ROLLBACK/COMMIT' in regardless of the database filtering rules. client/mysqlbinlog.cc: Skip the database check for BEGIN/COMMIT/ROLLBACK log events. mysql-test/r/mysqlbinlog.result: Test result for bug#46998 mysql-test/suite/binlog/t/binlog_row_mysqlbinlog_db_filter.test: The test case is updated duo to the patch of bug#46998 mysql-test/t/mysqlbinlog.test: Added test to verify if the 'BEGIN', 'COMMIT' and 'ROLLBACK' are output in regardless of database filtering
Diffstat (limited to 'client/mysqlbinlog.cc')
-rw-r--r--client/mysqlbinlog.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 82af7ca65f6..ebe34231238 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -726,7 +726,10 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
switch (ev_type) {
case QUERY_EVENT:
- if (shall_skip_database(((Query_log_event*)ev)->db))
+ 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) &&
+ shall_skip_database(((Query_log_event*)ev)->db))
goto end;
if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
{