mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -473,5 +473,94 @@ IS NOT NULL
|
||||
SET @@global.server_id= 1;
|
||||
RESET MASTER;
|
||||
FLUSH LOGS;
|
||||
RESET MASTER;
|
||||
FLUSH LOGS;
|
||||
#
|
||||
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is exist
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
use test/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
SET @@session.pseudo_thread_id=999999999/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
SET @@session.lc_time_names=0/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
create table t1(a int) engine= innodb
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
insert into t1 (a) values (1)
|
||||
/*!*/;
|
||||
COMMIT/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
create table t3(a int) engine= innodb
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
insert into t3 (a) values (2)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
ROLLBACK
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
create table t5(a int) engine= NDB
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
insert into t5 (a) values (3)
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
#
|
||||
# Test if the 'BEGIN', 'ROLLBACK' and 'COMMIT' are output if the database specified is not exist
|
||||
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
|
||||
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
|
||||
DELIMITER /*!*/;
|
||||
ROLLBACK/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
SET @@session.pseudo_thread_id=999999999/*!*/;
|
||||
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
|
||||
SET @@session.sql_mode=0/*!*/;
|
||||
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
|
||||
/*!\C latin1 *//*!*/;
|
||||
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
|
||||
SET @@session.lc_time_names=0/*!*/;
|
||||
SET @@session.collation_database=DEFAULT/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
COMMIT/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
ROLLBACK
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
BEGIN
|
||||
/*!*/;
|
||||
SET TIMESTAMP=1253783037/*!*/;
|
||||
COMMIT
|
||||
/*!*/;
|
||||
DELIMITER ;
|
||||
# End of log file
|
||||
ROLLBACK /* added by mysqlbinlog */;
|
||||
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
|
||||
End of 5.0 tests
|
||||
End of 5.1 tests
|
||||
|
Reference in New Issue
Block a user