From 41783de54966481dd295aae95a2bfc8f6302a940 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Tue, 14 Jul 2009 21:31:19 +0200 Subject: [PATCH 01/69] BUG#39934: Slave stops for engine that only support row-based logging General overview: The logic for switching to row format when binlog_format=MIXED had numerous flaws. The underlying problem was the lack of a consistent architecture. General purpose of this changeset: This changeset introduces an architecture for switching to row format when binlog_format=MIXED. It enforces the architecture where it has to. It leaves some bugs to be fixed later. It adds extensive tests to verify that unsafe statements work as expected and that appropriate errors are produced by problems with the selection of binlog format. It was not practical to split this into smaller pieces of work. Problem 1: To determine the logging mode, the code has to take several parameters into account (namely: (1) the value of binlog_format; (2) the capabilities of the engines; (3) the type of the current statement: normal, unsafe, or row injection). These parameters may conflict in several ways, namely: - binlog_format=STATEMENT for a row injection - binlog_format=STATEMENT for an unsafe statement - binlog_format=STATEMENT for an engine only supporting row logging - binlog_format=ROW for an engine only supporting statement logging - statement is unsafe and engine does not support row logging - row injection in a table that does not support statement logging - statement modifies one table that does not support row logging and one that does not support statement logging Several of these conflicts were not detected, or were detected with an inappropriate error message. The problem of BUG#39934 was that no appropriate error message was written for the case when an engine only supporting row logging executed a row injection with binlog_format=ROW. However, all above cases must be handled. Fix 1: Introduce new error codes (sql/share/errmsg.txt). Ensure that all conditions are detected and handled in decide_logging_format() Problem 2: The binlog format shall be determined once per statement, in decide_logging_format(). It shall not be changed before or after that. Before decide_logging_format() is called, all information necessary to determine the logging format must be available. This principle ensures that all unsafe statements are handled in a consistent way. However, this principle is not followed: thd->set_current_stmt_binlog_row_based_if_mixed() is called in several places, including from code executing UPDATE..LIMIT, INSERT..SELECT..LIMIT, DELETE..LIMIT, INSERT DELAYED, and SET @@binlog_format. After Problem 1 was fixed, that caused inconsistencies where these unsafe statements would not print the appropriate warnings or errors for some of the conflicts. Fix 2: Remove calls to THD::set_current_stmt_binlog_row_based_if_mixed() from code executed after decide_logging_format(). Compensate by calling the set_current_stmt_unsafe() at parse time. This way, all unsafe statements are detected by decide_logging_format(). Problem 3: INSERT DELAYED is not unsafe: it is logged in statement format even if binlog_format=MIXED, and no warning is printed even if binlog_format=STATEMENT. This is BUG#45825. Fix 3: Made INSERT DELAYED set itself to unsafe at parse time. This allows decide_logging_format() to detect that a warning should be printed or the binlog_format changed. Problem 4: LIMIT clause were not marked as unsafe when executed inside stored functions/triggers/views/prepared statements. This is BUG#45785. Fix 4: Make statements containing the LIMIT clause marked as unsafe at parse time, instead of at execution time. This allows propagating unsafe-ness to the view. mysql-test/extra/rpl_tests/create_recursive_construct.inc: Added auxiliary file used by binlog_unsafe.test to create and execute recursive constructs (functions/procedures/triggers/views/prepared statements). mysql-test/extra/rpl_tests/rpl_foreign_key.test: removed unnecessary set @@session.binlog_format mysql-test/extra/rpl_tests/rpl_insert_delayed.test: Filter out table id from table map events in binlog listing. Got rid of $binlog_format_statement. mysql-test/extra/rpl_tests/rpl_ndb_apply_status.test: disable warnings around call to unsafe procedure mysql-test/include/rpl_udf.inc: Disabled warnings for code that generates warnings for some binlog formats. That would otherwise cause inconsistencies in the result file. mysql-test/r/mysqldump.result: Views are now unsafe if they contain a LIMIT clause. That fixed BUG#45831. Due to BUG#45832, a warning is printed for the CREATE VIEW statement. mysql-test/r/sp_trans.result: Unsafe statements in stored procedures did not give a warning if binlog_format=statement. This is BUG#45824. Now they do, so this result file gets a new warning. mysql-test/suite/binlog/r/binlog_multi_engine.result: Error message changed. mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result: INSERT DELAYED didn't generate a warning when binlog_format=STATEMENT. That was BUG#45825. Now there is a warning, so result file needs to be updated. mysql-test/suite/binlog/r/binlog_stm_ps.result: Changed error message. mysql-test/suite/binlog/r/binlog_unsafe.result: updated result file: - error message changed - added test for most combinations of unsafe constructs invoked from recursive constructs - INSERT DELAYED now gives a warning (because BUG#45826 is fixed) - INSERT..SELECT..LIMIT now gives a warning from inside recursive constructs (because BUG#45785 was fixed) - When a recursive construct (e.g., stored proc or function) contains more than one statement, at least one of which is unsafe, then all statements in the recursive construct give warnings. This is a new bug introduced by this changeset. It will be addressed in a post-push fix. mysql-test/suite/binlog/t/binlog_innodb.test: Changed error code for innodb updates with READ COMMITTED or READ UNCOMMITTED transaction isolation level and binlog_format=statement. mysql-test/suite/binlog/t/binlog_multi_engine.test: The error code has changed for statements where more than one engine is involved and one of them is self-logging. mysql-test/suite/binlog/t/binlog_unsafe-master.opt: Since binlog_unsafe now tests unsafe-ness of UDF's, we need an extra flag in the .opt file. mysql-test/suite/binlog/t/binlog_unsafe.test: - Clarified comment. - Rewrote first part of test. Now it tests not only unsafe variables and functions, but also unsafe-ness due to INSERT..SELECT..LIMIT, INSERT DELAYED, insert into two autoinc columns, use of UDF's, and access to log tables in the mysql database. Also, in addition to functions, procedures, triggers, and prepared statements, it now also tests views; and it constructs recursive calls in two levels by combining these recursive constructs. Part of the logic is in extra/rpl_tests/create_recursive_construct.inc. - added tests for all special system variables that should not be unsafe. - added specific tests for BUG#45785 and BUG#45825 mysql-test/suite/rpl/r/rpl_events.result: updated result file mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result: updated result file mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result: updated result file mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result: updated result file mysql-test/suite/rpl/r/rpl_idempotency.result: updated result file mysql-test/suite/rpl/r/rpl_mix_found_rows.result: Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file equals the second half of the old rpl_found_rows.result, with the following modifications: - minor formatting changes - additional initialization mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result: Moved out code operating in mixed mode from rpl_stm_insert_delayed (into rpl_mix_insert_delayed) and got rid of explicit setting of binlog format. mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result: updated result file mysql-test/suite/rpl/r/rpl_row_idempotency.result: Moved the second half of rpl_idempotency.test, which only executed in row mode, to rpl_row_idempotency.test. This is the new result file. mysql-test/suite/rpl/r/rpl_row_insert_delayed.result: Got rid of unnecessary explicit setting of binlog format. mysql-test/suite/rpl/r/rpl_stm_found_rows.result: Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in this file: - minor formatting changes - warning is now issued for unsafe statements inside procedures (since BUG#45824 is fixed) - second half of file is moved to rpl_mix_found_rows.result mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result: Moved out code operating in mixed mode from rpl_stm_insert_delayed (into rpl_mix_insert_delayed) and got rid of explicit setting of binlog format. mysql-test/suite/rpl/r/rpl_stm_loadfile.result: error message changed mysql-test/suite/rpl/r/rpl_temporary_errors.result: updated result file mysql-test/suite/rpl/r/rpl_udf.result: Remove explicit set of binlog format (and triplicate test execution) and rely on test system executing the test in all binlog formats. mysql-test/suite/rpl/t/rpl_bug31076.test: Test is only valid in mixed or row mode since it generates row events. mysql-test/suite/rpl/t/rpl_events.test: Removed explicit set of binlog_format and removed duplicate testing. Instead, we rely on the test system to try all binlog formats. mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test: Removed triplicate testing and instead relying on test system. Test is only relevant for row format since statement-based replication cannot handle extra columns on master. mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test: Removed triplicate testing and instead relying on test system. Test is only relevant for row format since statement-based replication cannot handle extra columns on master. mysql-test/suite/rpl/t/rpl_idempotency-slave.opt: Removed .opt file to avoid server restarts. mysql-test/suite/rpl/t/rpl_idempotency.test: - Moved out row-only tests to a new test file, rpl_row_idempotency.test. rpl_idempotency now only contains tests that execute in all binlog_formats. - While I was here, also removed .opt file to avoid server restarts. The slave_exec_mode is now set inside the test instead. mysql-test/suite/rpl/t/rpl_mix_found_rows.test: Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and rpl_stm_found_rows.test (renamed rpl_found_rows.test). This file contains the second half of the original rpl_found_rows.test with the follwing changes: - initialization - removed SET_BINLOG_FORMAT and added have_binlog_format_mixed.inc - minor formatting changes mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test: Moved out code operating in mixed mode from rpl_stm_insert_delayed (into rpl_mix_insert_delayed) and got rid of explicit setting of binlog format. mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test: Test cannot execute in statement mode, since we no longer switch to row format when binlog_format=statement. Enforced mixed mode throughout the test. mysql-test/suite/rpl/t/rpl_row_idempotency.test: Moved the second half of rpl_idempotency.test, which only executed in row mode, to this new file. We now rely on the test system to set binlog format. mysql-test/suite/rpl/t/rpl_row_insert_delayed.test: - Got rid of unnecessary explicit setting of binlog format. - extra/rpl_tests/rpl_insert_delayed.test does not need the $binlog_format_statement variable any more, so that was removed. mysql-test/suite/rpl/t/rpl_slave_skip.test: The test switches binlog_format internally and master generates both row and statement events. Hence, the slave must be able to log in both statement and row format. Hence test was changed to only execute in mixed mode. mysql-test/suite/rpl/t/rpl_stm_found_rows.test: Split rpl_found_rows.test into rpl_mix_found_rows.test (a new file) and rpl_stm_found_rows.test (renamed rpl_found_rows.test). Changes in this file: - minor formatting changes - added have_binlog_format_statement and removed SET BINLOG_FORMAT. - second half of file is moved to rpl_mix_found_rows.test - added cleanup code mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test: Moved out code operating in mixed mode from rpl_stm_insert_delayed (into rpl_mix_insert_delayed) and got rid of explicit setting of binlog format. mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test: The test switches binlog_format internally and master generates both row and statement events. Hence, the slave must be able to log in both statement and row format. Hence test was changed to only execute in mixed mode on slave. mysql-test/suite/rpl/t/rpl_temporary_errors.test: Removed explicit set of binlog format. Instead, the test now only executes in row mode. mysql-test/suite/rpl/t/rpl_udf.test: Remove explicit set of binlog format (and triplicate test execution) and rely on test system executing the test in all binlog formats. mysql-test/suite/rpl_ndb/combinations: Added combinations file for rpl_ndb. mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result: new result file mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result: updated result file mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt: new option file mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt: new option file mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test: New test case to verify all errors and warnings generated by decide_logging_format. mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. While I was here, also made the test clean up after itself. mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test: The test needs slave to be able to switch to row mode, so the test was changed to only execute in mixed and row mode. mysql-test/t/partition_innodb_stmt.test: Changed error code for innodb updates with READ COMMITTED or READ UNCOMMITTED transaction isolation level and binlog_format=statement. sql/event_db_repository.cc: Use member function to read current_stmt_binlog_row_based. sql/events.cc: Use member function to read current_stmt_binlog_row_based. sql/ha_ndbcluster_binlog.cc: reset_current_stmt_binlog_row_based() is not a no-op for the ndb_binlog thread any more. Instead, the ndb_binlog thread now forces row mode both initially and just after calling mysql_parse. (mysql_parse() is the only place where reset_current_stmt_binlog_row_based() may be called from the ndb_binlog thread, so these are the only two places that need to change.) sql/ha_partition.cc: Use member function to read current_stmt_binlog_row_based. sql/handler.cc: Use member function to read current_stmt_binlog_row_based. sql/item_create.cc: Added DBUG_ENTER to some functions, to be able to trace when set_stmt_unsafe is called. sql/log.cc: Use member function to read current_stmt_binlog_row_based. sql/log_event.cc: - Moved logic for changing to row format out of do_apply_event (and into decide_logging_format). - Added @todo comment for post-push cleanup. sql/log_event_old.cc: Move logic for changing to row format out of do_apply_event (and into decide_logging_format). sql/mysql_priv.h: Make decide_logging_format() a member of the THD class, for two reasons: - It is natural from an object-oriented perspective. - decide_logging_format() needs to access private members of THD (specifically, the new binlog_warning_flags field). sql/rpl_injector.cc: Removed call to set_current_stmt_binlog_row_based(). From now on, only decide_logging_fromat is allowed to modify current_stmt_binlog_row_based. This call is from the ndb_binlog thread, mostly executing code in ha_ndbcluster_binlog.cc. This call can be safely removed, because: - current_stmt_binlog_row_based is initialized for the ndb_binlog thread's THD object when the THD object is created. So we're not going to read uninitialized memory. - The behavior of ndb_binlog thread does not use the state of the current_stmt_binlog_row_based. It is conceivable that the ndb_binlog thread would rely on the current_stmt_binlog_format in two situations: (1) when it calls mysql_parse; (2) when it calls THD::binlog_query. In case (1), it always clears THD::options&OPTION_BIN_LOG (because run_query() in ha_ndbcluster_binlog.cc is only called with disable_binlogging = TRUE). In case (2), it always uses qtype=STMT_QUERY_TYPE. sql/set_var.cc: Added @todo comment for post-push cleanup. sql/share/errmsg.txt: Added new error messages and clarified ER_BINLOG_UNSAFE_STATEMENT. sql/sp.cc: Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called. Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE. sql/sp_head.cc: Use member function to read current_stmt_binlog_row_based. sql/sp_head.h: Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called. sql/sql_acl.cc: Got rid of MYSQL_QUERY_TYPE: it was equivalent to STMT_QUERY_TYPE. sql/sql_base.cc: - Made decide_logging_format take care of all logic for deciding the logging format, and for determining the related warnings and errors. See comment above decide_logging_format for details. - Made decide_logging_format a member function of THD, since it needs to access private members of THD and since its purpose is to update the state of a THD object. - Added DBUG_ENTER, to be able to trace when set_stmt_unsafe is called. sql/sql_class.cc: - Moved logic for determining unsafe warnings away from THD::binlog_query (and into decide_logging_format()). Now, it works like this: 1. decide_logging_format detects that the current statement shall produce a warning, if it ever makes it to the binlog 2. decide_logging_format sets a flag of THD::binlog_warning_flags. 3. THD::binlog_query reads the flag. If the flag is set, it generates a warning. - Use member function to read current_stmt_binlog_row_based. sql/sql_class.h: - Added THD::binlog_warning_flags (see sql_class.cc for explanation). - Made decide_logging_format() and reset_for_next_command() member functions of THD (instead of standalone functions). This was needed for two reasons: (1) the functions need to access the private member THD::binlog_warning_flags; (2) the purpose of these functions is to update the staet of a THD object, so from an object-oriented point of view they should be member functions. - Encapsulated current_stmt_binlog_row_based, so it is now private and can only be accessed from a member function. Also changed the data type to an enumeration instead of a bool. - Removed MYSQL_QUERY_TYPE, because it was equivalent to STMT_QUERY_TYPE anyways. - When reset_current_stmt_binlog_row_based was called from the ndb_binlog thread, it would behave as a no-op. This special case has been removed, and the behavior of reset_current_stmt_binlog_row_based does not depend on which thread calls it any more. The special case did not serve any purpose, since the ndb binlog thread did not take the current_stmt_binlog_row_based flag into account anyways. sql/sql_delete.cc: - Moved logic for setting row format for DELETE..LIMIT away from mysql_prepare_delete. (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy) and rely on decide_logging_format() (sql_class.cc) to set row format.) This is part of the fix for BUG#45831. - Use member function to read current_stmt_binlog_row_based. sql/sql_insert.cc: - Removed unnecessary calls to thd->lex->set_stmt_unsafe() and thd->set_current_stmt_binlog_row_based_if_mixed() from handle_delayed_insert(). The calls are unnecessary because they have already been made; they were made in the constructor of the `di' object. - Since decide_logging_format() is now a member function of THD, code that calls decide_logging_format() had to be updated. - Added DBUG_ENTER call, to be able to trace when set_stmt_unsafe is called. - Moved call to set_stmt_unsafe() for INSERT..SELECT..LIMIT away from mysql_insert_select_prepare() (and into decide_logging_format). This is part of the fix for BUG#45831. - Use member function to read current_stmt_binlog_row_based. sql/sql_lex.h: - Added the flag BINLOG_STMT_FLAG_ROW_INJECTION to enum_binlog_stmt_flag. This was necessary so that a statement can identify itself as a row injection. - Added appropriate setter and getter functions for the new flag. - Added or clarified some comments. - Added DBUG_ENTER() sql/sql_load.cc: Use member function to read current_stmt_binlog_row_based. sql/sql_parse.cc: - Made mysql_reset_thd_for_next_command() clear thd->binlog_warning_flags. - Since thd->binlog_warning_flags is private, it must be set in a member function of THD. Hence, moved the body of mysql_reset_thd_for_next_command() to the new member function THD::reset_thd_for_next_command(), and made mysql_reset_thd_for_next_command() call THD::reset_thd_for_next_command(). - Removed confusing comment. - Use member function to read current_stmt_binlog_row_based. sql/sql_repl.cc: Use member function to read current_stmt_binlog_row_based. sql/sql_table.cc: Use member function to read current_stmt_binlog_row_based. sql/sql_udf.cc: Use member function to read current_stmt_binlog_row_based. sql/sql_update.cc: Moved logic for setting row format for UPDATE..LIMIT away from mysql_prepare_update. (Instead, we mark the statement as unsafe at parse time (sql_yacc.yy) and rely on decide_logging_format() (sql_class.cc) to set row format.) This is part of the fix for BUG#45831. sql/sql_yacc.yy: Made INSERT DELAYED, INSERT..SELECT..LIMIT, UPDATE..LIMIT, and DELETE..LIMIT mark themselves as unsafe at parse time (instead of at execution time). This is part of the fixes BUG#45831 and BUG#45825. storage/example/ha_example.cc: Made exampledb accept inserts. This was needed by the new test case rpl_ndb_binlog_format_errors, because it needs an engine that is statement-only (and accepts inserts). storage/example/ha_example.h: Made exampledb a statement-only engine instead of a row-only engine. No existing test relied exampledb's row-only capabilities. The new test case rpl_ndb_binlog_format_errors needs an engine that is statement-only. storage/innobase/handler/ha_innodb.cc: - Changed error error code and message given by innodb when binlog_format=STATEMENT and transaction isolation level is READ COMMITTED or READ UNCOMMITTED. - While I was here, also simplified the condition for checking when to give the error. --- .../rpl_tests/create_recursive_construct.inc | 364 +++ .../extra/rpl_tests/rpl_foreign_key.test | 1 - .../extra/rpl_tests/rpl_insert_delayed.test | 18 +- .../extra/rpl_tests/rpl_ndb_apply_status.test | 6 + mysql-test/include/rpl_udf.inc | 2 + mysql-test/r/mysqldump.result | 2 + mysql-test/r/sp_trans.result | 2 + .../suite/binlog/r/binlog_innodb.result | 4 +- .../suite/binlog/r/binlog_multi_engine.result | 6 +- .../r/binlog_statement_insert_delayed.result | 4 + .../suite/binlog/r/binlog_stm_ps.result | 2 +- .../suite/binlog/r/binlog_unsafe.result | 2664 +++++++++++++++-- mysql-test/suite/binlog/t/binlog_innodb.test | 4 +- .../suite/binlog/t/binlog_multi_engine.test | 6 +- .../suite/binlog/t/binlog_unsafe-master.opt | 1 + mysql-test/suite/binlog/t/binlog_unsafe.test | 481 +-- mysql-test/suite/rpl/r/rpl_events.result | 90 - .../rpl/r/rpl_extraColmaster_innodb.result | 2283 -------------- .../rpl/r/rpl_extraColmaster_myisam.result | 2283 -------------- .../suite/rpl/r/rpl_foreign_key_innodb.result | 1 - mysql-test/suite/rpl/r/rpl_idempotency.result | 157 +- ..._rows.result => rpl_mix_found_rows.result} | 101 +- .../suite/rpl/r/rpl_mix_insert_delayed.result | 71 + mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result | 7 - .../suite/rpl/r/rpl_row_idempotency.result | 160 + .../suite/rpl/r/rpl_row_insert_delayed.result | 3 - .../suite/rpl/r/rpl_stm_found_rows.result | 110 + .../suite/rpl/r/rpl_stm_insert_delayed.result | 69 - .../suite/rpl/r/rpl_stm_loadfile.result | 5 +- .../suite/rpl/r/rpl_temporary_errors.result | 1 - mysql-test/suite/rpl/r/rpl_udf.result | 161 - mysql-test/suite/rpl/t/rpl_bug31076.test | 1 + mysql-test/suite/rpl/t/rpl_events.test | 12 +- .../rpl/t/rpl_extraColmaster_innodb.test | 11 +- .../rpl/t/rpl_extraColmaster_myisam.test | 11 +- .../suite/rpl/t/rpl_idempotency-slave.opt | 1 - mysql-test/suite/rpl/t/rpl_idempotency.test | 322 +- ...ound_rows.test => rpl_mix_found_rows.test} | 114 +- .../suite/rpl/t/rpl_mix_insert_delayed.test | 5 + mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test | 13 +- .../suite/rpl/t/rpl_row_idempotency.test | 325 ++ .../suite/rpl/t/rpl_row_insert_delayed.test | 9 - mysql-test/suite/rpl/t/rpl_slave_skip.test | 6 + .../suite/rpl/t/rpl_stm_found_rows.test | 121 + .../suite/rpl/t/rpl_stm_insert_delayed.test | 17 +- .../suite/rpl/t/rpl_switch_stm_row_mixed.test | 18 +- .../suite/rpl/t/rpl_temporary_errors.test | 2 +- mysql-test/suite/rpl/t/rpl_udf.test | 11 - mysql-test/suite/rpl_ndb/combinations | 8 + .../r/rpl_ndb_binlog_format_errors.result | 116 + .../rpl_ndb/r/rpl_ndb_circular_simplex.result | 1 + .../suite/rpl_ndb/t/rpl_ndb_2innodb.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_2myisam.test | 3 + mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test | 3 + .../t/rpl_ndb_binlog_format_errors-master.opt | 1 + .../t/rpl_ndb_binlog_format_errors-slave.opt | 1 + .../t/rpl_ndb_binlog_format_errors.test | 193 ++ mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test | 3 + mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test | 5 + .../suite/rpl_ndb/t/rpl_ndb_circular.test | 3 + .../rpl_ndb/t/rpl_ndb_circular_simplex.test | 7 + .../rpl_ndb/t/rpl_ndb_commit_afterflush.test | 4 + .../rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test | 3 + .../rpl_ndb/t/rpl_ndb_delete_nowhere.test | 3 + mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_do_table.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_func003.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_innodb_trans.test | 3 + .../rpl_ndb/t/rpl_ndb_insert_ignore.test | 3 + .../t/rpl_ndb_mixed_engines_transactions.test | 3 + .../rpl_ndb/t/rpl_ndb_multi_update3.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_rep_ignore.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_row_001.test | 3 + mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test | 3 + mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test | 3 + .../suite/rpl_ndb/t/rpl_ndb_trig004.test | 3 + mysql-test/t/partition_innodb_stmt.test | 2 +- sql/event_db_repository.cc | 2 +- sql/events.cc | 6 +- sql/ha_ndbcluster_binlog.cc | 2 + sql/ha_partition.cc | 2 +- sql/handler.cc | 4 +- sql/item_create.cc | 18 +- sql/log.cc | 4 +- sql/log_event.cc | 31 +- sql/log_event_old.cc | 13 +- sql/mysql_priv.h | 1 - sql/rpl_injector.cc | 2 - sql/set_var.cc | 5 + sql/share/errmsg.txt | 18 +- sql/sp.cc | 6 +- sql/sp_head.cc | 2 +- sql/sp_head.h | 2 + sql/sql_acl.cc | 2 +- sql/sql_base.cc | 284 +- sql/sql_class.cc | 121 +- sql/sql_class.h | 92 +- sql/sql_delete.cc | 20 +- sql/sql_insert.cc | 49 +- sql/sql_lex.h | 67 +- sql/sql_load.cc | 2 +- sql/sql_parse.cc | 13 +- sql/sql_repl.cc | 2 +- sql/sql_table.cc | 18 +- sql/sql_udf.cc | 4 +- sql/sql_update.cc | 13 - sql/sql_yacc.yy | 15 +- storage/example/ha_example.cc | 8 +- storage/example/ha_example.h | 8 +- storage/innobase/handler/ha_innodb.cc | 30 +- 110 files changed, 4967 insertions(+), 6362 deletions(-) create mode 100644 mysql-test/extra/rpl_tests/create_recursive_construct.inc create mode 100644 mysql-test/suite/binlog/t/binlog_unsafe-master.opt rename mysql-test/suite/rpl/r/{rpl_found_rows.result => rpl_mix_found_rows.result} (54%) create mode 100644 mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result create mode 100644 mysql-test/suite/rpl/r/rpl_row_idempotency.result create mode 100644 mysql-test/suite/rpl/r/rpl_stm_found_rows.result delete mode 100644 mysql-test/suite/rpl/t/rpl_idempotency-slave.opt rename mysql-test/suite/rpl/t/{rpl_found_rows.test => rpl_mix_found_rows.test} (52%) create mode 100644 mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_idempotency.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_found_rows.test create mode 100644 mysql-test/suite/rpl_ndb/combinations create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc new file mode 100644 index 00000000000..66c82de8b99 --- /dev/null +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -0,0 +1,364 @@ +# ==== Purpose ==== +# +# Creates a stored routine, stored function, trigger, view, or +# prepared statement (commonly referred to as "recursive construct") +# that invokes a given unsafe statement. +# +# Then, it invokes the created recursive construct several times: +# +# - With SQL_LOG_BIN = 1 and binlog_format = STATEMENT, to verify +# that it gives a warning. +# +# - With SQL_LOG_BIN = 0 and binlog_format = STATEMENT, to verify that +# there is no warning and nothing is logged. +# +# - With SQL_LOG_BIN = 1 and binlog_format = MIXED, to verify that it +# writes row events to the binlog. +# +# - If the recursive construct can be invoked so that it has no +# side-effects but it returns a value that may be nondeterministic, +# then it is invoked in such a way that the return value is +# discarded, with SQL_LOG_BIN = 1 and binlog_format = STATEMENT. +# In this case, no warning should be given and nothing should be +# written to the binlog. +# +# This is an auxiliary file particularly targeted to being used by the +# test binlog_unsafe. In this context, the purpose is to check how +# warnings for unsafe statements are propagated in recursive +# constructs. +# +# The statement to invoke ("input") is described using mtr variables, +# and the resulting recursive construct ("output") is stored in mtr +# variables in a similar fashion. To create several levels of nested +# recursive constructs, source this file once, then copy the values of +# appropriate output variables to the input variables, and then source +# this file again. +# +# +# ==== Usage ==== +# +# See binlog_unsafe for an example of how to use this file. +# +# let $CRC_ARG_level= ; +# let $CRC_ARG_type= ; +# let $CRC_ARG_stmt_sidef= ; +# let $CRC_ARG_value= ; +# let $CRC_ARG_sel_retval= ; +# let $CRC_ARG_sel_sidef= ; +# let $CRC_ARG_desc= ; +# source extra/rpl_tests/create_recursive_construct.inc; +# let $my_stmt_sidef= $CRC_RET_stmt_sidef; +# let $my_value= $CRC_RET_value; +# let $my_sel_sidef= $CRC_RET_sel_sidef; +# let $my_sel_retval= $CRC_RET_sel_retval; +# let $my_drop= $CRC_RET_drop; +# let $my_is_toplevel= $CRC_RET_top_is_toplevel; +# let $my_desc= $CRC_RET_desc; +# +# $CRC_ARG_* are used as input parameters (arguments) to this file: +# +# $CRC_ARG_level is the recursion depth: 1 for the innermost +# statement created, 2 for a statement that invokes a statement on +# level 1, etc. +# +# $CRC_ARG_type is an integer from 0 to 6, indicating what type of +# statement shall be created: +# 0 - Create a stored function where the return value depends on +# the value of the given statement. +# 1 - Create a stored function that invokes the given statement as +# a side-effect but may not return a value that depends on it. +# 2 - Create a stored routine that invokes the given statement. +# 3 - Create a trigger (on table trigger_table_$CRC_ARG_level) that +# invokes the given statement. +# 4 - Create a view that returns a value that depends on the value +# of the given statement. +# 5 - Create a view that invokes the given statement but may return +# a value that does not depend on it. +# 6 - Create a prepared statement that invokes the given statement. +# +# $CRC_ARG_stmt_sidef is the statement to invoke. It should be a +# statement that can be invoked on its own (not sub-statement), +# which causes something unsafe to be written to the binlog. +# +# $CRC_ARG_value is a sub-statement holding the value of the given +# statement. Can be empty if the given statement does not have a +# value. Typically, this is non-empty if the given statement is a +# function call or user variable, but not if it is a stored routine +# call, INSERT, SELECT, etc (because none of them has a value). +# $CRC_ARG_value is used only when $CRC_ARG_type=6. +# +# $CRC_ARG_sel_sidef is a SELECT sub-statement that invokes the +# statement as a side-effect, but returns a result set that may not +# depend on the statement. Can be empty if the statement cannot +# produce a result set from a SELECT. $CRC_ARG_sel_sidef is used +# only if $CRC_ARG_type=2 +# +# $CRC_ARG_sel_retval is a SELECT sub-statement that does not have +# side-effects, but returns a result set that depends on the unsafe +# statement. Can be empty if the statement cannot be invoked from a +# SELECT. $CRC_ARG_sel_retval is used only if $CRC_ARG_type=3. +# +# $CRC_ARG_desc is a human-readable description of the statement to +# invoke. +# +# $CRC_RET_* are used as output parameters (return values) of this +# file: +# +# $CRC_RET_stmt_sidef is a statement invoking the resulting recursive +# construct. +# +# $CRC_RET_value is a sub-statement invoking the resulting recursive +# construct and returning the value of the recursive construct. +# This is the empty string if the resulting recursive construct does +# not have a value. In particular, this is non-empty only if +# $CRC_ARG_value=7. +# +# $CRC_RET_sel_sidef is a SELECT sub-statement that invokes the +# resulting recursive construct as a side-effect but where the +# result set may not depend on the recursive construct. This is the +# empty string if the recursive construct cannot be invoked from a +# SELECT. In particular, this is non-empty only if $CRC_ARG_value=6 +# or $CRC_ARG_value=2. +# +# $CRC_RET_sel_retval is a SELECT sub-statement that does not have +# side-effects, but returns a result set depending on the unsafe +# statement. This is the empty string if the recursive construct +# cannot produce a result set from a SELECT. In particular, this is +# non-empty only if $CRC_ARG_value=7 or $CRC_ARG_value=3. +# +# $CRC_RET_drop is a statement that drops the created object. I.e., +# it is one of 'DROP FUNCTION ', 'DROP PROCEDURE ', etc. +# +# $CRC_RET_top_is_toplevel is 0 normally, or 1 if the resulting +# recursive construct can only be called from a top-level statement. +# In particular, this is 1 only when $CRC_ARG_value=1, because +# prepared statements cannot be invoked from other recursive +# constructs. +# +# $CRC_RET_desc is a text string that describes the invokation of +# the recursive construct in a human-readable fashion. +# +# Assumptions +# +# Before sourcing this file with $CRC_ARG_level=X, you need to +# create three tables: tX, taX and trigger_table_X. These are used +# as auxiliary tables. + + +#--echo debug: >>>>ENTER create_recursive_construct +#--echo debug: level=$CRC_ARG_level +#--echo debug: type=$CRC_ARG_type +#--echo debug: stmt_sidef=$CRC_ARG_stmt_sidef +#--echo debug: value=$CRC_ARG_value +#--echo debug: sel_retval=$CRC_ARG_sel_retval +#--echo debug: sel_sidef=$CRC_ARG_sel_sidef + +--let $CRC_RET_stmt_sidef= +--let $CRC_RET_value= +--let $CRC_RET_sel_retval= +--let $CRC_RET_sel_sidef= +--let $CRC_RET_drop= +--let $CRC_RET_is_toplevel= 1 +--let $CRC_RET_desc= +--let $CRC_name= +--let $CRC_create= + +######## func_retval ######## +if (`SELECT $CRC_ARG_type = 0 AND '$CRC_ARG_value' != ''`) { + # It will be safe to call this function and discard the return + # value, but it will be unsafe to use return value (e.g., in + # INSERT...SELECT). + --let $CRC_name= func_retval_$CRC_ARG_level + --let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); RETURN $CRC_ARG_value; END + --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_level VALUES ($CRC_name()) + --let $CRC_RET_value= $CRC_name() + --let $CRC_RET_sel_sidef= + --let $CRC_RET_sel_retval= SELECT $CRC_name() + --let $CRC_RET_drop= DROP FUNCTION $CRC_name + --let $CRC_RET_is_toplevel= 0 + --let $CRC_RET_desc= function $CRC_name returning value from $CRC_ARG_desc +} + +######## func_sidef ######## +if (`SELECT $CRC_ARG_type = 1`) { + # It will be unsafe to call func even if you discard return value. + --let $CRC_name= func_sidef_$CRC_ARG_level + --let $CRC_create= CREATE FUNCTION $CRC_name() RETURNS VARCHAR(100) BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; RETURN 0; END + --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_level SELECT $CRC_name() + --let $CRC_RET_value= + --let $CRC_RET_sel_retval= + --let $CRC_RET_sel_sidef= SELECT $CRC_name() + --let $CRC_RET_drop= DROP FUNCTION $CRC_name + --let $CRC_RET_is_toplevel= 0 + --let $CRC_RET_desc= function $CRC_name invoking $CRC_ARG_desc +} + +######## proc ######## +if (`SELECT $CRC_ARG_type = 2`) { + # It will be unsafe to call this procedure. + --let $CRC_name= proc_$CRC_ARG_level + --let $CRC_create= CREATE PROCEDURE $CRC_name() BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; END + --let $CRC_RET_stmt_sidef= CALL $CRC_name() + --let $CRC_RET_value= + --let $CRC_RET_sel_retval= + --let $CRC_RET_sel_sidef= + --let $CRC_RET_drop= DROP PROCEDURE $CRC_name + --let $CRC_RET_is_toplevel= 0 + --let $CRC_RET_desc= procedure $CRC_name invoking $CRC_ARG_desc +} + +######## trig ######## +if (`SELECT $CRC_ARG_type = 3`) { + # It will be unsafe to invoke this trigger. + --let $CRC_name= trig_$CRC_ARG_level + --let $CRC_create= CREATE TRIGGER $CRC_name BEFORE INSERT ON trigger_table_$CRC_ARG_level FOR EACH ROW BEGIN INSERT INTO ta$CRC_ARG_level VALUES (47); $CRC_ARG_stmt_sidef; END + --let $CRC_RET_stmt_sidef= INSERT INTO trigger_table_$CRC_ARG_level VALUES (1) + --let $CRC_RET_value= + --let $CRC_RET_sel_retval= + --let $CRC_RET_sel_sidef= + --let $CRC_RET_drop= DROP TRIGGER $CRC_name + --let $CRC_RET_is_toplevel= 0 + --let $CRC_RET_desc= trigger $CRC_name invoking $CRC_ARG_desc +} + +######## view_retval ######## +if (`SELECT $CRC_ARG_type = 4 AND '$CRC_ARG_sel_retval' != ''`) { + # It will be safe to select from this view if you discard the result + # set, but unsafe to use result set (e.g., in INSERT..SELECT). + --let $CRC_name= view_retval_$CRC_ARG_level + --let $CRC_create= CREATE VIEW $CRC_name AS $CRC_ARG_sel_retval + --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_LEVEL SELECT * FROM $CRC_name + --let $CRC_RET_value= + --let $CRC_RET_sel_retval= SELECT * FROM $CRC_name + --let $CRC_RET_sel_sidef= + --let $CRC_RET_drop= DROP VIEW $CRC_name + --let $CRC_RET_is_toplevel= 0 + --let $CRC_RET_desc= view $CRC_name returning value from $CRC_ARG_desc +} + +######## view_sidef ######## +if (`SELECT $CRC_ARG_type = 5 AND '$CRC_ARG_sel_sidef' != ''`) { + # It will be unsafe to select from this view, even if you discard + # the return value. + --let $CRC_name= view_sidef_$CRC_ARG_level + --let $CRC_create= CREATE VIEW $CRC_name AS $CRC_ARG_sel_sidef + --let $CRC_RET_stmt_sidef= INSERT INTO t$CRC_ARG_level SELECT * FROM $CRC_name + --let $CRC_RET_value= + --let $CRC_RET_sel_retval= + --let $CRC_RET_sel_sidef= SELECT * FROM $CRC_name + --let $CRC_RET_drop= DROP VIEW $CRC_name + --let $CRC_RET_is_toplevel= 0 + --let $CRC_RET_desc= view $CRC_name invoking $CRC_ARG_desc +} + +######## prep ######## +if (`SELECT $CRC_ARG_type = 6`) { + # It will be unsafe to execute this prepared statement + --let $CRC_name= prep_$CRC_ARG_level + --let $CRC_create= PREPARE $CRC_name FROM "$CRC_ARG_stmt_sidef" + --let $CRC_RET_stmt_sidef= EXECUTE $CRC_name + --let $CRC_RET_value= + --let $CRC_RET_sel_retval= + --let $CRC_RET_sel_sidef= + --let $CRC_RET_drop= DROP PREPARE $CRC_name + --let $CRC_RET_is_toplevel= 1 + --let $CRC_RET_desc= prepared statement $CRC_name invoking $CRC_ARG_desc +} + +######## no recursive construct: just return the given statement ######## +if (`SELECT $CRC_ARG_type = 7`) { + # CRC_ARG_type=7 is a special case. We just set $CRC_RET_x = + # $CRC_ARG_x. This way, the $CRC_ARG_stmt gets executed directly + # (below). In binlog_unsafe.test, it is used to invoke the unsafe + # statement created in the outermost loop directly, without + # enclosing it in a recursive construct. + --let $CRC_RET_stmt_sidef= $CRC_ARG_stmt_sidef + --let $CRC_RET_value= $CRC_ARG_value + --let $CRC_RET_sel_retval= $CRC_ARG_sel_retval + --let $CRC_RET_sel_sidef= $CRC_ARG_sel_sidef + --let $CRC_RET_drop= + --let $CRC_RET_is_toplevel= 1 + --let $CRC_RET_desc= $CRC_ARG_desc +} + +######## execute! ######## +if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { + --echo + --echo Invoking $CRC_RET_desc. + if (`SELECT '$CRC_create' != ''`) { + --eval $CRC_create + } + + --echo * binlog_format = STATEMENT: expect warning. + --eval $CRC_RET_stmt_sidef + + # These queries are run without query log, to make result file more + # readable. Debug info is only printed if something abnormal + # happens. + --disable_query_log + + --echo * SQL_LOG_BIN = 0: expect nothing logged and no warning. + SET SQL_LOG_BIN = 0; + RESET MASTER; + --eval $CRC_RET_stmt_sidef + --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2) + if (`SELECT '$binlog_event' != 'No such row'`) { + --enable_query_log + --echo Failure! Something was written to the binlog despite SQL_LOG_BIN=0: + SHOW BINLOG EVENTS; + --die + } + SET SQL_LOG_BIN = 1; + + --echo * binlog_format = MIXED: expect row events in binlog and no warning. + SET binlog_format = MIXED; + RESET MASTER; + --eval $CRC_RET_stmt_sidef + # The first event is format_description, the second is + # Query_event('BEGIN'), and the third should be our Table_map. + --let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 3) + if (`SELECT '$event_type' != 'Table_map'`) { + --enable_query_log + --echo Failure! Event number 3 was a '$event_type', not a 'Table_map'. + + # Currently, there is a bug causing some statements to be logged + # partially in statement format. Hence, we don't fail here, we + # just print the events (masking out nondeterministic components + # of the output) and continue. When binloggging works perfectly, + # we should instead execute: + #--enable_query_log + #SHOW BINLOG EVENTS; + #--die + + # Here, we should really source + # include/show_binlog_events.inc. But due to BUG#41913, that + # doesn't work, and we have to inline the entire file here. Sigh + # :-( + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR 106 + --replace_column 2 # 4 # 5 # + --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ /file_id=[0-9]+/file_id=#/ /block_len=[0-9]+/block_len=#/ + --eval SHOW BINLOG EVENTS FROM 106 + --disable_query_log + } + SET binlog_format = STATEMENT; + + --enable_query_log +} + +# Invoke created object, discarding the return value. This should not +# give any warning. +if (`SELECT '$CRC_RET_sel_retval' != ''`) { + --echo * Invoke statement so that return value is dicarded: expect no warning. + --disable_result_log + --eval $CRC_RET_sel_retval + --enable_result_log +} + +#--echo debug: <<< 0`; @@ -190,7 +192,9 @@ let $run= 5; while ($run) { START TRANSACTION; + --disable_warnings --eval CALL tpcb.trans($rpl_format); + --enable_warnings eval SET @my_errno= $mysql_errno; let $run_good= `SELECT @my_errno = 0`; let $run_bad= `SELECT @my_errno <> 0`; @@ -240,7 +244,9 @@ let $run= 5; while ($run) { START TRANSACTION; + --disable_warnings --eval CALL tpcb.trans($rpl_format); + --enable_warnings eval SET @my_errno= $mysql_errno; let $run_good= `SELECT @my_errno = 0`; let $run_bad= `SELECT @my_errno <> 0`; diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc index 30f39d79d49..8be866613cb 100644 --- a/mysql-test/include/rpl_udf.inc +++ b/mysql-test/include/rpl_udf.inc @@ -55,11 +55,13 @@ connection master; --echo "Running on the master" --enable_info eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type; +--disable_warnings INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00)); INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00)); INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00)); INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00)); SELECT * FROM t1 ORDER BY sum; +--enable_warnings --disable_info sync_slave_with_master; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 1345481d6d8..5c03c3fa13c 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2239,6 +2239,8 @@ create view v1 as select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 3cc251bc0a6..8ce6d696bcc 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -506,6 +506,8 @@ select count(*)*255 from t3 into table_size; until table_size > max_table_size*2 end repeat; end| call bug14210_fill_table()| +Warnings: +Note 1592 Unsafe statement binlogged as statement since BINLOG_FORMAT is STATEMENT. drop procedure bug14210_fill_table| create table t4 like t3| create procedure bug14210() diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result index 1922897f631..4a04a7f967e 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_innodb.result @@ -14,12 +14,12 @@ SET BINLOG_FORMAT=STATEMENT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; UPDATE t1 SET b = 1*a WHERE a > 1; -ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-UNCOMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT' +ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. COMMIT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; UPDATE t1 SET b = 2*a WHERE a > 2; -ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT' +ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. COMMIT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index 9252229903b..d7636b1cb77 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -42,7 +42,7 @@ INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging +ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging. TRUNCATE t1m; TRUNCATE t1b; TRUNCATE t1n; @@ -68,9 +68,9 @@ INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging +ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging. UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; -ERROR HY000: Binary logging not possible. Message: Statement cannot be written atomically since more than one engine involved and at least one engine is self-logging +ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info mysqld-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 800bb58e9cc..f4c9e4091b9 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -12,7 +12,11 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert delayed into t1 values (null),(null),(null),(null) insert delayed into t1 values (null),(null),(400),(null); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert delayed into t1 values (null),(null),(400),(null) select * from t1; a 207 diff --git a/mysql-test/suite/binlog/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result index 3af525e297c..97daba735b2 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ps.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result @@ -11,7 +11,7 @@ prepare s from "insert into t1 select 100 limit ?"; set @a=100; execute s using @a; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t1 select 100 limit 100 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int) diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 4c2c32ad8f1..685a0f9ef57 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -1,210 +1,2451 @@ -==== Setup tables ==== -CREATE TABLE t1 (a INT); +#### Setup tables #### +CREATE TABLE t0 (a CHAR(40)); +CREATE TABLE t1 (a CHAR(40)); CREATE TABLE t2 (a CHAR(40)); -CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY); -CREATE TABLE trigger_table (a CHAR(7)); -CREATE TABLE trigger_table2 (a INT); -==== Non-deterministic statements ==== -INSERT DELAYED INTO t1 VALUES (5); -==== Some variables that *should* be unsafe ==== ----- Insert directly ---- -INSERT INTO t1 VALUES (@@global.sync_binlog); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -INSERT INTO t1 VALUES (@@session.insert_id); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -INSERT INTO t1 VALUES (@@global.auto_increment_increment); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -INSERT INTO t2 SELECT UUID(); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -INSERT INTO t2 VALUES (@@session.sql_mode); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -INSERT INTO t2 VALUES (@@global.init_slave); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -INSERT INTO t2 VALUES (@@hostname); -Warnings: -Note 1592 Statement may not be safe to log in statement format. ----- Insert from stored procedure ---- -CREATE PROCEDURE proc() -BEGIN -INSERT INTO t1 VALUES (@@global.sync_binlog); -INSERT INTO t1 VALUES (@@session.insert_id); -INSERT INTO t1 VALUES (@@global.auto_increment_increment); -INSERT INTO t2 SELECT UUID(); -INSERT INTO t2 VALUES (@@session.sql_mode); -INSERT INTO t2 VALUES (@@global.init_slave); -INSERT INTO t2 VALUES (@@hostname); +CREATE TABLE t3 (a CHAR(40)); +CREATE TABLE ta1 (a CHAR(40)); +CREATE TABLE ta2 (a CHAR(40)); +CREATE TABLE ta3 (a CHAR(40)); +CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE double_autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); +CREATE TRIGGER double_autoinc_trig BEFORE INSERT ON double_autoinc_table FOR EACH ROW BEGIN +INSERT INTO autoinc_table VALUES (NULL); END| -CALL proc(); +CREATE TABLE data_table (a CHAR(40)); +INSERT INTO data_table VALUES ('foo'); +CREATE TABLE trigger_table_1 (a INT); +CREATE TABLE trigger_table_2 (a INT); +CREATE TABLE trigger_table_3 (a INT); +CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; + +==== Testing UUID() unsafeness ==== + +Invoking function func_retval_1 returning value from unsafe UUID() function. +CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN UUID(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. ----- Insert from stored function ---- -CREATE FUNCTION func() -RETURNS INT -BEGIN -INSERT INTO t1 VALUES (@@global.sync_binlog); -INSERT INTO t1 VALUES (@@session.insert_id); -INSERT INTO t1 VALUES (@@global.auto_increment_increment); -INSERT INTO t2 SELECT UUID(); -INSERT INTO t2 VALUES (@@session.sql_mode); -INSERT INTO t2 VALUES (@@global.init_slave); -INSERT INTO t2 VALUES (@@hostname); -RETURN 0; -END| -SELECT func(); -func() -0 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_1(); + +Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function. +CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. ----- Insert from trigger ---- -CREATE TRIGGER trig -BEFORE INSERT ON trigger_table -FOR EACH ROW -BEGIN -INSERT INTO t1 VALUES (@@global.sync_binlog); -INSERT INTO t1 VALUES (@@session.insert_id); -INSERT INTO t1 VALUES (@@global.auto_increment_increment); -INSERT INTO t2 SELECT UUID(); -INSERT INTO t2 VALUES (@@session.sql_mode); -INSERT INTO t2 VALUES (@@global.init_slave); -INSERT INTO t2 VALUES (@@hostname); -END| -INSERT INTO trigger_table VALUES ('bye.'); +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 VALUES (func_retval_2()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_2(); +DROP FUNCTION func_retval_2; + +Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe UUID() function. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. ----- Insert from prepared statement ---- -PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)'; -PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)'; -PREPARE p3 FROM 'INSERT INTO t1 VALUES (@@global.auto_increment_increment)'; -PREPARE p4 FROM 'INSERT INTO t2 SELECT UUID()'; -PREPARE p5 FROM 'INSERT INTO t2 VALUES (@@session.sql_mode)'; -PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)'; -PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)'; -EXECUTE p1; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe UUID() function. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); Warnings: -Note 1592 Statement may not be safe to log in statement format. -EXECUTE p2; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe UUID() function. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Statement may not be safe to log in statement format. -EXECUTE p3; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function. +CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Statement may not be safe to log in statement format. -EXECUTE p4; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT func_retval_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Statement may not be safe to log in statement format. -EXECUTE p5; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe UUID() function. +PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; Warnings: -Note 1592 Statement may not be safe to log in statement format. -EXECUTE p6; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_retval_1; + +Invoking function func_sidef_1 invoking unsafe UUID() function. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (UUID()); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Statement may not be safe to log in statement format. -EXECUTE p7; +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Statement may not be safe to log in statement format. ----- Insert from nested call of triggers / functions / procedures ---- -CREATE PROCEDURE proc1() -INSERT INTO trigger_table VALUES ('ha!')| -CREATE FUNCTION func2() -RETURNS INT -BEGIN -CALL proc1(); -RETURN 0; -END| -CREATE TRIGGER trig3 -BEFORE INSERT ON trigger_table2 -FOR EACH ROW -BEGIN -DECLARE tmp INT; -SELECT func2() INTO tmp; -END| -CREATE PROCEDURE proc4() -INSERT INTO trigger_table2 VALUES (1)| -CREATE FUNCTION func5() -RETURNS INT -BEGIN -CALL proc4; -RETURN 0; -END| -PREPARE prep6 FROM 'SELECT func5()'| -EXECUTE prep6; -func5() -0 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe UUID() function. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); Warnings: -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -==== Variables that should *not* be unsafe ==== -INSERT INTO t1 VALUES (@@session.pseudo_thread_id); -INSERT INTO t1 VALUES (@@session.pseudo_thread_id); -INSERT INTO t1 VALUES (@@session.foreign_key_checks); -INSERT INTO t1 VALUES (@@session.sql_auto_is_null); -INSERT INTO t1 VALUES (@@session.unique_checks); +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe UUID() function. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe UUID() function. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe UUID() function. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (UUID()); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe UUID() function. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe UUID() function. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe UUID() function. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe UUID() function. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe UUID() function. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (UUID()); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe UUID() function. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe UUID() function. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe UUID() function. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe UUID() function. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_retval_1 returning value from unsafe UUID() function. +CREATE VIEW view_retval_1 AS SELECT UUID(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_1` AS SELECT UUID() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_1; + +Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe UUID() function. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe UUID() function. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe UUID() function. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe UUID() function. +CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT * FROM view_retval_1 +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe UUID() function. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_retval_1; + +Invoking prepared statement prep_1 invoking unsafe UUID() function. +PREPARE prep_1 FROM "INSERT INTO t0 VALUES (UUID())"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe UUID() function. +* binlog_format = STATEMENT: expect warning. +INSERT INTO t0 VALUES (UUID()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT UUID(); + +==== Testing @@hostname unsafeness ==== + +Invoking function func_retval_1 returning value from unsafe @@hostname variable. +CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN @@hostname; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 VALUES (func_retval_1()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_1(); + +Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable. +CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 VALUES (func_retval_2()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 VALUES (func_retval_2()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_2(); +DROP FUNCTION func_retval_2; + +Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable. +CREATE VIEW view_retval_2 AS SELECT func_retval_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT func_retval_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. +PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_retval_1; + +Invoking function func_sidef_1 invoking unsafe @@hostname variable. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (@@hostname); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe @@hostname variable. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (@@hostname); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe @@hostname variable. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe @@hostname variable. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe @@hostname variable. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe @@hostname variable. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe @@hostname variable. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (@@hostname); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe @@hostname variable. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe @@hostname variable. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe @@hostname variable. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe @@hostname variable. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking prepared statement prep_1 invoking unsafe @@hostname variable. +PREPARE prep_1 FROM "INSERT INTO t0 VALUES (@@hostname)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe @@hostname variable. +* binlog_format = STATEMENT: expect warning. +INSERT INTO t0 VALUES (@@hostname); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing SELECT...LIMIT unsafeness ==== + +Invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT * FROM data_table LIMIT 1; RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT * FROM data_table LIMIT 1; END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT * FROM data_table LIMIT 1; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. +CREATE VIEW view_retval_1 AS SELECT * FROM data_table LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_1` AS SELECT * FROM data_table LIMIT 1 +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_1; + +Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe SELECT...LIMIT statement. +CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT * FROM view_retval_1 +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_retval_1; + +Invoking prepared statement prep_1 invoking unsafe SELECT...LIMIT statement. +PREPARE prep_1 FROM "INSERT INTO t0 SELECT * FROM data_table LIMIT 1"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe SELECT...LIMIT statement. +* binlog_format = STATEMENT: expect warning. +INSERT INTO t0 SELECT * FROM data_table LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM data_table LIMIT 1; + +==== Testing INSERT DELAYED unsafeness ==== + +Invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO t0 VALUES (1), (2); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO t0 VALUES (1), (2); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO t0 VALUES (1), (2); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking prepared statement prep_1 invoking unsafe INSERT DELAYED statement. +PREPARE prep_1 FROM "INSERT DELAYED INTO t0 VALUES (1), (2)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe INSERT DELAYED statement. +* binlog_format = STATEMENT: expect warning. +INSERT DELAYED INTO t0 VALUES (1), (2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing unsafeness of insert of two autoinc values ==== + +Invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking prepared statement prep_1 invoking unsafe update of two autoinc columns. +PREPARE prep_1 FROM "INSERT INTO double_autoinc_table VALUES (NULL)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe update of two autoinc columns. +* binlog_format = STATEMENT: expect warning. +INSERT INTO double_autoinc_table VALUES (NULL); +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing unsafeness of UDF's ==== + +Invoking function func_retval_1 returning value from unsafe UDF. +CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN myfunc_int(10); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 VALUES (func_retval_1()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_1(); + +Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. +CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 VALUES (func_retval_2()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 VALUES (func_retval_2()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_2(); +DROP FUNCTION func_retval_2; + +Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. +CREATE VIEW view_retval_2 AS SELECT func_retval_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT func_retval_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_retval_1; + +Invoking function func_sidef_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe UDF. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe UDF. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe UDF. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_sidef_1 invoking unsafe UDF. +CREATE VIEW view_sidef_1 AS SELECT myfunc_int(10); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_1` AS SELECT myfunc_int(10) +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT * FROM view_sidef_1 +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking view view_sidef_1 invoking unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_sidef_1; + +Invoking prepared statement prep_1 invoking unsafe UDF. +PREPARE prep_1 FROM "INSERT INTO t0 VALUES (myfunc_int(10))"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe UDF. +* binlog_format = STATEMENT: expect warning. +INSERT INTO t0 VALUES (myfunc_int(10)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing unsafeness of access to mysql.general_log ==== + +Invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; END; +* binlog_format = STATEMENT: expect warning. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE VIEW view_retval_1 AS SELECT COUNT(*) FROM mysql.general_log; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_1` AS SELECT COUNT(*) FROM mysql.general_log +* binlog_format = STATEMENT: expect warning. +INSERT INTO t1 SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_1; + +Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect warning. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect warning. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT * FROM view_retval_1 +* binlog_format = STATEMENT: expect warning. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_retval_1; + +Invoking prepared statement prep_1 invoking unsafe use of mysql.general_log. +PREPARE prep_1 FROM "INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log"; +* binlog_format = STATEMENT: expect warning. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe use of mysql.general_log. +* binlog_format = STATEMENT: expect warning. +INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT COUNT(*) FROM mysql.general_log; +DROP TRIGGER double_autoinc_trig; +DROP TABLE t0, t1, t2, t3, ta1, ta2, ta3, +autoinc_table, double_autoinc_table, +data_table, +trigger_table_1, trigger_table_2, trigger_table_3; +DROP FUNCTION myfunc_int; +==== Special system variables that should *not* be unsafe ==== +CREATE TABLE t1 (a VARCHAR(1000)); +CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); INSERT INTO t1 VALUES (@@session.auto_increment_increment); INSERT INTO t1 VALUES (@@session.auto_increment_offset); -INSERT INTO t2 VALUES (@@session.character_set_client); -INSERT INTO t2 VALUES (@@session.collation_connection); -INSERT INTO t2 VALUES (@@session.collation_server); -INSERT INTO t2 VALUES (@@session.time_zone); -INSERT INTO t2 VALUES (@@session.lc_time_names); -INSERT INTO t2 VALUES (@@session.collation_database); -INSERT INTO t2 VALUES (@@session.timestamp); -INSERT INTO t2 VALUES (@@session.last_insert_id); +INSERT INTO t1 VALUES (@@session.character_set_client); +INSERT INTO t1 VALUES (@@session.character_set_connection); +INSERT INTO t1 VALUES (@@session.character_set_database); +INSERT INTO t1 VALUES (@@session.character_set_server); +INSERT INTO t1 VALUES (@@session.collation_connection); +INSERT INTO t1 VALUES (@@session.collation_database); +INSERT INTO t1 VALUES (@@session.collation_server); +INSERT INTO t1 VALUES (@@session.foreign_key_checks); +INSERT INTO t1 VALUES (@@session.identity); +INSERT INTO t1 VALUES (@@session.last_insert_id); +INSERT INTO t1 VALUES (@@session.lc_time_names); +INSERT INTO t1 VALUES (@@session.pseudo_thread_id); +INSERT INTO t1 VALUES (@@session.sql_auto_is_null); +INSERT INTO t1 VALUES (@@session.timestamp); +INSERT INTO t1 VALUES (@@session.time_zone); +INSERT INTO t1 VALUES (@@session.unique_checks); SET @my_var= 4711; INSERT INTO t1 VALUES (@my_var); -SET insert_id=12; -INSERT INTO t3 VALUES (NULL); -==== Clean up ==== -DROP PROCEDURE proc; -DROP FUNCTION func; -DROP TRIGGER trig; -DROP PROCEDURE proc1; -DROP FUNCTION func2; -DROP TRIGGER trig3; -DROP PROCEDURE proc4; -DROP FUNCTION func5; -DROP PREPARE prep6; -DROP TABLE t1, t2, t3, trigger_table, trigger_table2; +SET insert_id= 12; +INSERT INTO autoinc_table VALUES (NULL); +The following variables *should* give a warning, despite they are replicated. +INSERT INTO t1 VALUES (@@session.sql_mode); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (@@session.sql_mode) +INSERT INTO t1 VALUES (@@session.insert_id); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (@@session.insert_id) +DROP TABLE t1, autoinc_table; CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b)); INSERT INTO t1 SELECT * FROM t1 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t1 LIMIT 1 REPLACE INTO t1 SELECT * FROM t1 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: REPLACE INTO t1 SELECT * FROM t1 LIMIT 1 UPDATE t1 SET a=1 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET a=1 LIMIT 1 DELETE FROM t1 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: DELETE FROM t1 LIMIT 1 CREATE PROCEDURE p1() BEGIN INSERT INTO t1 SELECT * FROM t1 LIMIT 1; @@ -214,10 +2455,10 @@ DELETE FROM t1 LIMIT 1; END| CALL p1(); Warnings: -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: REPLACE INTO t1 SELECT * FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET a=1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: DELETE FROM t1 LIMIT 1 DROP PROCEDURE p1; DROP TABLE t1; DROP TABLE IF EXISTS t1; @@ -225,7 +2466,7 @@ CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100)); INSERT INTO t1 VALUES ('a','b'); UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1 DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1(i INT PRIMARY KEY); @@ -234,7 +2475,7 @@ CREATE TABLE t3(i INT, ch CHAR(50)); "Should issue message Statement may not be safe to log in statement format." INSERT INTO t1 SELECT * FROM t2 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t2 LIMIT 1 CREATE FUNCTION func6() RETURNS INT BEGIN @@ -246,7 +2487,10 @@ END| "Should issue message Statement may not be safe to log in statement format only once" INSERT INTO t3 VALUES(func6(), UUID()); Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (10) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (11) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (12) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t3 VALUES(func6(), UUID()) "Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements" CREATE FUNCTION fun_check_log_bin() RETURNS INT BEGIN @@ -259,7 +2503,7 @@ SELECT fun_check_log_bin(); fun_check_log_bin() 100 Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES(@@global.sync_binlog) "SQL_LOG_BIN should be ON still" SHOW VARIABLES LIKE "SQL_LOG_BIN"; Variable_name Value @@ -315,16 +2559,50 @@ CREATE TABLE t1(i INT PRIMARY KEY); CREATE TABLE t2(i INT PRIMARY KEY); INSERT INTO t1 SELECT * FROM t2 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t2 LIMIT 1 INSERT INTO t1 VALUES(@@global.sync_binlog); Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES(@@global.sync_binlog) UPDATE t1 SET i = 999 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET i = 999 LIMIT 1 DELETE FROM t1 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: DELETE FROM t1 LIMIT 1 DROP TABLE t1, t2; SET @@SESSION.SQL_MODE = @save_sql_mode; +SET @old_binlog_format = @@session.binlog_format; +SET binlog_format = MIXED; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1), (2); +CREATE PROCEDURE proc_insert_delayed () +BEGIN +INSERT DELAYED INTO t1 VALUES (1), (2); +END| +CREATE FUNCTION func_limit () +RETURNS INT +BEGIN +INSERT INTO t1 SELECT * FROM t2 LIMIT 1; +RETURN 1; +END| +RESET MASTER; +CALL proc_insert_delayed(); +SELECT func_limit(); +func_limit() +1 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +SET @@session.binlog_format = @old_binlog_format; +DROP TABLE t1, t2; +DROP PROCEDURE proc_insert_delayed; +DROP FUNCTION func_limit; "End of tests" diff --git a/mysql-test/suite/binlog/t/binlog_innodb.test b/mysql-test/suite/binlog/t/binlog_innodb.test index f84fd65226a..7b167a2971f 100644 --- a/mysql-test/suite/binlog/t/binlog_innodb.test +++ b/mysql-test/suite/binlog/t/binlog_innodb.test @@ -27,13 +27,13 @@ SET BINLOG_FORMAT=STATEMENT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -error ER_BINLOG_LOGGING_IMPOSSIBLE; +error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE; UPDATE t1 SET b = 1*a WHERE a > 1; COMMIT; BEGIN; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; -error ER_BINLOG_LOGGING_IMPOSSIBLE; +error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE; UPDATE t1 SET b = 2*a WHERE a > 2; COMMIT; diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test index c8136d669e4..2e80ba427e7 100644 --- a/mysql-test/suite/binlog/t/binlog_multi_engine.test +++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test @@ -60,7 +60,7 @@ let $wait_binlog_event= COMMIT; source include/wait_for_binlog_event.inc; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; -error ER_BINLOG_LOGGING_IMPOSSIBLE; +error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; # Not possible to test this since NDB writes its own binlog, which @@ -84,7 +84,7 @@ INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); -error ER_BINLOG_LOGGING_IMPOSSIBLE; +error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; # Not possible to test this since NDB writes its own binlog, which @@ -93,7 +93,7 @@ UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; #UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; -error ER_BINLOG_LOGGING_IMPOSSIBLE; +error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE; UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; source include/show_binlog_events.inc; diff --git a/mysql-test/suite/binlog/t/binlog_unsafe-master.opt b/mysql-test/suite/binlog/t/binlog_unsafe-master.opt new file mode 100644 index 00000000000..7d8786c156a --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_unsafe-master.opt @@ -0,0 +1 @@ +$UDF_EXAMPLE_LIB_OPT diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index c4e1f31cbce..2bf2f477166 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -1,34 +1,61 @@ +# ==== Background ==== +# +# Some statements may execute differently on master and slave when +# logged in statement format. Such statements are called unsafe. +# Unsafe statements include: +# +# - statements using @@variables (with a small number of exceptions; +# see below); +# - statements using certain functions, e.g., UUID(); +# - statements using LIMIT; +# - INSERT DELAYED; +# - insert into two autoinc columns; +# - statements using UDF's. +# - statements reading from log tables in the mysql database. +# +# Note that statements that use stored functions, stored procedures, +# triggers, views, or prepared statements that invoke unsafe +# statements shall also be unsafe. +# +# Unsafeness of a statement shall have the following consequences: +# +# 1. If the binlogging is on and the unsafe statement is logged: +# - If binlog_format=STATEMENT, the statement shall give a warning. +# - If binlog_format=MIXED or binlog_format=ROW, the statement shall +# be logged in row format. +# +# 2. If binlogging is off or the statement is not logged (e.g. SELECT +# UUID()), no warning shall be issued and the statement shall not +# be logged. +# +# Moreover, when a sub-statement of a recursive construct (i.e., +# stored function, stored procedure, trigger, view, or prepared +# statement) is unsafe and binlog_format=STATEMENT, then a warning +# shall be issued for every recursive construct. In effect, this +# creates a stack trace from the top-level statement to the unsafe +# statement. +# +# # ==== Purpose ==== # -# Some statements can not be written to the binlog in a safe manner -# with statement-based replication, either because they rely on -# features that are local to the server they are replicated from -# (e.g., @@variables), or because they include nondeterministic -# queries (e.g., LIMIT), or because the time at which the query is -# executed cannot be determined (e.g., INSERT DELAYED). Such -# statements should be marked unsafe. All unsafe statements should -# give a warning. -# Yet the warning/error message isn't issued when SQL_LOG_BIN is turned off. +# This test verifies that a warning is generated when it should, +# according to the rules above. # -# This test verifies that a warning is generated for statements that -# should be unsafe, when they are executed under statement mode -# logging. -# -# All variables should be unsafe, with some exceptions. Therefore, -# this test also verifies that the exceptions do *not* generare a +# All @@variables should be unsafe, with some exceptions. Therefore, +# this test also verifies that the exceptions do *not* generate a # warning. # # # ==== Method ==== # -# We try an INSERT DELAYED statement and verify that a warning is -# issued. +# 1. Each type of statements listed above is executed. # -# We try to insert unsafe variables into a table in several ways: -# directly with an INSERT statement, from a stored procedure, from a -# stored function, from a trigger, from a prepared statement, and from -# a complicated nesting of triggers, functions, procedures, and -# prepared statements. In all cases, a warning should be issued. +# 2. Each unsafe statement is wrapped in each type of recursive +# construct (stored function, stored procedure, trigger, view, or +# prepared statement). +# +# 3. Each unsafe statement is wrapped in two levels of recursive +# constructs (function invoking trigger invoking UUID(), etc). # # We try to insert the variables that should not be unsafe into a # table, and verify that *no* warning is issued. @@ -38,7 +65,8 @@ # Execute a unsafe statement calling a trigger or stored function # or neither when @@SQL_LOG_BIN is turned OFF, # no warning/error is issued - +# +# # ==== Related bugs and worklogs ==== # # WL#3339: Issue warnings when statement-based replication may fail @@ -47,6 +75,9 @@ # BUG#34768: nondeterministic INSERT using LIMIT logged in stmt mode if binlog_format=mixed # BUG#41980, SBL, INSERT .. SELECT .. LIMIT = ERROR, even when @@SQL_LOG_BIN is 0 # BUG#42640: mysqld crashes when unsafe statements are executed (STRICT_TRANS_TABLES mode) +# BUG#45825: INSERT DELAYED is not unsafe: logged in statement format +# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED +# # # ==== Related test cases ==== # @@ -57,192 +88,265 @@ # rpl.rpl_variables_stm tests the small subset of variables that # actually can be replicated safely in statement mode. # -# -# ==== Todo ==== -# -# There are several other ways to create unsafe statements: see, e.g., -# WL#3339, BUG#34768. +# rpl_ndb.rpl_ndb_binlog_format_errors tests all errors and warnings +# related to logging format (not just 'Unsafe statement binlogged in +# statement mode since BINLOG_FORMAT = STATEMENT'). source include/have_log_bin.inc; source include/have_binlog_format_statement.inc; ---echo ==== Setup tables ==== +--echo #### Setup tables #### -CREATE TABLE t1 (a INT); +CREATE TABLE t0 (a CHAR(40)); +CREATE TABLE t1 (a CHAR(40)); CREATE TABLE t2 (a CHAR(40)); -CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY); -CREATE TABLE trigger_table (a CHAR(7)); -CREATE TABLE trigger_table2 (a INT); - - ---echo ==== Non-deterministic statements ==== - -INSERT DELAYED INTO t1 VALUES (5); - - ---echo ==== Some variables that *should* be unsafe ==== - ---echo ---- Insert directly ---- - -INSERT INTO t1 VALUES (@@global.sync_binlog); -INSERT INTO t1 VALUES (@@session.insert_id); -INSERT INTO t1 VALUES (@@global.auto_increment_increment); -INSERT INTO t2 SELECT UUID(); -INSERT INTO t2 VALUES (@@session.sql_mode); -INSERT INTO t2 VALUES (@@global.init_slave); -INSERT INTO t2 VALUES (@@hostname); - ---echo ---- Insert from stored procedure ---- - -DELIMITER |; -CREATE PROCEDURE proc() -BEGIN - INSERT INTO t1 VALUES (@@global.sync_binlog); - INSERT INTO t1 VALUES (@@session.insert_id); - INSERT INTO t1 VALUES (@@global.auto_increment_increment); - INSERT INTO t2 SELECT UUID(); - INSERT INTO t2 VALUES (@@session.sql_mode); - INSERT INTO t2 VALUES (@@global.init_slave); - INSERT INTO t2 VALUES (@@hostname); +CREATE TABLE t3 (a CHAR(40)); +CREATE TABLE ta1 (a CHAR(40)); +CREATE TABLE ta2 (a CHAR(40)); +CREATE TABLE ta3 (a CHAR(40)); +CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE double_autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); +--DELIMITER | +CREATE TRIGGER double_autoinc_trig BEFORE INSERT ON double_autoinc_table FOR EACH ROW BEGIN + INSERT INTO autoinc_table VALUES (NULL); END| -DELIMITER ;| +--DELIMITER ; +CREATE TABLE data_table (a CHAR(40)); +INSERT INTO data_table VALUES ('foo'); +CREATE TABLE trigger_table_1 (a INT); +CREATE TABLE trigger_table_2 (a INT); +CREATE TABLE trigger_table_3 (a INT); +--replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB +eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; -CALL proc(); +# In each iteration of this loop, we select one method to make the +# statement unsafe. +let $unsafe_type= 0; +while (`SELECT $unsafe_type < 7`) { ---echo ---- Insert from stored function ---- + --echo -DELIMITER |; -CREATE FUNCTION func() -RETURNS INT -BEGIN - INSERT INTO t1 VALUES (@@global.sync_binlog); - INSERT INTO t1 VALUES (@@session.insert_id); - INSERT INTO t1 VALUES (@@global.auto_increment_increment); - INSERT INTO t2 SELECT UUID(); - INSERT INTO t2 VALUES (@@session.sql_mode); - INSERT INTO t2 VALUES (@@global.init_slave); - INSERT INTO t2 VALUES (@@hostname); - RETURN 0; -END| -DELIMITER ;| + if (`SELECT $unsafe_type = 0`) { + --echo ==== Testing UUID() unsafeness ==== + let $desc_0= unsafe UUID() function; + let $stmt_sidef_0= INSERT INTO t0 VALUES (UUID()); + let $value_0= UUID(); + let $sel_sidef_0=; + let $sel_retval_0= SELECT UUID(); + } -SELECT func(); + if (`SELECT $unsafe_type = 1`) { + --echo ==== Testing @@hostname unsafeness ==== + let $desc_0= unsafe @@hostname variable; + let $stmt_sidef_0= INSERT INTO t0 VALUES (@@hostname); + let $value_0= @@hostname; + let $sel_sidef_0=; + # $sel_retval is going to be used in views. Views cannot execute + # statements that refer to @@variables. Hence, we set $set_retval + # to empty instead of SELECT @@hostname. + let $sel_retval_0=; + } ---echo ---- Insert from trigger ---- + if (`SELECT $unsafe_type = 2`) { + --echo ==== Testing SELECT...LIMIT unsafeness ==== + let $desc_0= unsafe SELECT...LIMIT statement; + let $stmt_sidef_0= INSERT INTO t0 SELECT * FROM data_table LIMIT 1; + let $value_0=; + let $sel_sidef_0=; + let $sel_retval_0= SELECT * FROM data_table LIMIT 1; + } -DELIMITER |; -CREATE TRIGGER trig -BEFORE INSERT ON trigger_table -FOR EACH ROW -BEGIN - INSERT INTO t1 VALUES (@@global.sync_binlog); - INSERT INTO t1 VALUES (@@session.insert_id); - INSERT INTO t1 VALUES (@@global.auto_increment_increment); - INSERT INTO t2 SELECT UUID(); - INSERT INTO t2 VALUES (@@session.sql_mode); - INSERT INTO t2 VALUES (@@global.init_slave); - INSERT INTO t2 VALUES (@@hostname); -END| -DELIMITER ;| + if (`SELECT $unsafe_type = 3`) { + --echo ==== Testing INSERT DELAYED unsafeness ==== + let $desc_0= unsafe INSERT DELAYED statement; + let $stmt_sidef_0= INSERT DELAYED INTO t0 VALUES (1), (2); + let $value_0=; + let $sel_sidef_0=; + let $sel_retval_0=; + } -INSERT INTO trigger_table VALUES ('bye.'); + if (`SELECT $unsafe_type = 4`) { + --echo ==== Testing unsafeness of insert of two autoinc values ==== + let $desc_0= unsafe update of two autoinc columns; + let $stmt_sidef_0= INSERT INTO double_autoinc_table VALUES (NULL); + let $value_0=; + let $sel_sidef_0=; + let $sel_retval_0=; + } ---echo ---- Insert from prepared statement ---- + if (`SELECT $unsafe_type = 5`) { + --echo ==== Testing unsafeness of UDF's ==== + let $desc_0= unsafe UDF; + let $stmt_sidef_0= INSERT INTO t0 VALUES (myfunc_int(10)); + let $value_0= myfunc_int(10); + let $sel_sidef_0= SELECT myfunc_int(10); + let $sel_retval_0= ; + } -PREPARE p1 FROM 'INSERT INTO t1 VALUES (@@global.sync_binlog)'; -PREPARE p2 FROM 'INSERT INTO t1 VALUES (@@session.insert_id)'; -PREPARE p3 FROM 'INSERT INTO t1 VALUES (@@global.auto_increment_increment)'; -PREPARE p4 FROM 'INSERT INTO t2 SELECT UUID()'; -PREPARE p5 FROM 'INSERT INTO t2 VALUES (@@session.sql_mode)'; -PREPARE p6 FROM 'INSERT INTO t2 VALUES (@@global.init_slave)'; -PREPARE p7 FROM 'INSERT INTO t2 VALUES (@@hostname)'; + if (`SELECT $unsafe_type = 6`) { + --echo ==== Testing unsafeness of access to mysql.general_log ==== + let $desc_0= unsafe use of mysql.general_log; + let $stmt_sidef_0= INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; + let $value_0=; + let $sel_sidef_0=; + let $sel_retval_0= SELECT COUNT(*) FROM mysql.general_log; + } -EXECUTE p1; EXECUTE p2; EXECUTE p3; EXECUTE p4; EXECUTE p5; -EXECUTE p6; EXECUTE p7; + # In each iteration of the following loop, we select one way to + # enclose the unsafe statement as a sub-statement of a recursive + # construct (i.e., a function, procedure, trigger, view, or prepared + # statement). + # + # In the last iteration, $call_type_1=7, we don't create a recursive + # construct. Instead, we just invoke the unsafe statement directly. ---echo ---- Insert from nested call of triggers / functions / procedures ---- + let $call_type_1= 0; + while (`SELECT $call_type_1 < 8`) { + #--echo debug: level 1, types $call_type_1 -> $unsafe_type + let $CRC_ARG_level= 1; + let $CRC_ARG_type= $call_type_1; + let $CRC_ARG_stmt_sidef= $stmt_sidef_0; + let $CRC_ARG_value= $value_0; + let $CRC_ARG_sel_sidef= $sel_sidef_0; + let $CRC_ARG_sel_retval= $sel_retval_0; + let $CRC_ARG_desc= $desc_0; + source extra/rpl_tests/create_recursive_construct.inc; + let $stmt_sidef_1= $CRC_RET_stmt_sidef; + let $value_1= $CRC_RET_value; + let $sel_sidef_1= $CRC_RET_sel_sidef; + let $sel_retval_1= $CRC_RET_sel_retval; + let $is_toplevel_1= $CRC_RET_is_toplevel; + let $drop_1= $CRC_RET_drop; + let $desc_1= $CRC_RET_desc; -DELIMITER |; + # Some statements must be top-level statements, i.e., cannot be + # called as a sub-statement of any recursive construct. (One + # example is 'EXECUTE prepared_stmt'). When + # create_recursive_construct.inc creates a top-level statement, it + # sets $CRC_RET_is_toplevel=1. -# proc1: cause trigger 'trig' above to be triggered. -CREATE PROCEDURE proc1() - INSERT INTO trigger_table VALUES ('ha!')| + if (!$is_toplevel_1) { -# func2: call proc1 above. -CREATE FUNCTION func2() -RETURNS INT -BEGIN - CALL proc1(); - RETURN 0; -END| + # In each iteration of this loop, we select one way to enclose + # the previous recursive construct in another recursive + # construct. -# trig3: call func2 above -CREATE TRIGGER trig3 -BEFORE INSERT ON trigger_table2 -FOR EACH ROW -BEGIN - DECLARE tmp INT; - SELECT func2() INTO tmp; -END| + let $call_type_2= 0; + while (`SELECT $call_type_2 < 7`) { + #--echo debug: level 2, types $call_type_2 -> $call_type_1 -> $unsafe_type + let $CRC_ARG_level= 2; + let $CRC_ARG_type= $call_type_2; + let $CRC_ARG_stmt_sidef= $stmt_sidef_1; + let $CRC_ARG_value= $value_1; + let $CRC_ARG_sel_sidef= $sel_sidef_1; + let $CRC_ARG_sel_retval= $sel_retval_1; + let $CRC_ARG_desc= $desc_1; + source extra/rpl_tests/create_recursive_construct.inc; + let $stmt_sidef_2= $CRC_RET_stmt_sidef; + let $value_2= $CRC_RET_value; + let $sel_sidef_2= $CRC_RET_sel_sidef; + let $sel_retval_2= $CRC_RET_sel_retval; + let $is_toplevel_2= $CRC_RET_is_toplevel; + let $drop_2= $CRC_RET_drop; + let $desc_2= $CRC_RET_desc; -# proc4: cause trig3 above to be triggered. -CREATE PROCEDURE proc4() - INSERT INTO trigger_table2 VALUES (1)| + if (!$is_toplevel_2) { -# func5: call proc4 above. -CREATE FUNCTION func5() -RETURNS INT -BEGIN - CALL proc4; - RETURN 0; -END| + # Conditioned out since it makes result file really big. -# prep6: call func5() above. -PREPARE prep6 FROM 'SELECT func5()'| + if (0) { -DELIMITER ;| + # In each iteration of this loop, we select one way to enclose + # the previous recursive construct in another recursive + # construct. -# try a complicated call path to trigger 'trig'. -EXECUTE prep6; + let $call_type_3= 0; + while (`SELECT $call_type_3 < 7`) { + #--echo debug: level 3, types $call_type_2 -> $call_type_2 -> $call_type_1 -> $unsafe_type + let $CRC_ARG_level= 3; + let $CRC_ARG_type= $call_type_3; + let $CRC_ARG_stmt_sidef= $stmt_sidef_2; + let $CRC_ARG_value= $value_2; + let $CRC_ARG_sel_sidef= $sel_sidef_2; + let $CRC_ARG_sel_retval= $sel_retval_2; + let $CRC_ARG_desc= $desc_2; + source extra/rpl_tests/create_recursive_construct.inc; + + # Drop created object. + if (`SELECT '$drop_3' != ''`) { + eval $drop_3; + } + inc $call_type_3; + } # while (call_type_3) + } # if (0) + } # if (!is_toplevel_2) + + # Drop created object. + if (`SELECT '$drop_2' != ''`) { + eval $drop_2; + } + inc $call_type_2; + } # while (call_type_2) + } # if (!is_toplevel_1) + + # Drop created object. + if (`SELECT '$drop_1' != ''`) { + eval $drop_1; + } + inc $call_type_1; + } # while (call_type_1) + + inc $unsafe_type; +} # while (unsafe_type) + +DROP TRIGGER double_autoinc_trig; +DROP TABLE t0, t1, t2, t3, ta1, ta2, ta3, + autoinc_table, double_autoinc_table, + data_table, + trigger_table_1, trigger_table_2, trigger_table_3; +DROP FUNCTION myfunc_int; ---echo ==== Variables that should *not* be unsafe ==== +--echo ==== Special system variables that should *not* be unsafe ==== + +CREATE TABLE t1 (a VARCHAR(1000)); +CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); -INSERT INTO t1 VALUES (@@session.pseudo_thread_id); -INSERT INTO t1 VALUES (@@session.pseudo_thread_id); -INSERT INTO t1 VALUES (@@session.foreign_key_checks); -INSERT INTO t1 VALUES (@@session.sql_auto_is_null); -INSERT INTO t1 VALUES (@@session.unique_checks); INSERT INTO t1 VALUES (@@session.auto_increment_increment); INSERT INTO t1 VALUES (@@session.auto_increment_offset); -INSERT INTO t2 VALUES (@@session.character_set_client); -INSERT INTO t2 VALUES (@@session.collation_connection); -INSERT INTO t2 VALUES (@@session.collation_server); -INSERT INTO t2 VALUES (@@session.time_zone); -INSERT INTO t2 VALUES (@@session.lc_time_names); -INSERT INTO t2 VALUES (@@session.collation_database); -INSERT INTO t2 VALUES (@@session.timestamp); -INSERT INTO t2 VALUES (@@session.last_insert_id); +INSERT INTO t1 VALUES (@@session.character_set_client); +INSERT INTO t1 VALUES (@@session.character_set_connection); +INSERT INTO t1 VALUES (@@session.character_set_database); +INSERT INTO t1 VALUES (@@session.character_set_server); +INSERT INTO t1 VALUES (@@session.collation_connection); +INSERT INTO t1 VALUES (@@session.collation_database); +INSERT INTO t1 VALUES (@@session.collation_server); +INSERT INTO t1 VALUES (@@session.foreign_key_checks); +INSERT INTO t1 VALUES (@@session.identity); +INSERT INTO t1 VALUES (@@session.last_insert_id); +INSERT INTO t1 VALUES (@@session.lc_time_names); +INSERT INTO t1 VALUES (@@session.pseudo_thread_id); +INSERT INTO t1 VALUES (@@session.sql_auto_is_null); +INSERT INTO t1 VALUES (@@session.timestamp); +INSERT INTO t1 VALUES (@@session.time_zone); +INSERT INTO t1 VALUES (@@session.unique_checks); + SET @my_var= 4711; INSERT INTO t1 VALUES (@my_var); # using insert_id implicitly should be ok. -SET insert_id=12; -INSERT INTO t3 VALUES (NULL); +SET insert_id= 12; +INSERT INTO autoinc_table VALUES (NULL); + +# See set_var.cc for explanation. +--echo The following variables *should* give a warning, despite they are replicated. +INSERT INTO t1 VALUES (@@session.sql_mode); +INSERT INTO t1 VALUES (@@session.insert_id); ---echo ==== Clean up ==== +DROP TABLE t1, autoinc_table; + -DROP PROCEDURE proc; -DROP FUNCTION func; -DROP TRIGGER trig; -DROP PROCEDURE proc1; -DROP FUNCTION func2; -DROP TRIGGER trig3; -DROP PROCEDURE proc4; -DROP FUNCTION func5; -DROP PREPARE prep6; -DROP TABLE t1, t2, t3, trigger_table, trigger_table2; # # BUG#34768 - nondeterministic INSERT using LIMIT logged in stmt mode if # binlog_format=mixed @@ -388,4 +492,41 @@ DELETE FROM t1 LIMIT 1; DROP TABLE t1, t2; SET @@SESSION.SQL_MODE = @save_sql_mode; + +# +# BUG#45825: INSERT DELAYED is not unsafe: logged in statement format +# BUG#45785: LIMIT in SP does not cause RBL if binlog_format=MIXED +# +SET @old_binlog_format = @@session.binlog_format; +SET binlog_format = MIXED; + +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1), (2); + +--DELIMITER | +CREATE PROCEDURE proc_insert_delayed () +BEGIN + INSERT DELAYED INTO t1 VALUES (1), (2); +END| + +CREATE FUNCTION func_limit () +RETURNS INT +BEGIN + INSERT INTO t1 SELECT * FROM t2 LIMIT 1; + RETURN 1; +END| +--DELIMITER ; + +RESET MASTER; +CALL proc_insert_delayed(); +SELECT func_limit(); +source include/show_binlog_events.inc; + +SET @@session.binlog_format = @old_binlog_format; +DROP TABLE t1, t2; +DROP PROCEDURE proc_insert_delayed; +DROP FUNCTION func_limit; + + --echo "End of tests" diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result index b797183f9d2..0652235a734 100644 --- a/mysql-test/suite/rpl/r/rpl_events.result +++ b/mysql-test/suite/rpl/r/rpl_events.result @@ -6,96 +6,6 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; SET @old_event_scheduler = @@global.event_scheduler; set global event_scheduler=1; -set binlog_format=row; -DROP EVENT IF EXISTS test.justonce; -drop table if exists t1,t2; -CREATE TABLE `t1` ( -`id` INT(10) UNSIGNED NOT NULL, -`c` VARCHAR(50) NOT NULL, -`ts` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -INSERT INTO t1 (id, c) VALUES (1, 'manually'); -"Creating event test.justonce on the master" -CREATE EVENT test.justonce ON SCHEDULE EVERY 2 SECOND DO -INSERT IGNORE INTO t1 (id, c) VALUES (2, 'from justonce'); -"Checking event is active on master" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; -db name status originator -test justonce ENABLED 1 -"Checking event data on the master" -ONE -1 -"Checking event data on the slave" -ZERO -0 -"Checking event is inactive on slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'justonce'; -db name status originator -test justonce SLAVESIDE_DISABLED 1 -"Dropping event test.slave_once on the slave" -DROP EVENT IF EXISTS test.slave_once; -CREATE EVENT test.slave_once ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO -INSERT IGNORE INTO t1(id, c) VALUES (3, 'from slave_once'); -"Checking event status on the slave for originator value = slave's server_id" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_once'; -db name status originator -test slave_once ENABLED 2 -"Dropping event test.slave_once on the slave" -DROP EVENT IF EXISTS test.slave_once; -"Dropping event test.justonce on the master" -DROP EVENT IF EXISTS test.justonce; -"Creating event test.er on the master" -CREATE EVENT test.er ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO -INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er'); -"Checking event status on the master" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator body -test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er') -"Checking event status on the slave" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator body -test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er') -"Altering event test.er on the master" -ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO -INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er'); -"Checking event status on the master" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator body -test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er') -"Checking event status on the slave" -SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er'; -db name status originator body -test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er') -"Dropping event test.er on the master" -DROP EVENT test.er; -"Checking event status on the master" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; -db name status originator -"Checking event status on the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test'; -db name status originator -"Creating event test.slave_terminate on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO -INSERT IGNORE INTO t1(id, c) VALUES (6, 'from slave_terminate'); -"Checking event status on the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; -db name status originator -test slave_terminate ENABLED 2 -"Dropping event test.slave_terminate on the slave" -DROP EVENT test.slave_terminate; -"Creating event test.slave_terminate with DISABLE ON SLAVE on the slave" -CREATE EVENT test.slave_terminate ON SCHEDULE EVERY 3 SECOND DISABLE ON SLAVE DO -INSERT IGNORE INTO t1(c) VALUES (7, 'from slave_terminate'); -"Checking event status on the slave" -SELECT db, name, status, originator FROM mysql.event WHERE db = 'test' AND name = 'slave_terminate'; -db name status originator -test slave_terminate SLAVESIDE_DISABLED 2 -"Dropping event test.slave_terminate on the slave" -DROP EVENT test.slave_terminate; -"Cleanup" -DROP TABLE t1; -set binlog_format=statement; DROP EVENT IF EXISTS test.justonce; drop table if exists t1,t2; CREATE TABLE `t1` ( diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index ad67f96db71..dc1efaf77e7 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -set binlog_format=row; *********************************************************** *********************************************************** @@ -1145,2285 +1144,3 @@ c1 hex(c4) c5 3 6231623162316231 QA DROP TABLE t5; -set binlog_format=statement; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format STATEMENT and engine == 'InnoDB' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='InnoDB'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='InnoDB'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; - -** Check slave status ** - -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='InnoDB'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='InnoDB'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='InnoDB'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; - -set binlog_format=mixed; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format MIXED and engine == 'InnoDB' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='InnoDB'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='InnoDB'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='InnoDB'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='InnoDB'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; - -** Check slave status ** - -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='InnoDB'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='InnoDB'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='InnoDB'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='InnoDB'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='InnoDB'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; - diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 8859a8e24e3..d53886f98ea 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -set binlog_format=row; *********************************************************** *********************************************************** @@ -1145,2285 +1144,3 @@ c1 hex(c4) c5 3 6231623162316231 QA DROP TABLE t5; -set binlog_format=statement; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format STATEMENT and engine == 'MyISAM' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='MyISAM'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='MyISAM'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; - -** Check slave status ** - -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='MyISAM'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='MyISAM'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='MyISAM'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; - -set binlog_format=mixed; - -*********************************************************** -*********************************************************** -***************** Start of Testing ************************ -*********************************************************** -*********************************************************** -* This test format == binlog_format MIXED and engine == 'MyISAM' -*********************************************************** -*********************************************************** - -***** Testing more columns on the Master ***** - -CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 FLOAT DEFAULT '2.00', -f6 CHAR(4) DEFAULT 'TEST', -f7 INT DEFAULT '0', -f8 TEXT, -f9 LONGBLOB, -f10 BIT(63), -f11 VARBINARY(64))ENGINE='MyISAM'; - -* Alter Table on Slave and drop columns f5 through f11 * - -alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; - -* Insert data in Master then update and delete some rows* - -* Select count and 20 rows from Master * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9, -hex(f10),hex(f11) FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11) -2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -3 3 3 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -5 5 5 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -6 6 6 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -8 8 8 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -9 9 9 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -11 11 11 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -12 12 12 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -14 14 14 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -15 15 15 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -17 17 17 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -18 18 18 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -20 20 20 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -21 21 21 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -23 23 23 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -24 24 24 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -26 26 26 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 -30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456 - -* Select count and 20 rows from Slave * - -SELECT COUNT(*) FROM t1; -COUNT(*) -40 - -SELECT * FROM t1 ORDER BY f3 LIMIT 20; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next - -* Show Slave Status * - -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - - -***** Testing Altering table def scenario ***** - -CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f7 DECIMAL(17,9) default '1000.00', -f8 MEDIUMBLOB, -f9 NUMERIC(6,4) default '2000.00', -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 - -CREATE TABLE t3 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 ENUM('a', 'b', 'c') default 'a', -f8 MEDIUMBLOB, -f10 VARCHAR(1024), -f11 BINARY(20) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f12 SET('a', 'b', 'c') default 'b') -ENGINE='MyISAM'; - -CREATE TABLE t4 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 DOUBLE DEFAULT '2.00', -f6 DECIMAL(17,9) default '1000.00', -f7 MEDIUMBLOB, -f8 NUMERIC(6,4) default '2000.00', -f9 VARCHAR(1024), -f10 BINARY(20) not null default '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', -f11 CHAR(255)) -ENGINE='MyISAM'; -Warnings: -Warning 1264 Out of range value for column 'f8' at row 1 - -CREATE TABLE t31 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20), -/* extra */ -f5 BIGINT, -f6 BLOB, -f7 DATE, -f8 DATETIME, -f9 FLOAT, -f10 INT, -f11 LONGBLOB, -f12 LONGTEXT, -f13 MEDIUMBLOB, -f14 MEDIUMINT, -f15 MEDIUMTEXT, -f16 REAL, -f17 SMALLINT, -f18 TEXT, -f19 TIME, -f20 TIMESTAMP, -f21 TINYBLOB, -f22 TINYINT, -f23 TINYTEXT, -f24 YEAR, -f25 BINARY(255), -f26 BIT(64), -f27 CHAR(255), -f28 DECIMAL(30,7), -f29 DOUBLE, -f30 ENUM ('a','b', 'c') default 'a', -f31 FLOAT, -f32 NUMERIC(17,9), -f33 SET ('a', 'b', 'c') default 'b', -f34 VARBINARY(1025), -f35 VARCHAR(257) -) ENGINE='MyISAM'; - -** Alter tables on slave and drop columns ** - -alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop -f12; -alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12; -alter table t4 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11; -alter table t31 -drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, -drop f12, drop f13, drop f14, drop f15, drop f16, drop f17, drop f18, -drop f19, drop f20, drop f21, drop f22, drop f23, drop f24, drop f25, -drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32, -drop f33, drop f34, drop f35; - -** Insert Data into Master ** -INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10: -some var char'; -INSERT into t2 values (2, 2, 2, 'second', -2.0, 'b', 2000.0002, 'f8: medium size blob', 2000, 'f10: some var char', -'01234567', 'c'), -(3, 3, 3, 'third', -3.0, 'b', 3000.0003, 'f8: medium size blob', 3000, 'f10: some var char', -'01234567', 'c'); -Warnings: -Warning 1264 Out of range value for column 'f9' at row 1 -Warning 1264 Out of range value for column 'f9' at row 2 -INSERT into t3 set f1=1, f2=1, f3=1, f4='first', f10='f10: some var char'; -INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10: -binary data'; -INSERT into t31 set f1=1, f2=1, f3=1, f4='first'; -INSERT into t31 set f1=1, f2=1, f3=2, f4='second', -f9=2.2, f10='seven samurai', f28=222.222, f35='222'; -Warnings: -Warning 1366 Incorrect integer value: 'seven samurai' for column 'f10' at row 1 -INSERT into t31 values (1, 1, 3, 'third', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -INSERT into t31 values (1, 1, 4, 'fourth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 5, 'fifth', -/* f5 BIGINT, */ 333333333333333333333333, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ 'three times three' - ), -(1, 1, 6, 'sixth', -/* f5 BIGINT, */ NULL, -/* f6 BLOB, */ '3333333333333333333333', -/* f7 DATE, */ '2007-07-18', -/* f8 DATETIME, */ "2007-07-18", -/* f9 FLOAT, */ 3.33333333, -/* f10 INT, */ 333333333, -/* f11 LONGBLOB, */ '3333333333333333333', -/* f12 LONGTEXT, */ '3333333333333333333', -/* f13 MEDIUMBLOB, */ '3333333333333333333', -/* f14 MEDIUMINT, */ 33, -/* f15 MEDIUMTEXT, */ 3.3, -/* f16 REAL, */ 3.3, -/* f17 SMALLINT, */ 3, -/* f18 TEXT, */ '33', -/* f19 TIME, */ '2:59:58.999', -/* f20 TIMESTAMP, */ 20000303000000, -/* f21 TINYBLOB, */ '3333', -/* f22 TINYINT, */ 3, -/* f23 TINYTEXT, */ '3', -/* f24 YEAR, */ 3000, -/* f25 BINARY(255), */ 'three_33333', -/* f26 BIT(64), */ b'011', -/* f27 CHAR(255), */ 'three', -/* f28 DECIMAL(30,7), */ 3.333, -/* f29 DOUBLE, */ 3.333333333333333333333333333, -/* f30 ENUM ('a','b','c')*/ 'c', -/* f31 FLOAT, */ 3.0, -/* f32 NUMERIC(17,9), */ 3.3333, -/* f33 SET ('a','b','c'),*/ 'c', -/*f34 VARBINARY(1025),*/ '3333 minus 3', -/*f35 VARCHAR(257),*/ NULL -); -Warnings: -Warning 1264 Out of range value for column 'f5' at row 1 -Warning 1264 Out of range value for column 'f24' at row 1 -Warning 1264 Out of range value for column 'f5' at row 2 -Warning 1264 Out of range value for column 'f24' at row 2 -Warning 1264 Out of range value for column 'f24' at row 3 - -** Sync slave with master ** -** Do selects from tables ** - -select * from t1 order by f3; -f1 f2 f3 f4 -2 2 2 second -3 3 3 next -5 5 5 second -6 6 6 next -8 8 8 second -9 9 9 next -11 11 11 second -12 12 12 next -14 14 14 second -15 15 15 next -17 17 17 second -18 18 18 next -20 20 20 second -21 21 21 next -23 23 23 second -24 24 24 next -26 26 26 second -27 27 27 next -29 29 29 second -30 30 30 next -31 31 31 second -32 32 32 second -33 33 33 second -34 34 34 second -35 35 35 second -36 36 36 second -37 37 37 second -38 38 38 second -39 39 39 second -40 40 40 second -41 41 41 second -42 42 42 second -43 43 43 second -44 44 44 second -45 45 45 second -46 46 46 second -47 47 47 second -48 48 48 second -49 49 49 second -50 50 50 second -select * from t2 order by f1; -f1 f2 f3 f4 -1 1 1 first -2 2 2 second -3 3 3 third -select * from t3 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t4 order by f1; -f1 f2 f3 f4 -1 1 1 first -select * from t31 order by f3; -f1 f2 f3 f4 -1 1 1 first -1 1 2 second -1 1 3 third -1 1 4 fourth -1 1 5 fifth -1 1 6 sixth - -** Do updates master ** - -update t31 set f5=555555555555555 where f3=6; -update t31 set f2=2 where f3=2; -update t31 set f1=NULL where f3=1; -update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3; -Warnings: -Warning 1048 Column 'f3' cannot be null - -** Delete from Master ** - -delete from t1; -delete from t2; -delete from t3; -delete from t4; -delete from t31; - -** Check slave status ** - -select * from t31; -f1 f2 f3 f4 -show slave status;; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running Yes -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 0 -Last_Error -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 0 -Last_SQL_Error - -**************************************** -* columns in master at middle of table * -* Expect: Proper error message * -**************************************** - -** Stop and Reset Slave ** - -STOP SLAVE; -RESET SLAVE; - -** create table slave side ** -CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5) -) ENGINE='MyISAM'; - -** Connect to master and create table ** - -CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233', -c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT), -(2,@b1,DEFAULT,'JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t10 *** -DROP TABLE t10; - -********************************************* -* More columns in master at middle of table * -* Expect: Proper error message * -********************************************* - -*** Create t11 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) -) ENGINE='MyISAM'; - -*** Create t11 on Master *** -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT), -(2,@b1,'Testing is cool','JOE',DEFAULT), -(3,@b1,DEFAULT,'QA',DEFAULT); - -******************************************** -*** Expect slave to fail with Error 1523 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 -SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; -START SLAVE; - -*** Drop t11 *** -DROP TABLE t11; - -********************************************* -* More columns in master at middle of table * -* Expect: This one should pass blob-text * -********************************************* - -*** Create t12 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB -) ENGINE='MyISAM'; - -*** Create t12 on Master *** -CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT, -c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',DEFAULT,DEFAULT), -(3,@b1,'QA',DEFAULT,DEFAULT); - -SELECT a,hex(b),f,c,e FROM t12 ORDER BY a; -a hex(b) f c e -1 62316231623162316231623162316231 Kyle test 1 -2 62316231623162316231623162316231 JOE test 1 -3 62316231623162316231623162316231 QA test 1 - -*** Select on Slave *** -SELECT a,hex(b),c FROM t12 ORDER BY a; -a hex(b) c -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -*** Drop t12 *** -DROP TABLE t12; - -**************************************************** -* - Alter Master adding columns at middle of table * -* Expect: columns added * -**************************************************** - - -*** Create t14 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t14 on Master *** -CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1; -ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2; - -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t14 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle',DEFAULT,DEFAULT), -(2,2.00,'This Test Should work',@b1,'JOE',DEFAULT,DEFAULT), -(3,3.00,'If is does not, I will open a bug',@b1,'QA',DEFAULT,DEFAULT); - -SELECT c1,c2,c3,hex(c4),c5,c6,c7 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 c6 c7 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 2.00 This Test Should work 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP - -*** Select on Slave **** -SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1; -c1 c2 c3 hex(c4) c5 -1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle -2 2.00 This Test Should work 62316231623162316231623162316231 JOE -3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA - -**************************************************** -* - Alter Master Dropping columns from the middle. * -* Expect: columns dropped * -**************************************************** - -*** connect to master and drop columns *** -ALTER TABLE t14 DROP COLUMN c2; -ALTER TABLE t14 DROP COLUMN c7; - -*** Select from Master *** -SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDER BY c1; -c1 c3 hex(c4) c5 c6 -1 Replication Testing Extra Col 62316231623162316231623162316231 Kyle 1 -2 This Test Should work 62316231623162316231623162316231 JOE 1 -3 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 - -************ -* Bug30415 * -************ -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1091 -Last_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1091 -Last_SQL_Error Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t14 *** -DROP TABLE t14; -DROP TABLE t14; -RESET MASTER; -START SLAVE; - -************************************************* -* - Alter Master adding columns at end of table * -* Expect: Error 1054 * -************************************************* - -*** Create t15 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t15 on Master *** -CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7; -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t15 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT,3.00), -(2,@b1,'JOE',DEFAULT,DEFAULT,3.00), -(3,@b1,'QA',DEFAULT,DEFAULT,3.00); -SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 ORDER BY c1; -c1 hex(c4) c5 c6 c7 c2 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP 3.00 -2 62316231623162316231623162316231 JOE 1 CURRENT_TIMESTAMP 3.00 -3 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP 3.00 - -******************************************** -*** Expect slave to fail with Error 1054 *** -******************************************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1054 -Last_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1054 -Last_SQL_Error Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7' -STOP SLAVE; -RESET SLAVE; - -*** Drop t15 *** -DROP TABLE t15; -DROP TABLE t15; -RESET MASTER; -START SLAVE; - -************************************************ -* - Create index on Master column not on slave * -* Expect:Warning * -************************************************ - -*** Create t16 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t16 on Master *** -CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Create Index and Data Insert *** -CREATE INDEX part_of_c6 ON t16 (c6); -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t16 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -***************** -*** BUG 30434 *** -***************** - -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1072 -Last_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1072 -Last_SQL_Error Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)' -STOP SLAVE; -RESET SLAVE; - -*** Drop t16 *** -DROP TABLE t16; -DROP TABLE t16; -RESET MASTER; -START SLAVE; - -***************************************************** -* - Delete rows using column on Master not on slave * -* Expect: Rows Deleted * -***************************************************** - -*** Create t17 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t17 on Master *** -CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** Delete from master ** -DELETE FROM t17 WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -DROP TABLE t17; - - -***************************************************** -* - Update row using column on Master not on slave * -* Expect: Rows updated * -***************************************************** - -** Bug30674 ** - -*** Create t18 on slave *** - -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t18 on Master *** -CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 INT DEFAULT '1', -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -set @b1 = concat(@b1,@b1); -INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT), -(2,@b1,'JOE',2,DEFAULT), -(3,@b1,'QA',3,DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 QA - -** update from master ** -UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3; -SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 62316231623162316231623162316231 Kyle 1 CURRENT_TIMESTAMP -2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP -3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP - -** Check slave ** -SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1; -c1 hex(c4) c5 -1 62316231623162316231623162316231 Kyle -2 62316231623162316231623162316231 JOE -3 62316231623162316231623162316231 TEST -DROP TABLE t18; - - -***************************************************** -* - Insert UUID column on Master not on slave * -* Expect: Rows inserted * -***************************************************** - -*** Create t5 on slave *** -STOP SLAVE; -RESET SLAVE; -CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5) -) ENGINE='MyISAM'; - -*** Create t5 on Master *** -CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5), -c6 LONG, -c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP -)ENGINE='MyISAM'; -RESET MASTER; - -*** Start Slave *** -START SLAVE; - -*** Master Data Insert *** -set @b1 = 'b1b1b1b1'; -INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT), -(2,@b1,'JOE',UUID(),DEFAULT), -(3,@b1,'QA',UUID(),DEFAULT); -SELECT c1,hex(c4),c5,c6,c7 FROM t5 ORDER BY c1; -c1 hex(c4) c5 c6 c7 -1 6231623162316231 Kyle UUID TIME -2 6231623162316231 JOE UUID TIME -3 6231623162316231 QA UUID TIME - -** Select * from Slave ** -SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1; -c1 hex(c4) c5 -1 6231623162316231 Kyle -2 6231623162316231 JOE -3 6231623162316231 QA -DROP TABLE t5; - diff --git a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result index e7a912b75fa..960833b85d8 100644 --- a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result @@ -46,7 +46,6 @@ engine = INNODB; insert into t1 set b=1; insert into t2 set a=1, b=1; set foreign_key_checks=0; -set @@session.binlog_format=row; delete from t1; must sync w/o a problem (could not with the buggy code) select count(*) from t1 /* must be zero */; diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index 3341c03db0f..fb827fd347b 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -6,11 +6,12 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032"); call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); -SET @old_slave_exec_mode= @@global.slave_exec_mode; CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); +SET @old_slave_exec_mode= @@global.slave_exec_mode; +SET @@global.slave_exec_mode= IDEMPOTENT; DELETE FROM t1 WHERE a = -2; DELETE FROM t2 WHERE a = -2; DELETE FROM t1 WHERE a = -2; @@ -72,158 +73,4 @@ a Last_SQL_Error 0 DROP TABLE t1, t2; -select @@global.slave_exec_mode /* must be IDEMPOTENT */; -@@global.slave_exec_mode -IDEMPOTENT -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) -engine = innodb; -set foreign_key_checks=1 /* ensure the check */; -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; -select * from ti1 order by b /* must be (1),(2),(3) */; -b -1 -2 -3 -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; -a b -1 1 -2 2 -set @save_binlog_format= @@session.binlog_format; -set @@session.binlog_format= row; -delete from ti1 where b=1; -select * from ti1 order by b /* must be (2),(3) */; -b -2 -3 -select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; -b -1 -2 -3 -delete from ti1 where b=3; -insert into ti2 set a=3, b=3; -select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; -a b -1 1 -2 2 -set global slave_exec_mode='IDEMPOTENT'; -set global slave_exec_mode='STRICT'; -set global slave_exec_mode='IDEMPOTENT,STRICT'; -ERROR HY000: Ambiguous slave modes combination. -select @@global.slave_exec_mode /* must be STRICT */; -@@global.slave_exec_mode -STRICT -*** foreign keys errors as above now forces to stop -set foreign_key_checks=0; -drop table ti2, ti1; -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) -engine = innodb; -set foreign_key_checks=1 /* ensure the check */; -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; -select * from ti1 order by b /* must be (1),(2),(3) */; -b -1 -2 -3 -*** conspire future problem -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; -a b -1 1 -2 2 -delete from ti1 where b=1 /* offending delete event */; -select * from ti1 order by b /* must be (2),(3) */; -b -2 -3 -*** slave must stop (Trying to delete a referenced foreing key) -Last_SQL_Error -1451 -select * from ti1 order by b /* must be (1),(2),(3) - not deleted */; -b -1 -2 -3 -set foreign_key_checks= 0; -delete from ti2 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -*** conspire the following insert failure -*** conspire future problem -delete from ti1 where b=3; -insert into ti2 set a=3, b=3 /* offending write event */; -*** slave must stop (Trying to insert an invalid foreign key) -Last_SQL_Error -1452 -select * from ti2 order by b /* must be (2,2) */; -a b -2 2 -set foreign_key_checks= 0; -insert into ti1 set b=3; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -select * from ti2 order by b /* must be (2,2),(3,3) */; -a b -2 2 -3 3 -*** other errors -*** conspiring query -insert into ti1 set b=1; -insert into ti1 set b=1 /* offending write event */; -*** slave must stop (Trying to insert a dupliacte key) -Last_SQL_Error -1062 -set foreign_key_checks= 0; -delete from ti1 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -CREATE TABLE t1 (a INT PRIMARY KEY); -CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (-1),(-2),(-3); -INSERT INTO t2 VALUES (-1),(-2),(-3); -DELETE FROM t1 WHERE a = -2; -DELETE FROM t2 WHERE a = -2; -DELETE FROM t1 WHERE a = -2; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -DELETE FROM t2 WHERE a = -2; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -UPDATE t1 SET a = 1 WHERE a = -1; -UPDATE t2 SET a = 1 WHERE a = -1; -UPDATE t1 SET a = 1 WHERE a = -1; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -UPDATE t2 SET a = 1 WHERE a = -1; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; SET @@global.slave_exec_mode= @old_slave_exec_mode; -set @@session.binlog_format= @save_binlog_format; -drop table t1,t2,ti2,ti1; -*** end of tests diff --git a/mysql-test/suite/rpl/r/rpl_found_rows.result b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result similarity index 54% rename from mysql-test/suite/rpl/r/rpl_found_rows.result rename to mysql-test/suite/rpl/r/rpl_mix_found_rows.result index 45a931872cf..a3bc1934a70 100644 --- a/mysql-test/suite/rpl/r/rpl_found_rows.result +++ b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result @@ -4,8 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -==== 0. Setting it all up ==== -SET BINLOG_FORMAT=STATEMENT; +==== Initialize ==== **** On Master **** CREATE TABLE t1 (a INT); CREATE TABLE logtbl (sect INT, test INT, count INT); @@ -16,106 +15,12 @@ INSERT INTO t1 SELECT 2*a+3 FROM t1; INSERT INTO t1 SELECT 2*a+3 FROM t1; INSERT INTO t1 SELECT 2*a+3 FROM t1; INSERT INTO t1 SELECT 2*a+3 FROM t1; -#### 1. Using statement mode #### -==== 1.1. Simple test ==== -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; -a -7 -SELECT FOUND_ROWS() INTO @a; -INSERT INTO logtbl VALUES(1,1,@a); -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; -a -1 -SELECT FOUND_ROWS() INTO @a; -INSERT INTO logtbl VALUES(1,2,@a); -SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; -sect test count -1 1 183 -1 2 3 -**** On Slave **** -SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; -sect test count -1 1 183 -1 2 3 -==== 1.2. Stored procedure ==== +==== Checking a procedure ==== **** On Master **** -CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN -DECLARE cnt INT; -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; -SELECT FOUND_ROWS() INTO cnt; -INSERT INTO logtbl VALUES(sect,test,cnt); -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; -SELECT FOUND_ROWS() INTO cnt; -INSERT INTO logtbl VALUES(sect,test+1,cnt); -END $$ -CALL calc_and_log(2,1); -a -1 -a -7 -CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN -INSERT INTO logtbl VALUES (sect,test,found_rows); -END $$ -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; -a -7 -SELECT FOUND_ROWS() INTO @found_rows; -CALL just_log(2,3,@found_rows); -SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; -sect test count -2 1 3 -2 2 183 -2 3 183 -**** On Slave **** -SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; -sect test count -2 1 3 -2 2 183 -2 3 183 -==== 1.3. Stored functions ==== -**** On Master **** -CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT) -RETURNS INT -BEGIN -INSERT INTO logtbl VALUES(sect,test,found_rows); -RETURN found_rows; -END $$ -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; -a -7 -SELECT FOUND_ROWS() INTO @found_rows; -SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); -log_rows(3,1,@found_rows) log_rows(3,2,@found_rows) -183 183 -SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; -sect test count -3 1 183 -3 2 183 -**** On Slave **** -SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; -sect test count -3 1 183 -3 2 183 -==== 1.9. Cleanup ==== -**** On Master **** -DELETE FROM logtbl; -DROP PROCEDURE just_log; -DROP PROCEDURE calc_and_log; -DROP FUNCTION log_rows; -**** Resetting master and slave **** -include/stop_slave.inc -RESET SLAVE; -RESET MASTER; -include/start_slave.inc -#### 2. Using mixed mode #### -==== 2.1. Checking a procedure ==== -**** On Master **** -SET BINLOG_FORMAT=MIXED; CREATE PROCEDURE just_log(sect INT, test INT) BEGIN INSERT INTO logtbl VALUES (sect,test,FOUND_ROWS()); END $$ **** On Master 1 **** -SET BINLOG_FORMAT=MIXED; SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; a 7 @@ -148,7 +53,7 @@ sect test count 1 2 183 1 3 3 1 4 183 -==== 2.1. Checking a stored function ==== +==== Checking a stored function ==== **** On Master **** CREATE FUNCTION log_rows(sect INT, test INT) RETURNS INT diff --git a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result new file mode 100644 index 00000000000..fb48172ed93 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result @@ -0,0 +1,71 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE SCHEMA IF NOT EXISTS mysqlslap; +USE mysqlslap; +select @@global.binlog_format; +@@global.binlog_format +MIXED +CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)); +FLUSH TABLE t1; +SELECT COUNT(*) FROM t1; +COUNT(*) +5000 +use mysqlslap; +SELECT COUNT(*) FROM t1; +COUNT(*) +5000 +truncate table t1; +insert delayed into t1 values(10, "my name"); +insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); +flush table t1; +select * from t1; +id name +10 my name +20 James Bond +select * from t1; +id name +10 my name +20 James Bond +delete from t1 where id!=10; +insert delayed into t1 values(20, "is Bond"), (10, "James Bond"); +flush table t1; +select * from t1; +id name +10 my name +20 is Bond +select * from t1; +id name +10 my name +20 is Bond +USE test; +DROP SCHEMA mysqlslap; +use test; +FLUSH LOGS; +FLUSH LOGS; +CREATE TABLE t1(a int, UNIQUE(a)); +INSERT DELAYED IGNORE INTO t1 VALUES(1); +INSERT DELAYED IGNORE INTO t1 VALUES(1); +flush table t1; +show binlog events in 'master-bin.000002' LIMIT 2,2; +Log_name Pos Event_type Server_id End_log_pos Info +x x x x x BEGIN +x x x x x table_id: # (test.t1) +select * from t1; +a +1 +On slave +show binlog events in 'slave-bin.000002' LIMIT 2,2; +Log_name Pos Event_type Server_id End_log_pos Info +x x x x x BEGIN +x x x x x table_id: # (test.t1) +select * from t1; +a +1 +drop table t1; +FLUSH LOGS; +FLUSH LOGS; +End of 5.0 tests diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result index 2e707fb62c1..75d50ed756c 100644 --- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result +++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result @@ -4,12 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -SET @old_binlog_format= @@global.binlog_format; -SET BINLOG_FORMAT=MIXED; -SET GLOBAL BINLOG_FORMAT=MIXED; -SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; -@@GLOBAL.BINLOG_FORMAT @@SESSION.BINLOG_FORMAT -MIXED MIXED **** On Master **** CREATE TABLE t1 (a INT, b LONG); INSERT INTO t1 VALUES (1,1), (2,2); @@ -73,4 +67,3 @@ slave-bin.000001 # Table_map 1 # table_id: # (test.t1) slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F slave-bin.000001 # Query 1 # COMMIT DROP TABLE IF EXISTS t1; -SET @@global.binlog_format= @old_binlog_format; diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result new file mode 100644 index 00000000000..c2d1f3ffdd3 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result @@ -0,0 +1,160 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set @old_slave_exec_mode= @@global.slave_exec_mode; +set @@global.slave_exec_mode= IDEMPOTENT; +create table ti1 (b int primary key) engine = innodb; +create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) +engine = innodb; +set foreign_key_checks=1 /* ensure the check */; +insert into ti1 values (1),(2),(3); +insert into ti2 set a=2, b=2; +select * from ti1 order by b /* must be (1),(2),(3) */; +b +1 +2 +3 +insert into ti2 set a=1, b=1; +select * from ti2 order by b /* must be (1,1) (2,2) */; +a b +1 1 +2 2 +set @save_binlog_format= @@session.binlog_format; +set @@session.binlog_format= row; +delete from ti1 where b=1; +select * from ti1 order by b /* must be (2),(3) */; +b +2 +3 +select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; +b +1 +2 +3 +delete from ti1 where b=3; +insert into ti2 set a=3, b=3; +select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; +a b +1 1 +2 2 +set global slave_exec_mode='IDEMPOTENT'; +set global slave_exec_mode='STRICT'; +set global slave_exec_mode='IDEMPOTENT,STRICT'; +ERROR HY000: Ambiguous slave modes combination. +select @@global.slave_exec_mode /* must be STRICT */; +@@global.slave_exec_mode +STRICT +*** foreign keys errors as above now forces to stop +set foreign_key_checks=0; +drop table ti2, ti1; +create table ti1 (b int primary key) engine = innodb; +create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) +engine = innodb; +set foreign_key_checks=1 /* ensure the check */; +insert into ti1 values (1),(2),(3); +insert into ti2 set a=2, b=2; +select * from ti1 order by b /* must be (1),(2),(3) */; +b +1 +2 +3 +*** conspire future problem +insert into ti2 set a=1, b=1; +select * from ti2 order by b /* must be (1,1) (2,2) */; +a b +1 1 +2 2 +delete from ti1 where b=1 /* offending delete event */; +select * from ti1 order by b /* must be (2),(3) */; +b +2 +3 +*** slave must stop (Trying to delete a referenced foreing key) +Last_SQL_Error +1451 +select * from ti1 order by b /* must be (1),(2),(3) - not deleted */; +b +1 +2 +3 +set foreign_key_checks= 0; +delete from ti2 where b=1; +set foreign_key_checks= 1; +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +set global slave_exec_mode='STRICT'; +*** conspire the following insert failure +*** conspire future problem +delete from ti1 where b=3; +insert into ti2 set a=3, b=3 /* offending write event */; +*** slave must stop (Trying to insert an invalid foreign key) +Last_SQL_Error +1452 +select * from ti2 order by b /* must be (2,2) */; +a b +2 2 +set foreign_key_checks= 0; +insert into ti1 set b=3; +set foreign_key_checks= 1; +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +set global slave_exec_mode='STRICT'; +select * from ti2 order by b /* must be (2,2),(3,3) */; +a b +2 2 +3 3 +*** other errors +*** conspiring query +insert into ti1 set b=1; +insert into ti1 set b=1 /* offending write event */; +*** slave must stop (Trying to insert a dupliacte key) +Last_SQL_Error +1062 +set foreign_key_checks= 0; +delete from ti1 where b=1; +set foreign_key_checks= 1; +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +set global slave_exec_mode='STRICT'; +CREATE TABLE t1 (a INT PRIMARY KEY); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (-1),(-2),(-3); +INSERT INTO t2 VALUES (-1),(-2),(-3); +DELETE FROM t1 WHERE a = -2; +DELETE FROM t2 WHERE a = -2; +DELETE FROM t1 WHERE a = -2; +*** slave must stop (Key was not found) +Last_SQL_Error +1032 +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +set global slave_exec_mode='STRICT'; +DELETE FROM t2 WHERE a = -2; +*** slave must stop (Key was not found) +Last_SQL_Error +1032 +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +set global slave_exec_mode='STRICT'; +UPDATE t1 SET a = 1 WHERE a = -1; +UPDATE t2 SET a = 1 WHERE a = -1; +UPDATE t1 SET a = 1 WHERE a = -1; +*** slave must stop (Key was not found) +Last_SQL_Error +1032 +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +set global slave_exec_mode='STRICT'; +UPDATE t2 SET a = 1 WHERE a = -1; +*** slave must stop (Key was not found) +Last_SQL_Error +1032 +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +SET @@global.slave_exec_mode= @old_slave_exec_mode; +drop table t1,t2,ti2,ti1; +set @@global.slave_exec_mode= @old_slave_exec_mode; +*** end of tests diff --git a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result index 1551d83266d..c9cb2268da7 100644 --- a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result @@ -4,8 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -set @old_global_binlog_format = @@global.binlog_format; -set @@global.binlog_format = row; CREATE SCHEMA IF NOT EXISTS mysqlslap; USE mysqlslap; select @@global.binlog_format; @@ -59,4 +57,3 @@ a 1 drop table t1; End of 5.0 tests -set @@global.binlog_format = @old_global_binlog_format; diff --git a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result new file mode 100644 index 00000000000..5252562acef --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result @@ -0,0 +1,110 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +==== Initialize ==== +**** On Master **** +CREATE TABLE t1 (a INT); +CREATE TABLE logtbl (sect INT, test INT, count INT); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +==== Simple test ==== +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,1,@a); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +a +1 +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,2,@a); +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +sect test count +1 1 183 +1 2 3 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +sect test count +1 1 183 +1 2 3 +==== Stored procedure ==== +**** On Master **** +CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN +DECLARE cnt INT; +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO cnt; +INSERT INTO logtbl VALUES(sect,test,cnt); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO cnt; +INSERT INTO logtbl VALUES(sect,test+1,cnt); +END $$ +CALL calc_and_log(2,1); +a +1 +a +7 +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO logtbl VALUES( NAME_CONST('sect',2), NAME_CONST('test',1), NAME_CONST('cnt',3)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO logtbl VALUES( NAME_CONST('sect',2), NAME_CONST('test',1)+1, NAME_CONST('cnt',183)) +CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN +INSERT INTO logtbl VALUES (sect,test,found_rows); +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +SELECT FOUND_ROWS() INTO @found_rows; +CALL just_log(2,3,@found_rows); +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sect test count +2 1 3 +2 2 183 +2 3 183 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +sect test count +2 1 3 +2 2 183 +2 3 183 +==== Stored functions ==== +**** On Master **** +CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT) +RETURNS INT +BEGIN +INSERT INTO logtbl VALUES(sect,test,found_rows); +RETURN found_rows; +END $$ +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +a +7 +SELECT FOUND_ROWS() INTO @found_rows; +SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); +log_rows(3,1,@found_rows) log_rows(3,2,@found_rows) +183 183 +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; +sect test count +3 1 183 +3 2 183 +**** On Slave **** +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; +sect test count +3 1 183 +3 2 183 +==== Cleanup ==== +**** On Master **** +DROP TABLE t1, logtbl; +DROP PROCEDURE just_log; +DROP PROCEDURE calc_and_log; +DROP FUNCTION log_rows; +**** Resetting master and slave **** +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/start_slave.inc diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result index 5ca0ea2b780..3ed132dad61 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result @@ -4,8 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -set @old_global_binlog_format = @@global.binlog_format; -set @@global.binlog_format = statement; CREATE SCHEMA IF NOT EXISTS mysqlslap; USE mysqlslap; select @@global.binlog_format; @@ -71,70 +69,3 @@ drop table t1; FLUSH LOGS; FLUSH LOGS; End of 5.0 tests -set @@global.binlog_format = mixed; -CREATE SCHEMA IF NOT EXISTS mysqlslap; -USE mysqlslap; -select @@global.binlog_format; -@@global.binlog_format -MIXED -CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)); -FLUSH TABLE t1; -SELECT COUNT(*) FROM t1; -COUNT(*) -5000 -use mysqlslap; -SELECT COUNT(*) FROM t1; -COUNT(*) -5000 -truncate table t1; -insert delayed into t1 values(10, "my name"); -insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); -flush table t1; -select * from t1; -id name -10 my name -20 James Bond -select * from t1; -id name -10 my name -20 James Bond -delete from t1 where id!=10; -insert delayed into t1 values(20, "is Bond"), (10, "James Bond"); -flush table t1; -select * from t1; -id name -10 my name -20 is Bond -select * from t1; -id name -10 my name -20 is Bond -USE test; -DROP SCHEMA mysqlslap; -use test; -FLUSH LOGS; -FLUSH LOGS; -CREATE TABLE t1(a int, UNIQUE(a)); -INSERT DELAYED IGNORE INTO t1 VALUES(1); -INSERT DELAYED IGNORE INTO t1 VALUES(1); -flush table t1; -show binlog events in 'master-bin.000002' LIMIT 2,2; -Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -select * from t1; -a -1 -On slave -show binlog events in 'slave-bin.000002' LIMIT 2,2; -Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) -select * from t1; -a -1 -drop table t1; -FLUSH LOGS; -FLUSH LOGS; -End of 5.0 tests -set @@global.binlog_format = @old_global_binlog_format; diff --git a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result index ca76695f4d4..a2fc22d9951 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result @@ -10,7 +10,7 @@ CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a)); INSERT INTO test.t1 VALUES(1,'test'); UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1 create procedure test.p1() begin INSERT INTO test.t1 VALUES(2,'test'); @@ -18,7 +18,8 @@ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2; end| CALL test.p1(); Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO test.t1 VALUES(2,'test') +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2 SELECT * FROM test.t1 ORDER BY blob_column; a blob_column 1 abase diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result index d14380a6369..8f4868ea125 100644 --- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result +++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result @@ -6,7 +6,6 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; call mtr.add_suppression("Deadlock found"); **** On Master **** -SET SESSION BINLOG_FORMAT=ROW; CREATE TABLE t1 (a INT PRIMARY KEY, b INT); INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); **** On Slave **** diff --git a/mysql-test/suite/rpl/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result index ccf16271d01..92ffb9cffc7 100644 --- a/mysql-test/suite/rpl/r/rpl_udf.result +++ b/mysql-test/suite/rpl/r/rpl_udf.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -set binlog_format=row; drop table if exists t1; "*** Test 1) Test UDFs via loadable libraries *** "Running on the master" @@ -156,163 +155,3 @@ affected rows: 0 "Running on the master" DROP TABLE t1; affected rows: 0 -set binlog_format=statement; -drop table if exists t1; -"*** Test 1) Test UDFs via loadable libraries *** -"Running on the master" -CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB"; -affected rows: 0 -CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; -affected rows: 0 -CREATE FUNCTION myfunc_nonexist RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; -ERROR HY000: Can't find symbol 'myfunc_nonexist' in library -SELECT * FROM mysql.func ORDER BY name; -name ret dl type -myfunc_double 1 UDF_LIB function -myfunc_int 2 UDF_LIB function -affected rows: 2 -"Running on the slave" -SELECT * FROM mysql.func ORDER BY name; -name ret dl type -myfunc_double 1 UDF_LIB function -myfunc_int 2 UDF_LIB function -affected rows: 2 -"Running on the master" -CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; -affected rows: 0 -INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00)); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -affected rows: 1 -INSERT INTO t1 VALUES(myfunc_int(10), myfunc_double(5.00)); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -affected rows: 1 -INSERT INTO t1 VALUES(myfunc_int(200), myfunc_double(25.00)); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -affected rows: 1 -INSERT INTO t1 VALUES(myfunc_int(1), myfunc_double(500.00)); -Warnings: -Note 1592 Statement may not be safe to log in statement format. -affected rows: 1 -SELECT * FROM t1 ORDER BY sum; -sum price -1 48.5 -10 48.75 -100 48.6 -200 49 -affected rows: 4 -"Running on the slave" -SELECT * FROM t1 ORDER BY sum; -sum price -1 48.5 -10 48.75 -100 48.6 -200 49 -affected rows: 4 -SELECT myfunc_int(25); -myfunc_int(25) -25 -affected rows: 1 -SELECT myfunc_double(75.00); -myfunc_double(75.00) -50.00 -affected rows: 1 -"Running on the master" -DROP FUNCTION myfunc_double; -affected rows: 0 -DROP FUNCTION myfunc_int; -affected rows: 0 -SELECT * FROM mysql.func ORDER BY name; -name ret dl type -affected rows: 0 -"Running on the slave" -SELECT * FROM mysql.func ORDER BY name; -name ret dl type -affected rows: 0 -"Running on the master" -DROP TABLE t1; -affected rows: 0 -"*** Test 2) Test UDFs with SQL body *** -"Running on the master" -CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i; -affected rows: 0 -CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00; -affected rows: 0 -SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name; -db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 -test myfuncsql_int FUNCTION i INT RETURN i -affected rows: 2 -"Running on the slave" -SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name; -db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 -test myfuncsql_int FUNCTION i INT RETURN i -affected rows: 2 -"Running on the master" -CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM; -affected rows: 0 -INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00)); -affected rows: 1 -INSERT INTO t1 VALUES(myfuncsql_int(10), myfuncsql_double(5.00)); -affected rows: 1 -INSERT INTO t1 VALUES(myfuncsql_int(200), myfuncsql_double(25.00)); -affected rows: 1 -INSERT INTO t1 VALUES(myfuncsql_int(1), myfuncsql_double(500.00)); -affected rows: 1 -SELECT * FROM t1 ORDER BY sum; -sum price -1 1000 -10 10 -100 100 -200 50 -affected rows: 4 -"Running on the slave" -SELECT * FROM t1 ORDER BY sum; -sum price -1 1000 -10 10 -100 100 -200 50 -affected rows: 4 -"Running on the master" -ALTER FUNCTION myfuncsql_int COMMENT "This was altered."; -affected rows: 0 -ALTER FUNCTION myfuncsql_double COMMENT "This was altered."; -affected rows: 0 -SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name; -db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered. -test myfuncsql_int FUNCTION i INT RETURN i This was altered. -affected rows: 2 -"Running on the slave" -SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name; -db name type param_list body comment -test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered. -test myfuncsql_int FUNCTION i INT RETURN i This was altered. -affected rows: 2 -SELECT myfuncsql_int(25); -myfuncsql_int(25) -25 -affected rows: 1 -SELECT myfuncsql_double(75.00); -myfuncsql_double(75.00) -150 -affected rows: 1 -"Running on the master" -DROP FUNCTION myfuncsql_double; -affected rows: 0 -DROP FUNCTION myfuncsql_int; -affected rows: 0 -SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name; -db name type param_list body comment -affected rows: 0 -"Running on the slave" -SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name; -db name type param_list body comment -affected rows: 0 -"Running on the master" -DROP TABLE t1; -affected rows: 0 diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test index 9176bafe022..8675f68c687 100644 --- a/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -1,3 +1,4 @@ +source include/have_binlog_format_mixed_or_row.inc; source include/master-slave.inc; CREATE DATABASE track; diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test index d06a3118389..19f07a7cbe7 100644 --- a/mysql-test/suite/rpl/t/rpl_events.test +++ b/mysql-test/suite/rpl/t/rpl_events.test @@ -1,11 +1,9 @@ ################################################################## # Author: Giuseppe # # Date: 2006-12-20 # -# Purpose: To test that event effects are replicated # -# in both row based and statement based format # +# Purpose: To test that event effects are replicated. # ################################################################## ---source include/not_embedded.inc --source include/master-slave.inc SET @old_event_scheduler = @@global.event_scheduler; @@ -13,14 +11,6 @@ set global event_scheduler=1; let $engine_type= MyISAM; -set binlog_format=row; - -# Embedded server doesn't support binlogging ---source include/rpl_events.inc - -set binlog_format=statement; - -# Embedded server doesn't support binlogging --source include/rpl_events.inc # diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test index 5255a9cfbad..29758366577 100644 --- a/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test +++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_innodb.test @@ -1,16 +1,9 @@ ############################################################# # Purpose: To test having extra columns on the master WL#3915 ############################################################# +-- source include/have_binlog_format_row.inc -- source include/master-slave.inc -- source include/have_innodb.inc let $engine_type = 'InnoDB'; - -set binlog_format=row; --- source extra/rpl_tests/rpl_extraMaster_Col.test - -set binlog_format=statement; --- source extra/rpl_tests/rpl_extraMaster_Col.test - -set binlog_format=mixed; --- source extra/rpl_tests/rpl_extraMaster_Col.test +--source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test index e6b41eabd0d..31529a19cfc 100644 --- a/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test +++ b/mysql-test/suite/rpl/t/rpl_extraColmaster_myisam.test @@ -1,15 +1,8 @@ ############################################################# # Purpose: To test having extra columns on the master WL#3915 ############################################################# +-- source include/have_binlog_format_row.inc -- source include/master-slave.inc let $engine_type = 'MyISAM'; - -set binlog_format=row; --- source extra/rpl_tests/rpl_extraMaster_Col.test - -set binlog_format=statement; --- source extra/rpl_tests/rpl_extraMaster_Col.test - -set binlog_format=mixed; --- source extra/rpl_tests/rpl_extraMaster_Col.test +--source extra/rpl_tests/rpl_extraMaster_Col.test diff --git a/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt b/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt deleted file mode 100644 index 03fc19ca6ae..00000000000 --- a/mysql-test/suite/rpl/t/rpl_idempotency-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---slave-exec-mode=IDEMPOTENT diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index bfd1860759e..a837d366f71 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -2,17 +2,11 @@ # work the same way under statement based as under row based. source include/master-slave.inc; -connection master; -source include/have_innodb.inc; -connection slave; -source include/have_innodb.inc; # Add suppression for expected warning(s) in slaves error log call mtr.add_suppression("Slave: Can\'t find record in \'t1\' Error_code: 1032"); call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); -SET @old_slave_exec_mode= @@global.slave_exec_mode; - connection master; CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t2 (a INT); @@ -20,6 +14,9 @@ INSERT INTO t1 VALUES (-1),(-2),(-3); INSERT INTO t2 VALUES (-1),(-2),(-3); sync_slave_with_master; +SET @old_slave_exec_mode= @@global.slave_exec_mode; +SET @@global.slave_exec_mode= IDEMPOTENT; + # A delete for a row that does not exist, the statement is # deliberately written to be idempotent for statement-based # replication as well. We test this towards both a table with a @@ -57,6 +54,7 @@ disable_query_log; eval SELECT "$last_error" AS Last_SQL_Error; enable_query_log; + # BUG#19958: RBR idempotency issue for UPDATE and DELETE # Statement-based and row-based replication have different behaviour @@ -88,316 +86,4 @@ connection master; DROP TABLE t1, t2; sync_slave_with_master; -# bug#31609 Not all RBR slave errors reported as errors -# bug#31552 Replication breaks when deleting rows from out-of-sync table -# without PK - -# -# Idempotent applying is not default any longer. -# The default for slave-exec-mode option and server -# variable slave_exec_mode is 'STRICT'. -# When 'STRICT' mode is set, the slave SQL thread will stop whenever -# the row to change is not found. In 'IDEMPOTENT' mode, the SQL thread -# will continue running and apply the row - replace if it's Write_rows event - -# or skip to the next event. - -# the previous part of the tests was with IDEMPOTENT slave's mode. - - -# -# Other than above idempotent errors dealing with foreign keys constraint -# - -select @@global.slave_exec_mode /* must be IDEMPOTENT */; - -connection master; - -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) - engine = innodb; -set foreign_key_checks=1 /* ensure the check */; - -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; - -sync_slave_with_master; - -#connection slave; -select * from ti1 order by b /* must be (1),(2),(3) */; -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; - -connection master; - -# from now on checking rbr specific idempotent errors -set @save_binlog_format= @@session.binlog_format; -set @@session.binlog_format= row; -delete from ti1 where b=1; - -select * from ti1 order by b /* must be (2),(3) */; - -# slave must catch up (expect some warnings in error.log) -sync_slave_with_master; - -#connection slave; -select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; - -delete from ti1 where b=3; - -connection master; -insert into ti2 set a=3, b=3; - -# slave must catch up (expect some warnings in error.log) -sync_slave_with_master; - -#connection slave; -select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; - - -# -# Checking the new global sys variable -# - -connection slave; - -set global slave_exec_mode='IDEMPOTENT'; -set global slave_exec_mode='STRICT'; - -# checking mutual exclusion for the options ---error ER_SLAVE_AMBIGOUS_EXEC_MODE -set global slave_exec_mode='IDEMPOTENT,STRICT'; - -select @@global.slave_exec_mode /* must be STRICT */; - -# -# Checking stops. -# In the following sections strict slave sql thread is going to -# stop when faces an idempotent error. In order to proceed -# the mode is temporarily switched to indempotent. -# - -# ---echo *** foreign keys errors as above now forces to stop -# - -connection master; - -set foreign_key_checks=0; -drop table ti2, ti1; - -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) - engine = innodb; -set foreign_key_checks=1 /* ensure the check */; - -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; - -sync_slave_with_master; - -#connection slave; -select * from ti1 order by b /* must be (1),(2),(3) */; ---echo *** conspire future problem -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; - -connection master; - -delete from ti1 where b=1 /* offending delete event */; -select * from ti1 order by b /* must be (2),(3) */; - -# foreign key: row is referenced - ---echo *** slave must stop (Trying to delete a referenced foreing key) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -select * from ti1 order by b /* must be (1),(2),(3) - not deleted */; -set foreign_key_checks= 0; -delete from ti2 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -connection master; - -sync_slave_with_master; - -#connection slave; ---echo *** conspire the following insert failure -# foreign key: no referenced row - ---echo *** conspire future problem -delete from ti1 where b=3; - -connection master; -insert into ti2 set a=3, b=3 /* offending write event */; - ---echo *** slave must stop (Trying to insert an invalid foreign key) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -select * from ti2 order by b /* must be (2,2) */; -set foreign_key_checks= 0; -insert into ti1 set b=3; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -connection master; - -sync_slave_with_master; - -select * from ti2 order by b /* must be (2,2),(3,3) */; - -# ---echo *** other errors -# - -# dup key insert - -#connection slave; ---echo *** conspiring query -insert into ti1 set b=1; - -connection master; -insert into ti1 set b=1 /* offending write event */; - ---echo *** slave must stop (Trying to insert a dupliacte key) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set foreign_key_checks= 0; -delete from ti1 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -# key not found - -connection master; - -CREATE TABLE t1 (a INT PRIMARY KEY); -CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (-1),(-2),(-3); -INSERT INTO t2 VALUES (-1),(-2),(-3); -sync_slave_with_master; - -#connection slave; -DELETE FROM t1 WHERE a = -2; -DELETE FROM t2 WHERE a = -2; -connection master; -DELETE FROM t1 WHERE a = -2; - ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -connection master; -DELETE FROM t2 WHERE a = -2; ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -UPDATE t1 SET a = 1 WHERE a = -1; -UPDATE t2 SET a = 1 WHERE a = -1; - -connection master; -UPDATE t1 SET a = 1 WHERE a = -1; - ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - - -connection master; -UPDATE t2 SET a = 1 WHERE a = -1; - ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; SET @@global.slave_exec_mode= @old_slave_exec_mode; - -# cleanup for bug#31609 tests - -connection master; -set @@session.binlog_format= @save_binlog_format; -drop table t1,t2,ti2,ti1; - ---source include/master-slave-end.inc - ---echo *** end of tests diff --git a/mysql-test/suite/rpl/t/rpl_found_rows.test b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test similarity index 52% rename from mysql-test/suite/rpl/t/rpl_found_rows.test rename to mysql-test/suite/rpl/t/rpl_mix_found_rows.test index ff8d2c3107a..30342126d24 100644 --- a/mysql-test/suite/rpl/t/rpl_found_rows.test +++ b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test @@ -1,16 +1,7 @@ source include/master-slave.inc; +source include/have_binlog_format_mixed.inc; -# It is not possible to replicate FOUND_ROWS() using statement-based -# replication, but there is a workaround that stores the result of -# FOUND_ROWS() into a user variable and then replicates this instead. - -# The purpose of this test case is to test that the workaround -# function properly even when inside stored programs (i.e., stored -# routines and triggers). - ---echo ==== 0. Setting it all up ==== - -SET BINLOG_FORMAT=STATEMENT; +--echo ==== Initialize ==== --echo **** On Master **** connection master; @@ -25,106 +16,10 @@ INSERT INTO t1 SELECT 2*a+3 FROM t1; INSERT INTO t1 SELECT 2*a+3 FROM t1; INSERT INTO t1 SELECT 2*a+3 FROM t1; ---echo #### 1. Using statement mode #### - ---echo ==== 1.1. Simple test ==== - -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; - -# Instead of -# INSERT INTO logtbl VALUES(1, 1, FOUND_ROWS()); -# we write -SELECT FOUND_ROWS() INTO @a; -INSERT INTO logtbl VALUES(1,1,@a); - -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; -# Instead of -# INSERT INTO logtbl VALUES(1, 2, FOUND_ROWS()); -# we write -SELECT FOUND_ROWS() INTO @a; -INSERT INTO logtbl VALUES(1,2,@a); - -SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; ---echo **** On Slave **** -sync_slave_with_master; -SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; - ---echo ==== 1.2. Stored procedure ==== - -# Here we do both the calculation and the logging. We also do it twice -# to make sure that there are no limitations on how many times it can -# be used. +--echo ==== Checking a procedure ==== --echo **** On Master **** connection master; ---delimiter $$ -CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN - DECLARE cnt INT; - SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; - SELECT FOUND_ROWS() INTO cnt; - INSERT INTO logtbl VALUES(sect,test,cnt); - SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; - SELECT FOUND_ROWS() INTO cnt; - INSERT INTO logtbl VALUES(sect,test+1,cnt); -END $$ ---delimiter ; - -CALL calc_and_log(2,1); - ---delimiter $$ -CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN - INSERT INTO logtbl VALUES (sect,test,found_rows); -END $$ ---delimiter ; - -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; -SELECT FOUND_ROWS() INTO @found_rows; -CALL just_log(2,3,@found_rows); - -SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; ---echo **** On Slave **** -sync_slave_with_master; -SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; - ---echo ==== 1.3. Stored functions ==== ---echo **** On Master **** -connection master; ---delimiter $$ -CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT) - RETURNS INT -BEGIN - INSERT INTO logtbl VALUES(sect,test,found_rows); - RETURN found_rows; -END $$ ---delimiter ; - -SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; -SELECT FOUND_ROWS() INTO @found_rows; -SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); - -SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; ---echo **** On Slave **** -sync_slave_with_master; -SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; - ---echo ==== 1.9. Cleanup ==== ---echo **** On Master **** -connection master; -DELETE FROM logtbl; -DROP PROCEDURE just_log; -DROP PROCEDURE calc_and_log; -DROP FUNCTION log_rows; -sync_slave_with_master; - -source include/reset_master_and_slave.inc; - ---echo #### 2. Using mixed mode #### - ---echo ==== 2.1. Checking a procedure ==== - ---echo **** On Master **** -connection master; -SET BINLOG_FORMAT=MIXED; # We will now check some stuff that will not work in statement-based # replication, but which should cause the binary log to switch to @@ -139,7 +34,6 @@ sync_slave_with_master; --echo **** On Master 1 **** connection master1; -SET BINLOG_FORMAT=MIXED; SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; CALL just_log(1,1); @@ -167,7 +61,7 @@ SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; sync_slave_with_master; SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; ---echo ==== 2.1. Checking a stored function ==== +--echo ==== Checking a stored function ==== --echo **** On Master **** connection master; --delimiter $$ diff --git a/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test new file mode 100644 index 00000000000..2c44829a649 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mix_insert_delayed.test @@ -0,0 +1,5 @@ +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc +--source include/not_embedded.inc +--source include/not_windows.inc +--source extra/rpl_tests/rpl_insert_delayed.test diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test index 8863c9d4ac7..1c489894c0f 100644 --- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test +++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test @@ -1,15 +1,9 @@ --- source include/have_binlog_format_mixed_or_statement.inc +-- source include/have_binlog_format_mixed.inc -- source include/not_ndb_default.inc -- source include/master-slave.inc -# Test that the slave temporarily switches to ROW when seeing binrow -# events when it is in STATEMENT or MIXED mode - -SET @old_binlog_format= @@global.binlog_format; - -SET BINLOG_FORMAT=MIXED; -SET GLOBAL BINLOG_FORMAT=MIXED; -SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT; +# Test that the slave temporarily switches to ROW when seeing row +# events when it is in MIXED mode --echo **** On Master **** CREATE TABLE t1 (a INT, b LONG); @@ -35,7 +29,6 @@ SHOW BINLOG EVENTS; connection master; DROP TABLE IF EXISTS t1; -SET @@global.binlog_format= @old_binlog_format; # Let's compare. Note: If they match test will pass, if they do not match # the test will show that the diff statement failed and not reject file diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test new file mode 100644 index 00000000000..35e74b80e92 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test @@ -0,0 +1,325 @@ +# Testing various forms of idempotency for replication. This file is +# for tests that should only be executed in row mode. + +source include/have_binlog_format_row.inc; +source include/master-slave.inc; +connection master; +source include/have_innodb.inc; +connection slave; +source include/have_innodb.inc; + +# bug#31609 Not all RBR slave errors reported as errors +# bug#31552 Replication breaks when deleting rows from out-of-sync table +# without PK + +# The default for slave-exec-mode option and server +# variable slave_exec_mode is 'STRICT'. +# When 'STRICT' mode is set, the slave SQL thread will stop whenever +# the row to change is not found. In 'IDEMPOTENT' mode, the SQL thread +# will continue running and apply the row - replace if it's Write_rows event - +# or skip to the next event. + +# the previous part of the tests was with IDEMPOTENT slave's mode. + + +# +# Other than above idempotent errors dealing with foreign keys constraint +# +connection slave; + +set @old_slave_exec_mode= @@global.slave_exec_mode; +set @@global.slave_exec_mode= IDEMPOTENT; + +connection master; + +create table ti1 (b int primary key) engine = innodb; +create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) + engine = innodb; +set foreign_key_checks=1 /* ensure the check */; + +insert into ti1 values (1),(2),(3); +insert into ti2 set a=2, b=2; + +sync_slave_with_master; + +#connection slave; +select * from ti1 order by b /* must be (1),(2),(3) */; +insert into ti2 set a=1, b=1; +select * from ti2 order by b /* must be (1,1) (2,2) */; + +connection master; + +# from now on checking rbr specific idempotent errors +set @save_binlog_format= @@session.binlog_format; +set @@session.binlog_format= row; +delete from ti1 where b=1; + +select * from ti1 order by b /* must be (2),(3) */; + +# slave must catch up (expect some warnings in error.log) +sync_slave_with_master; + +#connection slave; +select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; + +delete from ti1 where b=3; + +connection master; +insert into ti2 set a=3, b=3; + +# slave must catch up (expect some warnings in error.log) +sync_slave_with_master; + +#connection slave; +select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; + + +# +# Checking the new global sys variable +# + +connection slave; + +set global slave_exec_mode='IDEMPOTENT'; +set global slave_exec_mode='STRICT'; + +# checking mutual exclusion for the options +--error ER_SLAVE_AMBIGOUS_EXEC_MODE +set global slave_exec_mode='IDEMPOTENT,STRICT'; + +select @@global.slave_exec_mode /* must be STRICT */; + +# +# Checking stops. +# In the following sections strict slave sql thread is going to +# stop when faces an idempotent error. In order to proceed +# the mode is temporarily switched to indempotent. +# + +# +--echo *** foreign keys errors as above now forces to stop +# + +connection master; + +set foreign_key_checks=0; +drop table ti2, ti1; + +create table ti1 (b int primary key) engine = innodb; +create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) + engine = innodb; +set foreign_key_checks=1 /* ensure the check */; + +insert into ti1 values (1),(2),(3); +insert into ti2 set a=2, b=2; + +sync_slave_with_master; + +#connection slave; +select * from ti1 order by b /* must be (1),(2),(3) */; +--echo *** conspire future problem +insert into ti2 set a=1, b=1; +select * from ti2 order by b /* must be (1,1) (2,2) */; + +connection master; + +delete from ti1 where b=1 /* offending delete event */; +select * from ti1 order by b /* must be (2),(3) */; + +# foreign key: row is referenced + +--echo *** slave must stop (Trying to delete a referenced foreing key) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +select * from ti1 order by b /* must be (1),(2),(3) - not deleted */; +set foreign_key_checks= 0; +delete from ti2 where b=1; +set foreign_key_checks= 1; +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +set global slave_exec_mode='STRICT'; + +connection master; + +sync_slave_with_master; + +#connection slave; +--echo *** conspire the following insert failure +# foreign key: no referenced row + +--echo *** conspire future problem +delete from ti1 where b=3; + +connection master; +insert into ti2 set a=3, b=3 /* offending write event */; + +--echo *** slave must stop (Trying to insert an invalid foreign key) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +select * from ti2 order by b /* must be (2,2) */; +set foreign_key_checks= 0; +insert into ti1 set b=3; +set foreign_key_checks= 1; +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +set global slave_exec_mode='STRICT'; + +connection master; + +sync_slave_with_master; + +select * from ti2 order by b /* must be (2,2),(3,3) */; + +# +--echo *** other errors +# + +# dup key insert + +#connection slave; +--echo *** conspiring query +insert into ti1 set b=1; + +connection master; +insert into ti1 set b=1 /* offending write event */; + +--echo *** slave must stop (Trying to insert a dupliacte key) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +set foreign_key_checks= 0; +delete from ti1 where b=1; +set foreign_key_checks= 1; +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +set global slave_exec_mode='STRICT'; + +# key not found + +connection master; + +CREATE TABLE t1 (a INT PRIMARY KEY); +CREATE TABLE t2 (a INT); +INSERT INTO t1 VALUES (-1),(-2),(-3); +INSERT INTO t2 VALUES (-1),(-2),(-3); +sync_slave_with_master; + +#connection slave; +DELETE FROM t1 WHERE a = -2; +DELETE FROM t2 WHERE a = -2; +connection master; +DELETE FROM t1 WHERE a = -2; + +--echo *** slave must stop (Key was not found) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +set global slave_exec_mode='STRICT'; + +connection master; +DELETE FROM t2 WHERE a = -2; +--echo *** slave must stop (Key was not found) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +set global slave_exec_mode='STRICT'; + +UPDATE t1 SET a = 1 WHERE a = -1; +UPDATE t2 SET a = 1 WHERE a = -1; + +connection master; +UPDATE t1 SET a = 1 WHERE a = -1; + +--echo *** slave must stop (Key was not found) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +set global slave_exec_mode='STRICT'; + + +connection master; +UPDATE t2 SET a = 1 WHERE a = -1; + +--echo *** slave must stop (Key was not found) +connection slave; +source include/wait_for_slave_sql_to_stop.inc; + +let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); +disable_query_log; +eval SELECT "$last_error" AS Last_SQL_Error; +enable_query_log; + +set global slave_exec_mode='IDEMPOTENT'; +start slave sql_thread; +connection master; +sync_slave_with_master; +#connection slave; +SET @@global.slave_exec_mode= @old_slave_exec_mode; + +# cleanup for bug#31609 tests + +connection master; + +drop table t1,t2,ti2,ti1; +sync_slave_with_master; +set @@global.slave_exec_mode= @old_slave_exec_mode; + +--source include/master-slave-end.inc + +--echo *** end of tests diff --git a/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test index 9aeb57c4fa2..436c0a9f517 100644 --- a/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test +++ b/mysql-test/suite/rpl/t/rpl_row_insert_delayed.test @@ -2,13 +2,4 @@ --source include/master-slave.inc --source include/not_embedded.inc --source include/not_windows.inc - -connection master; -set @old_global_binlog_format = @@global.binlog_format; - -let $binlog_format_statement=0; -set @@global.binlog_format = row; --source extra/rpl_tests/rpl_insert_delayed.test - -connection master; -set @@global.binlog_format = @old_global_binlog_format; diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test index f4cb0f69e93..7416cc48c73 100644 --- a/mysql-test/suite/rpl/t/rpl_slave_skip.test +++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test @@ -1,3 +1,9 @@ +# Every statement in this test is either executing under ROW or +# STATEMENT format, which requires the slave thread to be able to apply +# both statement and row events. Hence, we only need to execute this +# test for MIXED mode. +source include/have_binlog_format_mixed.inc; + source include/master-slave.inc; source include/have_innodb.inc; diff --git a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test new file mode 100644 index 00000000000..940d9f73d13 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test @@ -0,0 +1,121 @@ +source include/have_binlog_format_statement.inc; +source include/master-slave.inc; + +# It is not possible to replicate FOUND_ROWS() using statement-based +# replication, but there is a workaround that stores the result of +# FOUND_ROWS() into a user variable and then replicates this instead. + +# The purpose of this test case is to test that the workaround +# function properly even when inside stored programs (i.e., stored +# routines and triggers). + +--echo ==== Initialize ==== + +--echo **** On Master **** +connection master; +CREATE TABLE t1 (a INT); +CREATE TABLE logtbl (sect INT, test INT, count INT); + +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; +INSERT INTO t1 SELECT 2*a+3 FROM t1; + + +--echo ==== Simple test ==== + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; + +# Instead of +# INSERT INTO logtbl VALUES(1, 1, FOUND_ROWS()); +# we write +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,1,@a); + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; +# Instead of +# INSERT INTO logtbl VALUES(1, 2, FOUND_ROWS()); +# we write +SELECT FOUND_ROWS() INTO @a; +INSERT INTO logtbl VALUES(1,2,@a); + +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test; + + +--echo ==== Stored procedure ==== + +# Here we do both the calculation and the logging. We also do it twice +# to make sure that there are no limitations on how many times it can +# be used. + +--echo **** On Master **** +connection master; +--delimiter $$ +CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN + DECLARE cnt INT; + SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1; + SELECT FOUND_ROWS() INTO cnt; + INSERT INTO logtbl VALUES(sect,test,cnt); + SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; + SELECT FOUND_ROWS() INTO cnt; + INSERT INTO logtbl VALUES(sect,test+1,cnt); +END $$ +--delimiter ; + +CALL calc_and_log(2,1); + +--delimiter $$ +CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN + INSERT INTO logtbl VALUES (sect,test,found_rows); +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO @found_rows; +CALL just_log(2,3,@found_rows); + +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test; + + +--echo ==== Stored functions ==== +--echo **** On Master **** +connection master; +--delimiter $$ +CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT) + RETURNS INT +BEGIN + INSERT INTO logtbl VALUES(sect,test,found_rows); + RETURN found_rows; +END $$ +--delimiter ; + +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1; +SELECT FOUND_ROWS() INTO @found_rows; +SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows); + +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; +--echo **** On Slave **** +sync_slave_with_master; +SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test; + + +--echo ==== Cleanup ==== +--echo **** On Master **** +connection master; +DROP TABLE t1, logtbl; +DROP PROCEDURE just_log; +DROP PROCEDURE calc_and_log; +DROP FUNCTION log_rows; +sync_slave_with_master; + +source include/reset_master_and_slave.inc; + diff --git a/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test index d55e3a4da2c..150b41ad020 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test +++ b/mysql-test/suite/rpl/t/rpl_stm_insert_delayed.test @@ -1,20 +1,5 @@ -# we run first in statement-based then in mixed binlogging - ---source include/have_binlog_format_mixed_or_statement.inc +--source include/have_binlog_format_statement.inc --source include/master-slave.inc --source include/not_embedded.inc --source include/not_windows.inc - -connection master; -set @old_global_binlog_format = @@global.binlog_format; - -let $binlog_format_statement=1; -set @@global.binlog_format = statement; --source extra/rpl_tests/rpl_insert_delayed.test - -let $binlog_format_statement=0; -set @@global.binlog_format = mixed; ---source extra/rpl_tests/rpl_insert_delayed.test - -connection master; -set @@global.binlog_format = @old_global_binlog_format; diff --git a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test index e6c1d5256a0..5795c697d71 100644 --- a/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test +++ b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test @@ -1,17 +1,25 @@ # # rpl_switch_stm_row_mixed tests covers # -# - switching explicitly between STATEMENT, ROW, and MIXED binlog format -# showing when it is possible and when not. -# - switching from MIXED to RBR implicitly listing all use cases, -# e.g a query invokes UUID(), thereafter to serve as the definition -# of MIXED binlog format +# - Master is switching explicitly between STATEMENT, ROW, and MIXED +# binlog format showing when it is possible and when not. +# - Master switching from MIXED to RBR implicitly listing all use +# cases, e.g a query invokes UUID(), thereafter to serve as the +# definition of MIXED binlog format # - correctness of execution -- source include/not_ndb_default.inc -- source include/master-slave.inc +# Since this test generates row-based events in the binary log, the +# slave SQL thread cannot be in STATEMENT mode to execute this test, +# so we only execute it for MIXED and ROW as default value of +# BINLOG_FORMAT. + +connection slave; +-- source include/have_binlog_format_mixed_or_row.inc + connection master; --disable_warnings drop database if exists mysqltest1; diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test index 3b373e00a62..30fe54d0e72 100644 --- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test +++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test @@ -1,10 +1,10 @@ +source include/have_binlog_format_row.inc; source include/master-slave.inc; call mtr.add_suppression("Deadlock found"); --echo **** On Master **** connection master; -SET SESSION BINLOG_FORMAT=ROW; CREATE TABLE t1 (a INT PRIMARY KEY, b INT); INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4); --echo **** On Slave **** diff --git a/mysql-test/suite/rpl/t/rpl_udf.test b/mysql-test/suite/rpl/t/rpl_udf.test index 262ad04630c..d982d53b600 100644 --- a/mysql-test/suite/rpl/t/rpl_udf.test +++ b/mysql-test/suite/rpl/t/rpl_udf.test @@ -5,18 +5,7 @@ # statement based format. This tests work completed in WL#3629. # ################################################################### ---source include/not_embedded.inc --source include/master-slave.inc let $engine_type= MyISAM; - -set binlog_format=row; - -# Embedded server doesn't support binlogging --source include/rpl_udf.inc - -set binlog_format=statement; - -# Embedded server doesn't support binlogging ---source include/rpl_udf.inc - diff --git a/mysql-test/suite/rpl_ndb/combinations b/mysql-test/suite/rpl_ndb/combinations new file mode 100644 index 00000000000..07042c2cbec --- /dev/null +++ b/mysql-test/suite/rpl_ndb/combinations @@ -0,0 +1,8 @@ +[row] +binlog-format=row + +[stmt] +binlog-format=statement + +[mix] +binlog-format=mixed diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result new file mode 100644 index 00000000000..3a31ecd77ba --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -0,0 +1,116 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +==== Initialize ==== +[on slave] +SET @old_binlog_format= @@global.binlog_format; +INSTALL PLUGIN example SONAME 'ha_example.so'; +[on master] +SET @old_binlog_format= @@global.binlog_format; +INSTALL PLUGIN example SONAME 'ha_example.so'; +CREATE TABLE t (a VARCHAR(100)) ENGINE = MYISAM; +CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB; +CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB; +CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; +CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM; +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; +[on slave] +DROP TABLE t_slave_stmt; +CREATE TABLE t_slave_stmt (a INT) ENGINE = EXAMPLE; +[on master] +==== Test ==== +---- binlog_format=row ---- +* Modify tables of more than one engine, one of which is self-logging +CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT INTO t VALUES (1); END; +INSERT INTO t_self_logging VALUES (1); +ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging. +DROP trigger trig_1; +* Modify both row-only and stmt-only table +CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END; +INSERT INTO t_stmt VALUES (1); +ERROR HY000: Cannot execute statement: binlogging impossible since both row-incapable engines and statement-incapable engines are involved. +DROP TRIGGER trig_2; +* Stmt-only table and binlog_format=row +INSERT INTO t_stmt VALUES (1); +ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging. +* Row injection and stmt-only table: in slave sql thread +INSERT INTO t_slave_stmt VALUES (1); +[on slave] +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging.' on opening tables +set global sql_slave_skip_counter=1; +include/start_slave.inc +* Row injection and stmt-only table: use BINLOG statement +BINLOG ' +1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; +BINLOG ' +1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= +1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= +'; +ERROR HY000: Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging. +---- binlog_format=mixed ---- +[on slave] +include/stop_slave.inc +SET @@global.binlog_format = MIXED; +include/start_slave.inc +[on master] +SET @@global.binlog_format = MIXED; +SET @@session.binlog_format = MIXED; +* Unsafe statement and stmt-only engine +INSERT INTO t_stmt VALUES (UUID()); +Warnings: +Note 1639 Unsafe statement binlogged as statement since storage engine is limited to statement-logging. Statement: INSERT INTO t_stmt VALUES (UUID()) +---- binlog_format=statement ---- +[on slave] +include/stop_slave.inc +SET @@global.binlog_format = STATEMENT; +include/start_slave.inc +[on master] +SET @@global.binlog_format = STATEMENT; +SET @@session.binlog_format = STATEMENT; +* Row-only engine and binlog_format=statement: innodb-specific message +INSERT INTO t_row VALUES (1); +ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. +* Row-only engine and binlog_format=statement: generic message +SET @@session.debug= "+d,no_innodb_binlog_errors"; +INSERT INTO t_row VALUES (1); +ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. +* Row injection and binlog_format=statement: BINLOG statement +BINLOG ' +b9pVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABv2lVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; +BINLOG ' +cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB +cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= +'; +ERROR HY000: Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT. +* Unsafe statement and binlog_format=statement +INSERT INTO t VALUES (UUID()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t VALUES (UUID()) +---- master: binlog_format=mixed, slave: binlog_format=statement ---- +SET @@global.binlog_format = MIXED; +SET @@session.binlog_format = MIXED; +* Row injection and binlog_format=statement: in slave sql thread +INSERT INTO t VALUES (UUID()); +[on slave] +--source include/wait_for_slave_sql_error_and_skip.inc +Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT.' on opening tables +set global sql_slave_skip_counter=1; +include/start_slave.inc +[on master] +==== Clean up ==== +DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt; +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; +UNINSTALL PLUGIN example; +[on slave] +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; +UNINSTALL PLUGIN example; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result index 01f8d94da48..b6f32668c42 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result @@ -102,3 +102,4 @@ Last_IO_Errno # Last_IO_Error # Last_SQL_Errno 0 Last_SQL_Error +DROP TABLE t1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test index 3b075808481..63534cf6613 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2innodb.test @@ -8,6 +8,9 @@ # test and to have control over the tests. ############################################################## -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/master-slave.inc -- connection slave diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test index 560efec255b..9ff4ca9eb73 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_2myisam.test @@ -8,6 +8,9 @@ # test and to have control over the tests. ############################################################## -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/master-slave.inc -- connection slave diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test index 5903cd223ad..04ef7f31b7c 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test @@ -1,4 +1,7 @@ --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt new file mode 100644 index 00000000000..ffa981152ea --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt @@ -0,0 +1 @@ +--innodb $EXAMPLE_PLUGIN_OPT diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt new file mode 100644 index 00000000000..ffa981152ea --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-slave.opt @@ -0,0 +1 @@ +--innodb $EXAMPLE_PLUGIN_OPT diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test new file mode 100644 index 00000000000..1b157192b4f --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -0,0 +1,193 @@ +# ==== Purpose ==== +# +# Verify that errors or warnings are issued for all error conditions +# related to deciding the binlog format of a statement. The possible +# errors are listed in a comment above decide_logging_format() in +# sql_base.cc. +# +# ==== Method ==== +# +# Each error condition is executed; we verify that there is an error. +# +# ==== Related bugs ==== +# +# BUG#39934: Slave stops for engine that only support row-based logging +# BUG#42829: binlogging enabled for all schemas regardless of binlog-db-db / binlog-ignore-db +# +# ==== Related test cases ==== +# +# binlog.binlog_unsafe verifies more thoroughly that a warning is +# given for the case when an unsafe statement is executed and +# binlog_format = STATEMENT. + +--source include/have_debug.inc +# The test changes binlog_format, so there is no reason to run it +# under more than one binlog format. +--source include/have_binlog_format_row.inc +--source include/have_ndb.inc +--source include/have_innodb.inc +--source include/ndb_master-slave.inc + + +--echo ==== Initialize ==== + +--echo [on slave] +--connection slave + +SET @old_binlog_format= @@global.binlog_format; +INSTALL PLUGIN example SONAME 'ha_example.so'; + +--echo [on master] +--connection master + +SET @old_binlog_format= @@global.binlog_format; +INSTALL PLUGIN example SONAME 'ha_example.so'; + +CREATE TABLE t (a VARCHAR(100)) ENGINE = MYISAM; +CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB; +CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB; +CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; +CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM; +# This makes the innodb table row-only +SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; + +--echo [on slave] +--sync_slave_with_master + +DROP TABLE t_slave_stmt; +CREATE TABLE t_slave_stmt (a INT) ENGINE = EXAMPLE; + +--echo [on master] +--connection master + + +--echo ==== Test ==== + +--echo ---- binlog_format=row ---- + +--echo * Modify tables of more than one engine, one of which is self-logging +--eval CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT INTO t VALUES (1); END +--error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE +INSERT INTO t_self_logging VALUES (1); +DROP trigger trig_1; + +--echo * Modify both row-only and stmt-only table +--eval CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END +--error ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE +INSERT INTO t_stmt VALUES (1); +DROP TRIGGER trig_2; + +--echo * Stmt-only table and binlog_format=row +--error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE +INSERT INTO t_stmt VALUES (1); + +--echo * Row injection and stmt-only table: in slave sql thread +INSERT INTO t_slave_stmt VALUES (1); +--echo [on slave] +--connection slave +# 1640 = ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE +--let $slave_sql_errno= 1640 +--let $show_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc + +--echo * Row injection and stmt-only table: use BINLOG statement +# This is a format description event +BINLOG ' +1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; +# This is a Table_map_event and a Write_rows_event. Together, they are +# equivalent to 'INSERT INTO t_stmt VALUES (1)' +--error ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE +BINLOG ' +1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= +1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= +'; + + +--echo ---- binlog_format=mixed ---- + +--echo [on slave] +--sync_slave_with_master +--source include/stop_slave.inc +SET @@global.binlog_format = MIXED; +--source include/start_slave.inc +--echo [on master] +--connection master +SET @@global.binlog_format = MIXED; +SET @@session.binlog_format = MIXED; + +--echo * Unsafe statement and stmt-only engine +# This will give a warning. +INSERT INTO t_stmt VALUES (UUID()); + + +--echo ---- binlog_format=statement ---- + +--echo [on slave] +--sync_slave_with_master +--source include/stop_slave.inc +SET @@global.binlog_format = STATEMENT; +--source include/start_slave.inc +--echo [on master] +--connection master +SET @@global.binlog_format = STATEMENT; +SET @@session.binlog_format = STATEMENT; + +--echo * Row-only engine and binlog_format=statement: innodb-specific message +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE +INSERT INTO t_row VALUES (1); + +--echo * Row-only engine and binlog_format=statement: generic message +SET @@session.debug= "+d,no_innodb_binlog_errors"; +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE +INSERT INTO t_row VALUES (1); + +--echo * Row injection and binlog_format=statement: BINLOG statement +# This is a format description event +BINLOG ' +b9pVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAABv2lVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; +# This is a Table_map_event and a Write_rows_event. Together, they are +# equivalent to 'INSERT INTO t VALUES (1)'. +--error ER_BINLOG_ROW_INJECTION_AND_STMT_MODE +BINLOG ' +cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB +cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= +'; + +--echo * Unsafe statement and binlog_format=statement +# This will give a warning. +INSERT INTO t VALUES (UUID()); + + +--echo ---- master: binlog_format=mixed, slave: binlog_format=statement ---- + +SET @@global.binlog_format = MIXED; +SET @@session.binlog_format = MIXED; + +--echo * Row injection and binlog_format=statement: in slave sql thread +INSERT INTO t VALUES (UUID()); +--echo [on slave] +--connection slave +# 1642 = ER_BINLOG_ROW_INJECTION_AND_STMT_MODE +--let $slave_sql_errno= 1642 +--let $show_sql_error= 1 +--source include/wait_for_slave_sql_error_and_skip.inc + +--echo [on master] +--connection master + + +--echo ==== Clean up ==== + +DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt; +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; +UNINSTALL PLUGIN example; +--echo [on slave] +--sync_slave_with_master +SET @@global.binlog_format = @old_binlog_format; +SET @@session.binlog_format = @old_binlog_format; +UNINSTALL PLUGIN example; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test index 822f1f224cd..a79c62e2a10 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob.test @@ -1,4 +1,7 @@ --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc # diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test index e29f24998fe..26946450e07 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_blob2.test @@ -3,6 +3,11 @@ # Using wrapper to share test # # code between engine tests # ################################# +# +# Since the master generates row-based events, the slave may not be in +# STATEMENT mode to accept the events. +# +-- source include/have_binlog_format_mixed_or_row.inc -- source include/have_ndb.inc -- source include/ndb_master-slave.inc let $engine_type=NDBCLUSTER; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test index 2cc46e2420e..d7456745b53 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test @@ -1,4 +1,7 @@ --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc # set up circular replication diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test index d5ddfc2b739..c133c668887 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test @@ -1,4 +1,7 @@ --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc connection master; @@ -78,3 +81,7 @@ SELECT * FROM t1 ORDER BY a; --replace_result $MASTER_MYPORT MASTER_PORT --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # query_vertical SHOW SLAVE STATUS; + +connection master; +DROP TABLE t1; +sync_slave_with_master; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test index 8c45ac5dbdd..cf3eb9589d2 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_commit_afterflush.test @@ -4,6 +4,10 @@ # Different engines # # By JBM 2004-02-15 # ##################################### + +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/have_ndb.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test index 8d5ad334766..cb99d049266 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_ctype_ucs2_def.test @@ -1,5 +1,8 @@ --source include/have_ucs2.inc --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc # diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test index 6b1d932f9a6..c06d1a62fef 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_delete_nowhere.test @@ -3,6 +3,9 @@ # Share test code between engine tests # ######################################### --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_delete_no_where.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test index ffe8551d00f..750ae377350 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_db.test @@ -6,6 +6,9 @@ ########################################################## --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc --disable_warnings diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test index ee6abd580f5..4598795cead 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_do_table.test @@ -6,6 +6,9 @@ ########################################################## --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc --disable_warnings diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test index c02d82e2dc9..5f0fd3dfe49 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_func003.test @@ -7,6 +7,9 @@ # reduce test case code # ################################### -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_row_func003.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test index fcc2928c5e2..66531172894 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb_trans.test @@ -2,6 +2,9 @@ -- source include/have_ndb.inc -- source include/have_innodb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc create table t1 (a int, unique(a)) engine=ndbcluster; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test index e6c66011fb7..be6f71eb5b5 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_insert_ignore.test @@ -2,6 +2,9 @@ # Wrapper for rpl_insert_ignore.test# ##################################### -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; let $engine_type2=myisam; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test index 14b76722fa6..13c2fbce2b4 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_engines_transactions.test @@ -23,6 +23,9 @@ source include/have_ndb.inc; +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +source include/have_binlog_format_mixed_or_row.inc; source include/ndb_master-slave.inc; source include/have_innodb.inc; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test index f144965e9b0..0375fd7fe6d 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_multi_update3.test @@ -3,6 +3,9 @@ # to reuse test code between engine runs # ############################################################ -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_multi_update3.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test index 1f305d20c92..2d0c87927a5 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_rep_ignore.test @@ -7,6 +7,9 @@ ########################################################## --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc --source include/ndb_master-slave.inc --disable_warnings diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test index f5b05080131..c711e6ddfa3 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_001.test @@ -2,6 +2,9 @@ # By JBM 2005-02-15 Wrapped to allow reuse of test code# ######################################################## --source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +--source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_row_001.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test index 6453f45aa75..a8dab098df5 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp003.test @@ -5,6 +5,9 @@ # For different engines # ################################# -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDBCLUSTER; -- source extra/rpl_tests/rpl_row_sp003.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test index c2c7be6112c..f005d9cd67a 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sp006.test @@ -5,6 +5,9 @@ # For different engines # ################################# -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDBCLUSTER; -- source extra/rpl_tests/rpl_row_sp006.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test index 7f7e08685bf..1fef32b7a65 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_trig004.test @@ -8,6 +8,9 @@ # Includes -- source include/have_ndb.inc +# Since the master generates row-based events, the slave must be in +# ROW or MIXED mode to accept the events. +-- source include/have_binlog_format_mixed_or_row.inc -- source include/ndb_master-slave.inc let $engine_type=NDB; -- source extra/rpl_tests/rpl_trig004.test diff --git a/mysql-test/t/partition_innodb_stmt.test b/mysql-test/t/partition_innodb_stmt.test index d6181ce068e..c6f30f41969 100644 --- a/mysql-test/t/partition_innodb_stmt.test +++ b/mysql-test/t/partition_innodb_stmt.test @@ -50,7 +50,7 @@ connection con1; --echo # connection con1 SET TRANSACTION ISOLATION LEVEL READ COMMITTED; BEGIN; ---error ER_BINLOG_LOGGING_IMPOSSIBLE +--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE INSERT INTO t1 VALUES(9); COMMIT; diff --git a/sql/event_db_repository.cc b/sql/event_db_repository.cc index 9a253d74546..a8d634d76e1 100644 --- a/sql/event_db_repository.cc +++ b/sql/event_db_repository.cc @@ -1034,7 +1034,7 @@ update_timing_fields_for_event(THD *thd, Turn off row binlogging of event timing updates. These are not used for RBR of events replicated to the slave. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->clear_current_stmt_binlog_row_based(); DBUG_ASSERT(thd->security_ctx->master_access & SUPER_ACL); diff --git a/sql/events.cc b/sql/events.cc index ea935e67bd3..b8c3972d1c3 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -403,7 +403,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for CREATE EVENT command. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->clear_current_stmt_binlog_row_based(); pthread_mutex_lock(&LOCK_event_metadata); @@ -527,7 +527,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for UPDATE EVENT command. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->clear_current_stmt_binlog_row_based(); pthread_mutex_lock(&LOCK_event_metadata); @@ -624,7 +624,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for DROP EVENT command. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->clear_current_stmt_binlog_row_based(); pthread_mutex_lock(&LOCK_event_metadata); diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index a0c74b60f84..5346ef1d626 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -304,6 +304,7 @@ static void run_query(THD *thd, char *buf, char *end, thd->transaction.all= save_thd_transaction_all; thd->transaction.stmt= save_thd_transaction_stmt; thd->net= save_thd_net; + thd->set_current_stmt_binlog_row_based(); if (thd == injector_thd) { @@ -3649,6 +3650,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) thd= new THD; /* note that contructor of THD uses DBUG_ */ THD_CHECK_SENTRY(thd); + thd->set_current_stmt_binlog_row_based(); /* We need to set thd->thread_id before thd->store_globals, or it will set an invalid value for thd->variables.pseudo_thread_id. diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 67bc3156260..97a8dd99201 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -6188,7 +6188,7 @@ void ha_partition::get_auto_increment(ulonglong offset, ulonglong increment, if (!auto_increment_safe_stmt_log_lock && thd->lex->sql_command != SQLCOM_INSERT && mysql_bin_log.is_open() && - !thd->current_stmt_binlog_row_based && + !thd->is_current_stmt_binlog_format_row() && (thd->options & OPTION_BIN_LOG)) { DBUG_PRINT("info", ("locking auto_increment_safe_stmt_log_lock")); diff --git a/sql/handler.cc b/sql/handler.cc index 058a43eed8d..c61d012e552 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -2412,7 +2412,7 @@ int handler::update_auto_increment() variables->auto_increment_increment); auto_inc_intervals_count++; /* Row-based replication does not need to store intervals in binlog */ - if (mysql_bin_log.is_open() && !thd->current_stmt_binlog_row_based) + if (mysql_bin_log.is_open() && !thd->is_current_stmt_binlog_format_row()) thd->auto_inc_intervals_in_cur_stmt_for_binlog.append(auto_inc_interval_for_cur_row.minimum(), auto_inc_interval_for_cur_row.values(), variables->auto_increment_increment); @@ -4423,7 +4423,7 @@ static bool check_table_binlog_row_based(THD *thd, TABLE *table) DBUG_ASSERT(table->s->cached_row_logging_check == 0 || table->s->cached_row_logging_check == 1); - return (thd->current_stmt_binlog_row_based && + return (thd->is_current_stmt_binlog_format_row() && table->s->cached_row_logging_check && (thd->options & OPTION_BIN_LOG) && mysql_bin_log.is_open()); diff --git a/sql/item_create.cc b/sql/item_create.cc index bf359b10caa..23a921be91c 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -2375,6 +2375,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List *item_list) Item *func= NULL; int arg_count= 0; + DBUG_ENTER("Create_udf_func::create"); if (item_list != NULL) arg_count= item_list->elements; @@ -2462,7 +2463,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List *item_list) } } thd->lex->safe_to_cache_query= 0; - return func; + DBUG_RETURN(func); } #endif @@ -3363,9 +3364,10 @@ Create_func_found_rows Create_func_found_rows::s_singleton; Item* Create_func_found_rows::create(THD *thd) { + DBUG_ENTER("Create_func_found_rows::create"); thd->lex->set_stmt_unsafe(); thd->lex->safe_to_cache_query= 0; - return new (thd->mem_root) Item_func_found_rows(); + DBUG_RETURN(new (thd->mem_root) Item_func_found_rows()); } @@ -3791,9 +3793,10 @@ Create_func_load_file Create_func_load_file::s_singleton; Item* Create_func_load_file::create(THD *thd, Item *arg1) { + DBUG_ENTER("Create_func_load_file::create"); thd->lex->set_stmt_unsafe(); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); - return new (thd->mem_root) Item_load_file(arg1); + DBUG_RETURN(new (thd->mem_root) Item_load_file(arg1)); } @@ -4260,9 +4263,10 @@ Create_func_row_count Create_func_row_count::s_singleton; Item* Create_func_row_count::create(THD *thd) { + DBUG_ENTER("Create_func_row_count::create"); thd->lex->set_stmt_unsafe(); thd->lex->safe_to_cache_query= 0; - return new (thd->mem_root) Item_func_row_count(); + DBUG_RETURN(new (thd->mem_root) Item_func_row_count()); } @@ -4569,9 +4573,10 @@ Create_func_uuid Create_func_uuid::s_singleton; Item* Create_func_uuid::create(THD *thd) { + DBUG_ENTER("Create_func_uuid::create"); thd->lex->set_stmt_unsafe(); thd->lex->safe_to_cache_query= 0; - return new (thd->mem_root) Item_func_uuid(); + DBUG_RETURN(new (thd->mem_root) Item_func_uuid()); } @@ -4580,9 +4585,10 @@ Create_func_uuid_short Create_func_uuid_short::s_singleton; Item* Create_func_uuid_short::create(THD *thd) { + DBUG_ENTER("Create_func_uuid_short::create"); thd->lex->set_stmt_unsafe(); thd->lex->safe_to_cache_query= 0; - return new (thd->mem_root) Item_func_uuid_short(); + DBUG_RETURN(new (thd->mem_root) Item_func_uuid_short()); } diff --git a/sql/log.cc b/sql/log.cc index ee7ee48b42c..ef7d5c75f84 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3734,7 +3734,7 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans) table->s->table_map_id)); /* Pre-conditions */ - DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open()); + DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); DBUG_ASSERT(table->s->table_map_id != ULONG_MAX); Table_map_log_event::flag_set const @@ -4009,7 +4009,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) */ if (thd) { - if (!thd->current_stmt_binlog_row_based) + if (!thd->is_current_stmt_binlog_format_row()) { if (thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt) { diff --git a/sql/log_event.cc b/sql/log_event.cc index 7dd05c3f703..1c33fb86290 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7187,16 +7187,12 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) */ thd->transaction.stmt.modified_non_trans_table= FALSE; /* - Check if the slave is set to use SBR. If so, it should switch - to using RBR until the end of the "statement", i.e., next - STMT_END_F or next error. + This is a row injection, so we flag the "statement" as + such. Note that this code is called both when the slave does row + injections and when the BINLOG statement is used to do row + injections. */ - if (!thd->current_stmt_binlog_row_based && - mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG)) - { - thd->set_current_stmt_binlog_row_based(); - } - + thd->lex->set_stmt_row_injection(); /* There are a few flags that are replicated with each row event. @@ -7444,6 +7440,13 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) slave_rows_error_report(ERROR_LEVEL, error, rli, thd, table, get_type_str(), RPL_LOG_NAME, (ulong) log_pos); + /* + @todo We should probably not call + reset_current_stmt_binlog_row_based() from here. + + Note: this applies to log_event_old.cc too. + /Sven + */ thd->reset_current_stmt_binlog_row_based(); const_cast(rli)->cleanup_context(thd, error); thd->is_slave_error= 1; @@ -7545,6 +7548,16 @@ static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd) event flushed. */ + /* + @todo We should probably not call + reset_current_stmt_binlog_row_based() from here. + + Note: this applies to log_event_old.cc too + + Btw, the previous comment about transactional engines does not + seem related to anything that happens here. + /Sven + */ thd->reset_current_stmt_binlog_row_based(); const_cast(rli)->cleanup_context(thd, 0); diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 68cd2bf4673..e76dbd257a7 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -66,15 +66,12 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info mysql_reset_thd_for_next_command(thd); /* - Check if the slave is set to use SBR. If so, it should switch - to using RBR until the end of the "statement", i.e., next - STMT_END_F or next error. + This is a row injection, so we flag the "statement" as + such. Note that this code is called both when the slave does row + injections and when the BINLOG statement is used to do row + injections. */ - if (!thd->current_stmt_binlog_row_based && - mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG)) - { - thd->set_current_stmt_binlog_row_based(); - } + thd->lex->set_stmt_row_injection(); if (simple_open_n_lock_tables(thd, rli->tables_to_lock)) { diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index de02abc48e3..71fa55ff7a4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1559,7 +1559,6 @@ TABLE *open_n_lock_single_table(THD *thd, TABLE_LIST *table_l, thr_lock_type lock_type); bool open_normal_and_derived_tables(THD *thd, TABLE_LIST *tables, uint flags); int lock_tables(THD *thd, TABLE_LIST *tables, uint counter, bool *need_reopen); -int decide_logging_format(THD *thd, TABLE_LIST *tables); TABLE *open_temporary_table(THD *thd, const char *path, const char *db, const char *table_name, bool link_in_list); bool rm_temporary_table(handlerton *base, char *path); diff --git a/sql/rpl_injector.cc b/sql/rpl_injector.cc index 684655d1c3b..8cdee89e164 100644 --- a/sql/rpl_injector.cc +++ b/sql/rpl_injector.cc @@ -36,8 +36,6 @@ injector::transaction::transaction(MYSQL_BIN_LOG *log, THD *thd) m_start_pos.m_file_pos= log_info.pos; begin_trans(m_thd); - - thd->set_current_stmt_binlog_row_based(); } injector::transaction::~transaction() diff --git a/sql/set_var.cc b/sql/set_var.cc index 0b89333ce03..846aabbab57 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1292,6 +1292,11 @@ bool sys_var_thd_binlog_format::is_readonly() const void fix_binlog_format_after_update(THD *thd, enum_var_type type) { + /* + @todo This function should be eliminated. We should not set the + current binlog format anywhere else than in decide_logging_format. + /Sven + */ thd->reset_current_stmt_binlog_row_based(); } diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 42bca02984d..1f466dd3db6 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6076,8 +6076,7 @@ ER_SLAVE_INCIDENT ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT eng "Table has no partition for some existing values" ER_BINLOG_UNSAFE_STATEMENT - eng "Statement may not be safe to log in statement format." - swe "Detta är inte säkert att logga i statement-format." + eng "Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT." ER_SLAVE_FATAL_ERROR eng "Fatal error: %s" ER_SLAVE_RELAY_LOG_READ_FAILURE @@ -6201,3 +6200,18 @@ ER_TEMPORARY_NAME ER_RENAMED_NAME eng "Renamed" swe "Namnändrad" + +ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE + eng "Cannot execute statement: binlogging impossible since both row-incapable engines and statement-incapable engines are involved." +ER_BINLOG_ROW_MODE_AND_STMT_ENGINE + eng "Cannot execute statement: binlogging impossible since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging." +ER_BINLOG_UNSAFE_AND_STMT_ENGINE + eng "Unsafe statement binlogged as statement since storage engine is limited to statement-logging." +ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE + eng "Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging." +ER_BINLOG_STMT_MODE_AND_ROW_ENGINE + eng "Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging.%s" +ER_BINLOG_ROW_INJECTION_AND_STMT_MODE + eng "Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT." +ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE + eng "Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging." diff --git a/sql/sp.cc b/sql/sp.cc index 29e228f5e45..a0c34e2bc1b 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -939,7 +939,7 @@ sp_create_routine(THD *thd, int type, sp_head *sp) /* restore sql_mode when binloging */ thd->variables.sql_mode= saved_mode; /* Such a statement can always go directly to binlog, no trans cache */ - thd->binlog_query(THD::MYSQL_QUERY_TYPE, + thd->binlog_query(THD::STMT_QUERY_TYPE, log_query.c_ptr(), log_query.length(), FALSE, FALSE, 0); thd->variables.sql_mode= 0; @@ -1830,6 +1830,8 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, { int ret= 0; + DBUG_ENTER("sp_cache_routines_and_add_tables_for_triggers"); + Sroutine_hash_entry **last_cached_routine_ptr= (Sroutine_hash_entry **)lex->sroutines_list.next; @@ -1863,7 +1865,7 @@ sp_cache_routines_and_add_tables_for_triggers(THD *thd, LEX *lex, ret= sp_cache_routines_and_add_tables_aux(thd, lex, *last_cached_routine_ptr, FALSE); - return ret; + DBUG_RETURN(ret); } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 8a8a5b06cc1..629a24585b3 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1692,7 +1692,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, each substatement be binlogged its way. */ need_binlog_call= mysql_bin_log.is_open() && - (thd->options & OPTION_BIN_LOG) && !thd->current_stmt_binlog_row_based; + (thd->options & OPTION_BIN_LOG) && !thd->is_current_stmt_binlog_format_row(); /* Remember the original arguments for unrolled replication of functions diff --git a/sql/sp_head.h b/sql/sp_head.h index dd11f8693ac..7faccb7afbb 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -459,6 +459,7 @@ public: */ void propagate_attributes(LEX *lex) { + DBUG_ENTER("sp_head::propagate_attributes"); /* If this routine needs row-based binary logging, the entire top statement too (we cannot switch from statement-based to row-based only for this @@ -467,6 +468,7 @@ public: */ if (m_flags & BINLOG_ROW_BASED_IF_MIXED) lex->set_stmt_unsafe(); + DBUG_VOID_RETURN; } diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 79fc5d816fd..e614df4efcd 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1654,7 +1654,7 @@ bool change_password(THD *thd, const char *host, const char *user, acl_user->host.hostname ? acl_user->host.hostname : "", new_password)); thd->clear_error(); - thd->binlog_query(THD::MYSQL_QUERY_TYPE, buff, query_length, + thd->binlog_query(THD::STMT_QUERY_TYPE, buff, query_length, FALSE, FALSE, 0); } end: diff --git a/sql/sql_base.cc b/sql/sql_base.cc index de93c6609f7..a884a982011 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1441,7 +1441,7 @@ void close_temporary_tables(THD *thd) return; if (!mysql_bin_log.is_open() || - (thd->current_stmt_binlog_row_based && thd->variables.binlog_format == BINLOG_FORMAT_ROW)) + (thd->is_current_stmt_binlog_format_row() && thd->variables.binlog_format == BINLOG_FORMAT_ROW)) { TABLE *tmp_next; for (table= thd->temporary_tables; table; table= tmp_next) @@ -4831,7 +4831,7 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table, There may be more differences between open_n_lock_single_table() and open_ltable(). One known difference is that open_ltable() does - neither call decide_logging_format() nor handle some other logging + neither call thd->decide_logging_format() nor handle some other logging and locking issues because it does not call lock_tables(). */ @@ -5052,63 +5052,142 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table) /** - Decide on logging format to use for the statement. + Decide on logging format to use for the statement and issue errors + or warnings as needed. The decision depends on the following + parameters: - Compute the capabilities vector for the involved storage engines - and mask out the flags for the binary log. Right now, the binlog - flags only include the capabilities of the storage engines, so this - is safe. + - The logging mode, i.e., the value of binlog_format. Can be + statement, mixed, or row. - We now have three alternatives that prevent the statement from - being loggable: + - The type of statement. There are three types of statements: + "normal" safe statements; unsafe statements; and row injections. + An unsafe statement is one that, if logged in statement format, + might produce different results when replayed on the slave (e.g., + INSERT DELAYED). A row injection is either a BINLOG statement, or + a row event executed by the slave's SQL thread. - 1. If there are no capabilities left (all flags are clear) it is - not possible to log the statement at all, so we roll back the - statement and report an error. + - The capabilities of tables modified by the statement. The + *capabilities vector* for a table is a set of flags associated + with the table. Currently, it only includes two flags: *row + capability flag* and *statement capability flag*. - 2. Statement mode is set, but the capabilities indicate that - statement format is not possible. + The row capability flag is set if and only if the engine can + handle row-based logging. The statement capability flag is set if + and only if the table can handle statement-based logging. - 3. Row mode is set, but the capabilities indicate that row - format is not possible. + Decision table for logging format + --------------------------------- - 4. Statement is unsafe, but the capabilities indicate that row - format is not possible. + The following table summarizes how the format and generated + warning/error depends on the tables' capabilities, the statement + type, and the current binlog_format. - If we are in MIXED mode, we then decide what logging format to use: + Row capable N NNNNNNNNN YYYYYYYYY YYYYYYYYY + Statement capable N YYYYYYYYY NNNNNNNNN YYYYYYYYY - 1. If the statement is unsafe, row-based logging is used. + Statement type * SSSUUUIII SSSUUUIII SSSUUUIII - 2. If statement-based logging is not possible, row-based logging is - used. + binlog_format * SMRSMRSMR SMRSMRSMR SMRSMRSMR - 3. Otherwise, statement-based logging is used. + Logged format - SS-SS---- -RR-RR-RR SRRSRR-RR + Warning/Error 1 --2332444 5--5--6-- ---7--6-- - @param thd Client thread - @param tables Tables involved in the query - */ + Legend + ------ -int decide_logging_format(THD *thd, TABLE_LIST *tables) + Row capable: N - Some table not row-capable, Y - All tables row-capable + Stmt capable: N - Some table not stmt-capable, Y - All tables stmt-capable + Statement type: (S)afe, (U)nsafe, or Row (I)njection + binlog_format: (S)TATEMENT, (M)IXED, or (R)OW + Logged format: (S)tatement or (R)ow + Warning/Error: Warnings and error messages are as follows: + + 1. Error: Cannot execute statement: binlogging impossible since both + row-incapable engines and statement-incapable engines are + involved. + + 2. Error: Cannot execute statement: binlogging impossible since + BINLOG_FORMAT = ROW and at least one table uses a storage engine + limited to statement-logging. + + 3. Warning: Unsafe statement binlogged as statement since storage + engine is limited to statement-logging. + + 4. Error: Cannot execute row injection: binlogging impossible since + at least one table uses a storage engine limited to + statement-logging. + + 5. Error: Cannot execute statement: binlogging impossible since + BINLOG_FORMAT = STATEMENT and at least one table uses a storage + engine limited to row-logging. + + 6. Error: Cannot execute row injection: binlogging impossible since + BINLOG_FORMAT = STATEMENT. + + 7. Warning: Unsafe statement binlogged in statement format since + BINLOG_FORMAT = STATEMENT. + + In addition, we can produce the following error (not depending on + the variables of the decision diagram): + + 8. Error: Cannot execute statement: binlogging impossible since more + than one engine is involved and at least one engine is + self-logging. + + For each error case above, the statement is prevented from being + logged, we report an error, and roll back the statement. For + warnings, we set the thd->binlog_flags variable: the warning will be + printed only if the statement is successfully logged. + + @see THD::binlog_query + + @param[in] thd Client thread + @param[in] tables Tables involved in the query + + @retval 0 No error; statement can be logged. + @retval -1 One of the error conditions above applies (1, 2, 4, 5, or 6). +*/ + +int THD::decide_logging_format(TABLE_LIST *tables) { - if (mysql_bin_log.is_open() && (thd->options & OPTION_BIN_LOG)) + DBUG_ENTER("THD::decide_logging_format"); + if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG)) { /* Compute the starting vectors for the computations by creating a set with all the capabilities bits set and one with no capabilities bits set. - */ + */ handler::Table_flags flags_some_set= 0; handler::Table_flags flags_all_set= HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; my_bool multi_engine= FALSE; void* prev_ht= NULL; + +#ifndef DBUG_OFF + { + static const char *prelocked_mode_name[] = { + "NON_PRELOCKED", + "PRELOCKED", + "PRELOCKED_UNDER_LOCK_TABLES", + }; + DBUG_PRINT("debug", ("prelocked_mode: %s", + prelocked_mode_name[prelocked_mode])); + } +#endif + + /* + Get the capabilities vector for all involved storage engines and + mask out the flags for the binary log. (Currently, the binlog + flags only include the capabilities of the storage engines.) + */ for (TABLE_LIST *table= tables; table; table= table->next_global) { if (table->placeholder()) continue; if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) - thd->lex->set_stmt_unsafe(); + lex->set_stmt_unsafe(); if (table->lock_type >= TL_WRITE_ALLOW_WRITE) { ulonglong const flags= table->table->file->ha_table_flags(); @@ -5130,75 +5209,116 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables) DBUG_PRINT("info", ("flags_some_set: %s%s", FLAGSTR(flags_some_set, HA_BINLOG_STMT_CAPABLE), FLAGSTR(flags_some_set, HA_BINLOG_ROW_CAPABLE))); - DBUG_PRINT("info", ("thd->variables.binlog_format: %ld", - thd->variables.binlog_format)); + DBUG_PRINT("info", ("variables.binlog_format: %ld", + variables.binlog_format)); DBUG_PRINT("info", ("multi_engine: %s", multi_engine ? "TRUE" : "FALSE")); int error= 0; - if (flags_all_set == 0) - { - my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0), - "Statement cannot be logged to the binary log in" - " row-based nor statement-based format"); - } - else if (thd->variables.binlog_format == BINLOG_FORMAT_STMT && - (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) - { - my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0), - "Statement-based format required for this statement," - " but not allowed by this combination of engines"); - } - else if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW || - thd->lex->is_stmt_unsafe()) && - (flags_all_set & HA_BINLOG_ROW_CAPABLE) == 0) - { - my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0), - "Row-based format required for this statement," - " but not allowed by this combination of engines"); - } /* If more than one engine is involved in the statement and at least one is doing it's own logging (is *self-logging*), the statement cannot be logged atomically, so we generate an error rather than allowing the binlog to become corrupt. - */ + */ if (multi_engine && (flags_some_set & HA_HAS_OWN_BINLOGGING)) { - error= ER_BINLOG_LOGGING_IMPOSSIBLE; - my_error(error, MYF(0), - "Statement cannot be written atomically since more" - " than one engine involved and at least one engine" - " is self-logging"); + my_error((error= ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE), + MYF(0)); } - DBUG_PRINT("info", ("error: %d", error)); + /* both statement-only and row-only engines involved */ + if ((flags_all_set & (HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE)) == 0) + { + /* + 1. Error: Binary logging impossible since both row-incapable + engines and statement-incapable engines are involved + */ + my_error((error= ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE), MYF(0)); + } + /* statement-only engines involved */ + else if ((flags_all_set & HA_BINLOG_ROW_CAPABLE) == 0) + { + if (lex->is_stmt_row_injection()) + { + /* + 4. Error: Cannot execute row injection since table uses + storage engine limited to statement-logging + */ + my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0)); + } + else if (variables.binlog_format == BINLOG_FORMAT_ROW) + { + /* + 2. Error: Cannot modify table that uses a storage engine + limited to statement-logging when BINLOG_FORMAT = ROW + */ + my_error((error= ER_BINLOG_ROW_MODE_AND_STMT_ENGINE), MYF(0)); + } + else if (lex->is_stmt_unsafe()) + { + /* + 3. Warning: Unsafe statement binlogged as statement since + storage engine is limited to statement-logging. + */ + binlog_warning_flags|= + (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_ENGINE); + } + /* log in statement format! */ + } + /* no statement-only engines */ + else + { + /* binlog_format = STATEMENT */ + if (variables.binlog_format == BINLOG_FORMAT_STMT) + { + if (lex->is_stmt_row_injection()) + { + /* + 6. Error: Cannot execute row injection since + BINLOG_FORMAT = STATEMENT + */ + my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_MODE), MYF(0)); + } + else if ((flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) + { + /* + 5. Error: Cannot modify table that uses a storage engine + limited to row-logging when binlog_format = STATEMENT + */ + my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), ""); + } + else if (lex->is_stmt_unsafe()) + { + /* + 7. Warning: Unsafe statement logged as statement due to + binlog_format = STATEMENT + */ + binlog_warning_flags|= + (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_MODE); + } + /* log in statement format! */ + } + /* No statement-only engines and binlog_format != STATEMENT. + I.e., nothing prevents us from row logging if needed. */ + else + { + if (lex->is_stmt_unsafe() || lex->is_stmt_row_injection() + || (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) + { + /* log in row format! */ + set_current_stmt_binlog_row_based_if_mixed(); + } + } + } if (error) - return -1; - - /* - We switch to row-based format if we are in mixed mode and one of - the following are true: - - 1. If the statement is unsafe - 2. If statement format cannot be used - - Observe that point to cannot be decided before the tables - involved in a statement has been checked, i.e., we cannot put - this code in reset_current_stmt_binlog_row_based(), it has to be - here. - */ - if (thd->lex->is_stmt_unsafe() || - (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) - { - thd->set_current_stmt_binlog_row_based_if_mixed(); - } + DBUG_RETURN(-1); } - return 0; + DBUG_RETURN(0); } /* @@ -5242,7 +5362,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) *need_reopen= FALSE; if (!tables && !thd->lex->requires_prelocking()) - DBUG_RETURN(decide_logging_format(thd, tables)); + DBUG_RETURN(thd->decide_logging_format(tables)); /* We need this extra check for thd->prelocked_mode because we want to avoid @@ -5402,7 +5522,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) } } - DBUG_RETURN(decide_logging_format(thd, tables)); + DBUG_RETURN(thd->decide_logging_format(tables)); } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f1ad410b877..145fb8b60d7 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -539,7 +539,7 @@ THD::THD() lock_id(&main_lock_id), user_time(0), in_sub_stmt(0), sql_log_bin_toplevel(false), - binlog_table_maps(0), binlog_flags(0UL), + binlog_warning_flags(0UL), binlog_table_maps(0), table_map_for_update(0), arg_of_last_insert_id_function(FALSE), first_successful_insert_id_in_prev_stmt(0), @@ -2973,13 +2973,13 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup, first_successful_insert_id_in_cur_stmt; if ((!lex->requires_prelocking() || is_update_query(lex->sql_command)) && - !current_stmt_binlog_row_based) + !is_current_stmt_binlog_format_row()) { options&= ~OPTION_BIN_LOG; } if ((backup->options & OPTION_BIN_LOG) && is_update_query(lex->sql_command)&& - !current_stmt_binlog_row_based) + !is_current_stmt_binlog_format_row()) mysql_bin_log.start_union_events(this, this->query_id); /* Disable result sets */ @@ -3041,7 +3041,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) is_fatal_sub_stmt_error= FALSE; if ((options & OPTION_BIN_LOG) && is_update_query(lex->sql_command) && - !current_stmt_binlog_row_based) + !is_current_stmt_binlog_format_row()) mysql_bin_log.stop_union_events(this); /* @@ -3463,7 +3463,7 @@ int THD::binlog_write_row(TABLE* table, bool is_trans, MY_BITMAP const* cols, size_t colcnt, uchar const *record) { - DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open()); + DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); /* Pack records into format for transfer. We are allocating more @@ -3493,7 +3493,7 @@ int THD::binlog_update_row(TABLE* table, bool is_trans, const uchar *before_record, const uchar *after_record) { - DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open()); + DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); size_t const before_maxlen = max_row_length(table, before_record); size_t const after_maxlen = max_row_length(table, after_record); @@ -3538,7 +3538,7 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans, MY_BITMAP const* cols, size_t colcnt, uchar const *record) { - DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open()); + DBUG_ASSERT(is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()); /* Pack records into format for transfer. We are allocating more @@ -3620,8 +3620,6 @@ show_query_type(THD::enum_binlog_query_type qtype) return "ROW"; case THD::STMT_QUERY_TYPE: return "STMT"; - case THD::MYSQL_QUERY_TYPE: - return "MYSQL"; case THD::QUERY_TYPE_COUNT: default: DBUG_ASSERT(0 <= qtype && qtype < THD::QUERY_TYPE_COUNT); @@ -3633,28 +3631,30 @@ show_query_type(THD::enum_binlog_query_type qtype) #endif -/* - Member function that will log query, either row-based or - statement-based depending on the value of the 'current_stmt_binlog_row_based' - the value of the 'qtype' flag. +/** + Log the current query. - This function should be called after the all calls to ha_*_row() - functions have been issued, but before tables are unlocked and - closed. + The query will be logged in either row format or statement format + depending on the value of @c current_stmt_binlog_row_based field and + the value of the @c qtype parameter. - OBSERVE - There shall be no writes to any system table after calling - binlog_query(), so these writes has to be moved to before the call - of binlog_query() for correct functioning. + This function must be called: - This is necessesary not only for RBR, but the master might crash - after binlogging the query but before changing the system tables. - This means that the slave and the master are not in the same state - (after the master has restarted), so therefore we have to - eliminate this problem. + - After the all calls to ha_*_row() functions have been issued. - RETURN VALUE - Error code, or 0 if no error. + - After any writes to system tables. Rationale: if system tables + were written after a call to this function, and the master crashes + after the call to this function and before writing the system + tables, then the master and slave get out of sync. + + - Before tables are unlocked and closed. + + @see decide_logging_format + + @retval 0 Success + + @retval nonzero If there is a failure when writing the query (e.g., + write failure), then the error code is returned. */ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, ulong query_len, bool is_trans, bool suppress_use, @@ -3679,50 +3679,69 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, DBUG_RETURN(error); /* - If we are in statement mode and trying to log an unsafe statement, - we should print a warning. + Warnings for unsafe statements logged in statement format are + printed here instead of in decide_logging_format(). This is + because the warnings should be printed only if the statement is + actually logged. When executing decide_logging_format(), we cannot + know for sure if the statement will be logged. */ - if (sql_log_bin_toplevel && lex->is_stmt_unsafe() && - variables.binlog_format == BINLOG_FORMAT_STMT) + if (sql_log_bin_toplevel) { - /* - A warning can be elevated a error when STRICT sql mode. - But we don't want to elevate binlog warning to error here. - */ - push_warning(this, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_BINLOG_UNSAFE_STATEMENT, - ER(ER_BINLOG_UNSAFE_STATEMENT)); - if (!(binlog_flags & BINLOG_FLAG_UNSAFE_STMT_PRINTED)) + if (binlog_warning_flags & + (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_ENGINE)) { + push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_BINLOG_UNSAFE_AND_STMT_ENGINE, + "%s Statement: %.*s", + ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE), + MYSQL_ERRMSG_SIZE, query_arg); + sql_print_warning("%s Statement: %.*s", + ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE), + MYSQL_ERRMSG_SIZE, query_arg); + binlog_warning_flags|= 1 << BINLOG_WARNING_FLAG_PRINTED; + } + else if (binlog_warning_flags & + (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_MODE)) + { + push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_BINLOG_UNSAFE_STATEMENT, + "%s Statement: %.*s", + ER(ER_BINLOG_UNSAFE_STATEMENT), + MYSQL_ERRMSG_SIZE, query_arg); sql_print_warning("%s Statement: %.*s", ER(ER_BINLOG_UNSAFE_STATEMENT), MYSQL_ERRMSG_SIZE, query_arg); - binlog_flags|= BINLOG_FLAG_UNSAFE_STMT_PRINTED; + binlog_warning_flags|= 1 << BINLOG_WARNING_FLAG_PRINTED; } } switch (qtype) { + /* + ROW_QUERY_TYPE means that the statement may be logged either in + row format or in statement format. If + current_stmt_binlog_row_based is set, it means that the + statement has already been logged in row format and hence shall + not be logged again. + */ case THD::ROW_QUERY_TYPE: DBUG_PRINT("debug", ("current_stmt_binlog_row_based: %d", - current_stmt_binlog_row_based)); - if (current_stmt_binlog_row_based) + is_current_stmt_binlog_format_row())); + if (is_current_stmt_binlog_format_row()) DBUG_RETURN(0); - /* Otherwise, we fall through */ - case THD::MYSQL_QUERY_TYPE: - /* - Using this query type is a conveniece hack, since we have been - moving back and forth between using RBR for replication of - system tables and not using it. + /* Fall through */ - Make sure to change in check_table_binlog_row_based() according - to how you treat this. + /* + STMT_QUERY_TYPE means that the query must be logged in statement + format; it cannot be logged in row format. This is typically + used by DDL statements. It is an error to use this query type + if current_stmt_binlog_row_based is set. */ case THD::STMT_QUERY_TYPE: /* The MYSQL_LOG::write() function will set the STMT_END_F flag and flush the pending rows event if necessary. - */ + */ { Query_log_event qinfo(this, query_arg, query_len, is_trans, suppress_use, errcode); diff --git a/sql/sql_class.h b/sql/sql_class.h index 36e696f2da6..5e069f1cbb6 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1254,6 +1254,7 @@ public: /* Used to execute base64 coded binlog events in MySQL server */ Relay_log_info* rli_fake; + void reset_for_next_command(); /* Constant for THD::where initialization in the beginning of every query. @@ -1421,23 +1422,44 @@ public: int binlog_flush_pending_rows_event(bool stmt_end); int binlog_remove_pending_rows_event(bool clear_maps); + int is_current_stmt_binlog_format_row() { + DBUG_ASSERT(current_stmt_binlog_format == BINLOG_FORMAT_STMT || + current_stmt_binlog_format == BINLOG_FORMAT_ROW); + return current_stmt_binlog_format == BINLOG_FORMAT_ROW; + } + private: + /* + Tells if current statement should binlog row-based(1) or stmt-based(0) + */ + enum_binlog_format current_stmt_binlog_format; + + enum enum_binlog_warning_flag { + /* ER_BINLOG_UNSAFE_AND_STMT_ENGINE affects current stmt */ + BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_ENGINE = 0, + /* ER_BINLOG_UNSAFE_AND_STMT_MODE affects current stmt */ + BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_MODE, + /* One of the warnings has already been printed */ + BINLOG_WARNING_FLAG_PRINTED, + /* number of elements of this enum; insert new members above */ + BINLOG_WARNING_FLAG_COUNT + }; + /** + Flags holding the status of binlog-related warnings for the + current statement. This is a binary combination of (1<lex->sql_command == SQLCOM_TRUNCATE || - (!thd->current_stmt_binlog_row_based && + (!thd->is_current_stmt_binlog_format_row() && !(table->triggers && table->triggers->has_delete_triggers())))) { /* Update the table->file->stats.records number */ @@ -452,19 +452,6 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds) DBUG_ENTER("mysql_prepare_delete"); List all_fields; - /* - Statement-based replication of DELETE ... LIMIT is not safe as order of - rows is not defined, so in mixed mode we go to row-based. - - Note that we may consider a statement as safe if ORDER BY primary_key - is present. However it may confuse users to see very similiar statements - replicated differently. - */ - if (thd->lex->current_select->select_limit) - { - thd->lex->set_stmt_unsafe(); - thd->set_current_stmt_binlog_row_based_if_mixed(); - } thd->lex->allow_sum_func= 0; if (setup_tables_and_check_access(thd, &thd->lex->select_lex.context, &thd->lex->select_lex.top_join_list, @@ -1023,7 +1010,7 @@ bool multi_delete::send_eof() static bool mysql_truncate_by_delete(THD *thd, TABLE_LIST *table_list) { - bool error, save_binlog_row_based= thd->current_stmt_binlog_row_based; + bool error, save_binlog_row_based= thd->is_current_stmt_binlog_format_row(); DBUG_ENTER("mysql_truncate_by_delete"); table_list->lock_type= TL_WRITE; mysql_init_select(thd->lex); @@ -1031,7 +1018,8 @@ static bool mysql_truncate_by_delete(THD *thd, TABLE_LIST *table_list) error= mysql_delete(thd, table_list, NULL, NULL, HA_POS_ERROR, LL(0), TRUE); ha_autocommit_or_rollback(thd, error); end_trans(thd, error ? ROLLBACK : COMMIT); - thd->current_stmt_binlog_row_based= save_binlog_row_based; + if (save_binlog_row_based) + thd->set_current_stmt_binlog_row_based(); DBUG_RETURN(error); } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 9de27868d74..2cfa6ae6f59 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1699,6 +1699,7 @@ public: table(0),tables_in_use(0),stacked_inserts(0), status(0), dead(0), group_count(0) { + DBUG_ENTER("Delayed_insert constructor"); thd.security_ctx->user=thd.security_ctx->priv_user=(char*) delayed_user; thd.security_ctx->host=(char*) my_localhost; thd.current_tablenr=0; @@ -1707,8 +1708,18 @@ public: thd.lex->current_select= 0; // for my_message_sql thd.lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock() /* - Statement-based replication of INSERT DELAYED has problems with RAND() - and user vars, so in mixed mode we go to row-based. + Statement-based replication of INSERT DELAYED has problems with + RAND() and user variables, so in mixed mode we go to row-based. + For normal commands, the unsafe flag is set at parse time. + However, since the flag is a member of the THD object, of which + the delayed_insert thread has its own copy, we must set the + statement to unsafe here and explicitly set row logging mode. + + @todo set_current_stmt_binlog_row_based_if_mixed should not be + called by anything else than thd->decide_logging_format(). When + we call set_current_blah here, none of the checks in + decide_logging_format is made. We should probably call + thd->decide_logging_format() directly instead. /Sven */ thd.lex->set_stmt_unsafe(); thd.set_current_stmt_binlog_row_based_if_mixed(); @@ -1726,6 +1737,7 @@ public: delayed_lock= global_system_variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : TL_WRITE; VOID(pthread_mutex_unlock(&LOCK_thread_count)); + DBUG_VOID_RETURN; } ~Delayed_insert() { @@ -2305,12 +2317,6 @@ pthread_handler_t handle_delayed_insert(void *arg) */ lex_start(thd); thd->lex->sql_command= SQLCOM_INSERT; // For innodb::store_lock() - /* - Statement-based replication of INSERT DELAYED has problems with RAND() - and user vars, so in mixed mode we go to row-based. - */ - thd->lex->set_stmt_unsafe(); - thd->set_current_stmt_binlog_row_based_if_mixed(); /* Open table */ if (!(di->table= open_n_lock_single_table(thd, &di->table_list, @@ -2756,7 +2762,7 @@ bool Delayed_insert::handle_inserts(void) TODO: Move the logging to last in the sequence of rows. */ - if (thd.current_stmt_binlog_row_based) + if (thd.is_current_stmt_binlog_format_row()) thd.binlog_flush_pending_rows_event(TRUE); if ((error=table->file->extra(HA_EXTRA_NO_CACHE))) @@ -2820,19 +2826,6 @@ bool mysql_insert_select_prepare(THD *thd) TABLE_LIST *first_select_leaf_table; DBUG_ENTER("mysql_insert_select_prepare"); - /* - Statement-based replication of INSERT ... SELECT ... LIMIT is not safe - as order of rows is not defined, so in mixed mode we go to row-based. - - Note that we may consider a statement as safe if ORDER BY primary_key - is present or we SELECT a constant. However it may confuse users to - see very similiar statements replicated differently. - */ - if (lex->current_select->select_limit) - { - lex->set_stmt_unsafe(); - thd->set_current_stmt_binlog_row_based_if_mixed(); - } /* SELECT_LEX do not belong to INSERT statement, so we can't add WHERE clause if table is VIEW @@ -3286,7 +3279,7 @@ void select_insert::abort() { thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, transactional_table, FALSE, errcode); } - if (!thd->current_stmt_binlog_row_based && !can_rollback_data()) + if (!thd->is_current_stmt_binlog_format_row() && !can_rollback_data()) thd->transaction.all.modified_non_trans_table= TRUE; if (changed) query_cache_invalidate3(thd, table, 1); @@ -3550,11 +3543,11 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) virtual int do_postlock(TABLE **tables, uint count) { THD *thd= const_cast(ptr->get_thd()); - if (int error= decide_logging_format(thd, &all_tables)) + if (int error= thd->decide_logging_format(&all_tables)) return error; TABLE const *const table = *tables; - if (thd->current_stmt_binlog_row_based && + if (thd->is_current_stmt_binlog_format_row() && !table->s->tmp_table && !ptr->get_create_info()->table_existed) { @@ -3578,7 +3571,7 @@ select_create::prepare(List &values, SELECT_LEX_UNIT *u) temporary table, we need to start a statement transaction. */ if ((thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) == 0 && - thd->current_stmt_binlog_row_based && + thd->is_current_stmt_binlog_format_row() && mysql_bin_log.is_open()) { thd->binlog_start_trans_and_stmt(); @@ -3660,7 +3653,7 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) schema that will do a close_thread_tables(), destroying the statement transaction cache. */ - DBUG_ASSERT(thd->current_stmt_binlog_row_based); + DBUG_ASSERT(thd->is_current_stmt_binlog_format_row()); DBUG_ASSERT(tables && *tables && count > 0); char buf[2048]; @@ -3700,7 +3693,7 @@ void select_create::send_error(uint errcode,const char *err) DBUG_PRINT("info", ("Current statement %s row-based", - thd->current_stmt_binlog_row_based ? "is" : "is NOT")); + thd->is_current_stmt_binlog_format_row() ? "is" : "is NOT")); DBUG_PRINT("info", ("Current table (at 0x%lu) %s a temporary (or non-existant) table", (ulong) table, diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 22b7d2e359c..9528d8f8f29 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1044,24 +1044,49 @@ public: } /** - Has the parser/scanner detected that this statement is unsafe? - */ + Has the parser/scanner detected that this statement is unsafe? + + @retval 0 if the statement is not marked as unsafe + @retval nonzero if the statement is marked as unsafe + */ inline bool is_stmt_unsafe() const { return binlog_stmt_flags & (1U << BINLOG_STMT_FLAG_UNSAFE); } + /** + Is this statement actually a row injection? + + @retval 0 if the statement is not a row injection + @retval nonzero if the statement is a row injection + */ + inline bool is_stmt_row_injection() const { + return binlog_stmt_flags & (1U << BINLOG_STMT_FLAG_ROW_INJECTION); + } + + /** + Flag the statement as a row injection. (A row injection is either + a BINLOG statement, or a row event in the relay log executed by + the slave SQL thread.) + */ + inline void set_stmt_row_injection() { + DBUG_ENTER("set_stmt_row_injection"); + binlog_stmt_flags|= (1U << BINLOG_STMT_FLAG_ROW_INJECTION); + DBUG_VOID_RETURN; + } /** Flag the current (top-level) statement as unsafe. - The flag will be reset after the statement has finished. - */ inline void set_stmt_unsafe() { + DBUG_ENTER("set_stmt_unsafe"); binlog_stmt_flags|= (1U << BINLOG_STMT_FLAG_UNSAFE); + DBUG_VOID_RETURN; } inline void clear_stmt_unsafe() { + DBUG_ENTER("clear_stmt_unsafe"); binlog_stmt_flags&= ~(1U << BINLOG_STMT_FLAG_UNSAFE); + DBUG_VOID_RETURN; } /** @@ -1072,16 +1097,37 @@ public: { return sroutines_list.elements != 0; } private: + /** + Flags indicating properties of the statement with respect to + logging. + + These are combined in a binary manner; e.g., an unsafe statement + has the bit (1<current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->binlog_flush_pending_rows_event(true); else { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 83f44bba008..0f89b5ab5eb 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -5625,6 +5625,12 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize) void mysql_reset_thd_for_next_command(THD *thd) { + thd->reset_for_next_command(); +} + +void THD::reset_for_next_command() +{ + THD *thd= this; DBUG_ENTER("mysql_reset_thd_for_next_command"); DBUG_ASSERT(!thd->spcont); /* not for substatements of routines */ DBUG_ASSERT(! thd->in_sub_stmt); @@ -5668,15 +5674,12 @@ void mysql_reset_thd_for_next_command(THD *thd) thd->rand_used= 0; thd->sent_row_count= thd->examined_row_count= 0; - /* - Because we come here only for start of top-statements, binlog format is - constant inside a complex statement (using stored functions) etc. - */ thd->reset_current_stmt_binlog_row_based(); + thd->binlog_warning_flags= 0; DBUG_PRINT("debug", ("current_stmt_binlog_row_based: %d", - thd->current_stmt_binlog_row_based)); + thd->is_current_stmt_binlog_format_row())); DBUG_VOID_RETURN; } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 06c6c022780..19df65bfd51 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1684,7 +1684,7 @@ int log_loaded_block(IO_CACHE* file) uchar* buffer= (uchar*) my_b_get_buffer_start(file); uint max_event_size= current_thd->variables.max_allowed_packet; lf_info= (LOAD_FILE_INFO*) file->arg; - if (lf_info->thd->current_stmt_binlog_row_based) + if (lf_info->thd->is_current_stmt_binlog_format_row()) DBUG_RETURN(0); if (lf_info->last_pos_in_file != HA_POS_ERROR && lf_info->last_pos_in_file >= my_b_get_pos_in_file(file)) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 0fc1d04a41b..9badd43173c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1804,7 +1804,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, LINT_INIT(alias); LINT_INIT(path_length); - if (thd->current_stmt_binlog_row_based && !dont_log_query) + if (thd->is_current_stmt_binlog_format_row() && !dont_log_query) { built_query.set_charset(system_charset_info); if (if_exists) @@ -1882,7 +1882,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, being built. The string always end in a comma and the comma will be chopped off before being written to the binary log. */ - if (thd->current_stmt_binlog_row_based && !dont_log_query) + if (thd->is_current_stmt_binlog_format_row() && !dont_log_query) { non_temp_tables_count++; /* @@ -2009,7 +2009,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, query_cache_invalidate3(thd, tables, 0); if (!dont_log_query) { - if (!thd->current_stmt_binlog_row_based || + if (!thd->is_current_stmt_binlog_format_row() || non_temp_tables_count > 0 && !tmp_table_deleted) { /* @@ -2021,7 +2021,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, */ write_bin_log(thd, !error, thd->query, thd->query_length); } - else if (thd->current_stmt_binlog_row_based && + else if (thd->is_current_stmt_binlog_format_row() && non_temp_tables_count > 0 && tmp_table_deleted) { @@ -3822,8 +3822,8 @@ bool mysql_create_table_no_lock(THD *thd, Otherwise, the statement shall be binlogged. */ if (!internal_tmp_table && - (!thd->current_stmt_binlog_row_based || - (thd->current_stmt_binlog_row_based && + (!thd->is_current_stmt_binlog_format_row() || + (thd->is_current_stmt_binlog_format_row() && !(create_info->options & HA_LEX_CREATE_TMP_TABLE)))) write_bin_log(thd, TRUE, thd->query, thd->query_length); error= FALSE; @@ -5236,7 +5236,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table, /* We have to write the query before we unlock the tables. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) { /* Since temporary tables are not replicated under row-based @@ -7143,7 +7143,7 @@ view_err: if (rename_temporary_table(thd, new_table, new_db, new_name)) goto err1; /* We don't replicate alter table statement on temporary tables */ - if (!thd->current_stmt_binlog_row_based) + if (!thd->is_current_stmt_binlog_format_row()) write_bin_log(thd, TRUE, thd->query, thd->query_length); goto end_temporary; } @@ -7305,7 +7305,7 @@ view_err: db, table_name); DBUG_ASSERT(!(mysql_bin_log.is_open() && - thd->current_stmt_binlog_row_based && + thd->is_current_stmt_binlog_format_row() && (create_info->options & HA_LEX_CREATE_TMP_TABLE))); write_bin_log(thd, TRUE, thd->query, thd->query_length); diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index c60dac42fb8..a49e0df7124 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -437,7 +437,7 @@ int mysql_create_function(THD *thd,udf_func *udf) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for CREATE FUNCTION command. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->clear_current_stmt_binlog_row_based(); rw_wrlock(&THR_LOCK_udf); @@ -540,7 +540,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) Turn off row binlogging of this statement and use statement-based so that all supporting tables are updated for DROP FUNCTION command. */ - if (thd->current_stmt_binlog_row_based) + if (thd->is_current_stmt_binlog_format_row()) thd->clear_current_stmt_binlog_row_based(); rw_wrlock(&THR_LOCK_udf); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index ab6ba2ba756..638b15df414 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -871,19 +871,6 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, SELECT_LEX *select_lex= &thd->lex->select_lex; DBUG_ENTER("mysql_prepare_update"); - /* - Statement-based replication of UPDATE ... LIMIT is not safe as order of - rows is not defined, so in mixed mode we go to row-based. - - Note that we may consider a statement as safe if ORDER BY primary_key - is present. However it may confuse users to see very similiar statements - replicated differently. - */ - if (thd->lex->current_select->select_limit) - { - thd->lex->set_stmt_unsafe(); - thd->set_current_stmt_binlog_row_based_if_mixed(); - } #ifndef NO_EMBEDDED_ACCESS_CHECKS table_list->grant.want_privilege= table->grant.want_privilege= (SELECT_ACL & ~table->grant.privilege); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c40062e5d52..dfb5e9d5fcb 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -8939,7 +8939,7 @@ opt_limit_clause: ; limit_clause: - LIMIT limit_options {} + LIMIT limit_options { Lex->set_stmt_unsafe(); } ; limit_options: @@ -9001,6 +9001,7 @@ delete_limit_clause: { SELECT_LEX *sel= Select; sel->select_limit= $2; + Lex->set_stmt_unsafe(); sel->explicit_limit= 1; } ; @@ -9454,13 +9455,21 @@ insert_lock_option: #endif } | LOW_PRIORITY { $$= TL_WRITE_LOW_PRIORITY; } - | DELAYED_SYM { $$= TL_WRITE_DELAYED; } + | DELAYED_SYM + { + $$= TL_WRITE_DELAYED; + Lex->set_stmt_unsafe(); + } | HIGH_PRIORITY { $$= TL_WRITE; } ; replace_lock_option: opt_low_priority { $$= $1; } - | DELAYED_SYM { $$= TL_WRITE_DELAYED; } + | DELAYED_SYM + { + $$= TL_WRITE_DELAYED; + Lex->set_stmt_unsafe(); + } ; insert2: diff --git a/storage/example/ha_example.cc b/storage/example/ha_example.cc index 604722c3c8c..2c7512afda5 100644 --- a/storage/example/ha_example.cc +++ b/storage/example/ha_example.cc @@ -355,7 +355,13 @@ int ha_example::close(void) int ha_example::write_row(uchar *buf) { DBUG_ENTER("ha_example::write_row"); - DBUG_RETURN(HA_ERR_WRONG_COMMAND); + /* + Example of a successful write_row. We don't store the data + anywhere; they are thrown away. A real implementation will + probably need to do something with 'buf'. We report a success + here, to pretend that the insert was successful. + */ + DBUG_RETURN(0); } diff --git a/storage/example/ha_example.h b/storage/example/ha_example.h index ec3987ced5d..e565bd5ffba 100644 --- a/storage/example/ha_example.h +++ b/storage/example/ha_example.h @@ -83,11 +83,11 @@ public: ulonglong table_flags() const { /* - We are saying that this engine is just row capable to have an - engine that can only handle row-based logging. This is used in - testing. + We are saying that this engine is just statement capable to have + an engine that can only handle statement-based logging. This is + used in testing. */ - return HA_BINLOG_ROW_CAPABLE; + return HA_BINLOG_STMT_CAPABLE; } /** @brief diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 56e28cf5f14..67c24456d1c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6838,21 +6838,21 @@ ha_innobase::external_lock( /* Statement based binlogging does not work in isolation level READ UNCOMMITTED and READ COMMITTED since the necessary locks cannot be taken. In this case, we print an - informative error message and return with an error. */ - if (lock_type == F_WRLCK) - { - ulong const binlog_format= thd_binlog_format(thd); - ulong const tx_isolation = thd_tx_isolation(current_thd); - if (tx_isolation <= ISO_READ_COMMITTED && - binlog_format == BINLOG_FORMAT_STMT) - { - char buf[256]; - my_snprintf(buf, sizeof(buf), - "Transaction level '%s' in" - " InnoDB is not safe for binlog mode '%s'", - tx_isolation_names[tx_isolation], - binlog_format_names[binlog_format]); - my_error(ER_BINLOG_LOGGING_IMPOSSIBLE, MYF(0), buf); + informative error message and return with an error. + Note: decide_logging_format would give the same error message, + except it cannot give the extra details. + */ + if (lock_type == F_WRLCK && + !(table_flags() & HA_BINLOG_STMT_CAPABLE) && + thd_binlog_format(thd) == BINLOG_FORMAT_STMT) { + int skip = 0; + /* used by test case */ + DBUG_EXECUTE_IF("no_innodb_binlog_errors", skip = 1;); + if (!skip) { + my_error(ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, MYF(0), + " InnoDB is limited to row-logging when " + "transaction isolation level is " + "READ COMMITTED or READ UNCOMMITTED."); DBUG_RETURN(HA_ERR_LOGGING_IMPOSSIBLE); } } From 8949aaee72d07864474c76f8b59e55ea2b348d5a Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 15 Jul 2009 18:41:02 +0200 Subject: [PATCH 02/69] post-push fixes for BUG#39934: updating test cases mysql-test/r/partition_innodb_stmt.result: Error message changed. mysql-test/r/sp_trans.result: Error message changed. mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result: Error message changed. mysql-test/suite/binlog/t/binlog_unsafe.test: Test now uses udf's, so needs to source include/have_udf.inc mysql-test/suite/parts/r/rpl_partition.result: updated result file mysql-test/suite/parts/t/rpl_partition.test: We no longer allow a slave that has binlog_format=statement to execute row events. Hence we force the slave to have binlog_format=row. mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test: The test uses the example plugin, hence it must source include/have_example_plugin.inc. --- mysql-test/r/partition_innodb_stmt.result | 2 +- mysql-test/r/sp_trans.result | 11 +++++++++- .../binlog/r/binlog_stm_unsafe_warning.result | 4 ++-- mysql-test/suite/binlog/t/binlog_unsafe.test | 1 + mysql-test/suite/parts/r/rpl_partition.result | 14 +++++++++++++ mysql-test/suite/parts/t/rpl_partition.test | 20 ++++++++++++++++--- .../t/rpl_ndb_binlog_format_errors.test | 3 +++ 7 files changed, 48 insertions(+), 7 deletions(-) diff --git a/mysql-test/r/partition_innodb_stmt.result b/mysql-test/r/partition_innodb_stmt.result index 2735b0d2193..67c33cf7732 100644 --- a/mysql-test/r/partition_innodb_stmt.result +++ b/mysql-test/r/partition_innodb_stmt.result @@ -42,7 +42,7 @@ id SET TRANSACTION ISOLATION LEVEL READ COMMITTED; BEGIN; INSERT INTO t1 VALUES(9); -ERROR HY000: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT' +ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. COMMIT; COMMIT; DROP TABLE t1; diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 8ce6d696bcc..07cf66869a8 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -507,7 +507,16 @@ until table_size > max_table_size*2 end repeat; end| call bug14210_fill_table()| Warnings: -Note 1592 Unsafe statement binlogged as statement since BINLOG_FORMAT is STATEMENT. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: delete from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 (a) values (repeat('a', 255)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 drop procedure bug14210_fill_table| create table t4 like t3| create procedure bug14210() diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index 439bff0cfe1..f6c8d6421bc 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -4,10 +4,10 @@ CREATE TABLE t1 (a int, b int, primary key (a)); INSERT INTO t1 VALUES (1,2), (2,3); UPDATE t1 SET b='4' WHERE a=1 LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET b='4' WHERE a=1 LIMIT 1 UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1 DROP TABLE t1; ### NOT filtered database => assertion: binlog disabled and warnings ARE NOT shown SET SQL_LOG_BIN= 0; diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index 2bf2f477166..caf172e4a0e 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -92,6 +92,7 @@ # related to logging format (not just 'Unsafe statement binlogged in # statement mode since BINLOG_FORMAT = STATEMENT'). +source include/have_udf.inc; source include/have_log_bin.inc; source include/have_binlog_format_statement.inc; diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result index c2537815631..5656ddbf847 100644 --- a/mysql-test/suite/parts/r/rpl_partition.result +++ b/mysql-test/suite/parts/r/rpl_partition.result @@ -11,6 +11,17 @@ SET SESSION binlog_format = 'ROW'; select @@global.binlog_format, @@session.binlog_format; @@global.binlog_format ROW @@session.binlog_format ROW +[on slave] +set @old_global_binlog_format= @@global.binlog_format; +set @old_session_binlog_format= @@session.binlog_format; +SET GLOBAL binlog_format = 'ROW'; +SET SESSION binlog_format = 'ROW'; +select @@global.binlog_format, @@session.binlog_format; +@@global.binlog_format ROW +@@session.binlog_format ROW +include/stop_slave.inc +include/start_slave.inc +[on master] DROP TABLE IF EXISTS t1, t2, t3; DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; @@ -189,3 +200,6 @@ DROP TABLE t1, t2, t3; DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; DROP PROCEDURE IF EXISTS p3; +[on slave] +set @@global.binlog_format= @old_global_binlog_format; +set @@session.binlog_format= @old_session_binlog_format; diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test index c5ee20971b3..6a5a17ad5af 100644 --- a/mysql-test/suite/parts/t/rpl_partition.test +++ b/mysql-test/suite/parts/t/rpl_partition.test @@ -11,6 +11,19 @@ set @old_session_binlog_format= @@session.binlog_format; SET GLOBAL binlog_format = 'ROW'; SET SESSION binlog_format = 'ROW'; select @@global.binlog_format, @@session.binlog_format; +--echo [on slave] +connection slave; +set @old_global_binlog_format= @@global.binlog_format; +set @old_session_binlog_format= @@session.binlog_format; +SET GLOBAL binlog_format = 'ROW'; +SET SESSION binlog_format = 'ROW'; +select @@global.binlog_format, @@session.binlog_format; +# restart slave so that slave sql thread's binlog format is re-read +# from @@global.binlog_format +--source include/stop_slave.inc +--source include/start_slave.inc +--echo [on master] +connection master; --disable_warnings DROP TABLE IF EXISTS t1, t2, t3; @@ -158,8 +171,9 @@ DROP TABLE t1, t2, t3; DROP PROCEDURE IF EXISTS p1; DROP PROCEDURE IF EXISTS p2; DROP PROCEDURE IF EXISTS p3; -save_master_pos; -connection slave; -sync_with_master; +--echo [on slave] +sync_slave_with_master; +set @@global.binlog_format= @old_global_binlog_format; +set @@session.binlog_format= @old_session_binlog_format; # End of 5.1 tests diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test index 1b157192b4f..18a6aac8c5d 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -20,7 +20,10 @@ # given for the case when an unsafe statement is executed and # binlog_format = STATEMENT. +# Need debug so that 'SET @@session.debug' works. --source include/have_debug.inc +# Need example plugin because it is the only statement-only engine. +--source include/have_example_plugin.inc # The test changes binlog_format, so there is no reason to run it # under more than one binlog format. --source include/have_binlog_format_row.inc From 6f8f024aaf9a86e2bf12bc4a96bd5f9f4b2a7ac5 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 15 Jul 2009 19:17:55 +0200 Subject: [PATCH 03/69] post-push fixes for BUG#39934: make mysqldump.test pass even with binlog_format = MIXED or ROW. mysql-test/r/mysqldump.result: Remove warning from result file. mysql-test/t/mysqldump.test: The test gives a warning if binlog_format=STATEMENT due to BUG#45832. To make the result file not depend on binlog_format, we disable warnings. --- mysql-test/r/mysqldump.result | 2 -- mysql-test/t/mysqldump.test | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index 206bd919818..2f8e0ce5ec1 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -2239,8 +2239,6 @@ create view v1 as select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; -Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index ec96124e14b..8178c9e1869 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -875,8 +875,13 @@ select * from t1; create view v1 as select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); +# Disable warnings since LIMIT warning for unsafe statement if +# binlog_format = STATEMENT. Note: after BUG#45832, the warning should +# not be issued. +--disable_warnings create view v2 as select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; +--enable_warnings --exec $MYSQL_DUMP --skip-comments test From f404c96e82cbd1fb5ca73026dd8ef1b1ba6801bc Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 22 Jul 2009 18:16:17 +0200 Subject: [PATCH 04/69] BUG#39934: Slave stops for engine that only support row-based logging This is a post-push fix addressing review requests and problems with extra warnings. Problem 1: The sub-statement where an unsafe warning was detected was printed as part of the warning. This was ok for statements that were unsafe due to, e.g., calls to UUID(), but did not make sense for statements that were unsafe because there was more than one autoincrement column (unsafeness in this case comes from the combination of several sub-statements). Fix 1: Instead of printing the sub-statement, print an explanation of why the statement is unsafe. Problem 2: When a recursive construct (i.e., stored proceure, stored function, trigger, view, prepared statement) contained several sub-statements, and at least one of them was unsafe, there would be one unsafeness warning per sub-statement - even for safe sub-statements. Fix 2: Ensure that each type of warning is printed at most once, by remembering throughout the execution of the statement which types of warnings have been printed. mysql-test/extra/rpl_tests/create_recursive_construct.inc: - Clarified comment per review request. - Added checks for the number of warnings in each invocation. mysql-test/extra/rpl_tests/rpl_insert_delayed.test: Per review request, replaced @@session.binlog_format by @@global.binlog_format, since INSERT DELAYED reads the global variable. (In this test case, the two variables have the same value, so the change is cosmetic.) mysql-test/r/sp_trans.result: updated result file mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result: updated result file mysql-test/suite/binlog/r/binlog_stm_ps.result: updated result file mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result: updated result file mysql-test/suite/binlog/r/binlog_unsafe.result: Updated result file. Note that duplicate warnings are now gone. mysql-test/suite/binlog/t/binlog_unsafe.test: - Added tests for: (1) a statement that is unsafe in many ways; (2) a statement that is unsafe in the same way several times. - Use -- style to invoke mysqltest commands. mysql-test/suite/rpl/r/rpl_stm_found_rows.result: updated result file mysql-test/suite/rpl/r/rpl_stm_loadfile.result: updated result file mysql-test/suite/rpl/t/rpl_mix_found_rows.test: Per review request, added comment explaining what the test case does (copied from rpl_stm_found_rows.test) mysql-test/suite/rpl/t/rpl_stm_found_rows.test: Clarified grammar in comment. mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result: Updated result file. sql/item_create.cc: Made set_stmt_unsafe take one parameter, describing the type of unsafeness. sql/sp_head.cc: Added unsafe_flags field and made it hold all the unsafe flags. sql/sp_head.h: - Removed the BINLOG_ROW_BASED_IF_MIXED flag from m_flags. Instead, we use the new unsafe_flags field to hold the unsafeness state of the sp. - Made propagate_attributes() copy all unsafe flags. sql/sql_base.cc: - Made LEX::set_stmt_unsafe() take an extra argument. - Made binlog_unsafe_warning_flags store the type of unsafeness. - Per review requests, clarified comments - Added DBUG printouts sql/sql_class.cc: - Made warnings be generated in issue_warnings() and call that from binlog_query(). Wrote issue_warnings(), which prints zero or more warnings, avoiding to print warnings more than once per statement. - Per review request, added @todo so that we remember to assert correct behavior in binlog_query. sql/sql_class.h: - Removed BINLOG_WARNING_PRINTED - Use [set|clear]_current_stmt_binlog_row_based() instead of modifying the flag directly. - added issue_unsafe_warnings() (only called from binlog_unsafe) - Per review request, improved some documentation. sql/sql_insert.cc: Added extra argument to LEX::set_stmt_unsafe() sql/sql_lex.h: - Added enum_binlog_stmt_unsafe, listing all types of unsafe statements. - Per review requests, improved many comments for member functions. - Added [get|set]_stmt_unsafe_flags(), which return/set all the unsafe flags for a statement. sql/sql_parse.cc: - Renamed binlog_warning_flags to binlog_unsafe_warning_flags. - Per review requests, improved comment. sql/sql_view.cc: Made views propagate all the new unsafe flags. sql/sql_yacc.yy: Added parameter to set_stmt_unsafe(). storage/innobase/handler/ha_innodb.cc: Per review requests, replaced DBUG_EXECUTE_IF() by DBUG_EVALUATE_IF(). --- .../rpl_tests/create_recursive_construct.inc | 56 +- .../extra/rpl_tests/rpl_insert_delayed.test | 16 +- mysql-test/r/sp_trans.result | 11 +- .../r/binlog_statement_insert_delayed.result | 4 +- .../suite/binlog/r/binlog_stm_ps.result | 2 +- .../binlog/r/binlog_stm_unsafe_warning.result | 8 +- .../suite/binlog/r/binlog_unsafe.result | 1699 ++++++++++------- mysql-test/suite/binlog/t/binlog_unsafe.test | 253 ++- .../suite/rpl/r/rpl_stm_found_rows.result | 4 +- .../suite/rpl/r/rpl_stm_loadfile.result | 5 +- .../suite/rpl/t/rpl_mix_found_rows.test | 8 + .../suite/rpl/t/rpl_stm_found_rows.test | 8 +- .../r/rpl_ndb_binlog_format_errors.result | 4 +- sql/item_create.cc | 12 +- sql/sp_head.cc | 13 +- sql/sp_head.h | 22 +- sql/sql_base.cc | 59 +- sql/sql_class.cc | 123 +- sql/sql_class.h | 100 +- sql/sql_insert.cc | 2 +- sql/sql_lex.h | 184 +- sql/sql_parse.cc | 21 +- sql/sql_view.cc | 4 +- sql/sql_yacc.yy | 17 +- storage/innobase/handler/ha_innodb.cc | 7 +- 25 files changed, 1674 insertions(+), 968 deletions(-) diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc index 66c82de8b99..4e16853f559 100644 --- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -15,12 +15,15 @@ # - With SQL_LOG_BIN = 1 and binlog_format = MIXED, to verify that it # writes row events to the binlog. # -# - If the recursive construct can be invoked so that it has no -# side-effects but it returns a value that may be nondeterministic, -# then it is invoked in such a way that the return value is -# discarded, with SQL_LOG_BIN = 1 and binlog_format = STATEMENT. -# In this case, no warning should be given and nothing should be -# written to the binlog. +# - In some cases, the recursive construct can be invoked so that it +# has no side-effects but returns a value that may be +# nondeterministic. An example is a function that returns UUID(). +# The function does not have side effects but its a return value +# that may differ on slave. Such statements are invoked so that +# the return value is discarded (e.g., SELECT func()), with +# SQL_LOG_BIN = 1 and binlog_format = STATEMENT. In this case, no +# warning should be given and nothing should be written to the +# binlog. # # This is an auxiliary file particularly targeted to being used by the # test binlog_unsafe. In this context, the purpose is to check how @@ -289,8 +292,15 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { --eval $CRC_create } - --echo * binlog_format = STATEMENT: expect warning. + --echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings. --eval $CRC_RET_stmt_sidef + --let $n_warnings= `SHOW COUNT(*) WARNINGS` + if (`SELECT '$n_warnings' != '$CRC_ARG_expected_number_of_warnings'`) { + --echo Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. + SHOW WARNINGS; + SHOW BINLOG EVENTS; + --exit + } # These queries are run without query log, to make result file more # readable. Debug info is only printed if something abnormal @@ -301,19 +311,33 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { SET SQL_LOG_BIN = 0; RESET MASTER; --eval $CRC_RET_stmt_sidef + --let $n_warnings= `SHOW COUNT(*) WARNINGS` + if (`SELECT '$n_warnings' != '0'`) { + --echo Failure! Expected 0 warnings, got $n_warnings warnings. + SHOW WARNINGS; + SHOW BINLOG EVENTS; + --exit + } --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2) if (`SELECT '$binlog_event' != 'No such row'`) { --enable_query_log --echo Failure! Something was written to the binlog despite SQL_LOG_BIN=0: SHOW BINLOG EVENTS; - --die + --exit } SET SQL_LOG_BIN = 1; --echo * binlog_format = MIXED: expect row events in binlog and no warning. SET binlog_format = MIXED; RESET MASTER; - --eval $CRC_RET_stmt_sidef + --eval $CRC_RET_stmt_sidef + --let $n_warnings= `SHOW COUNT(*) WARNINGS` + if (`SELECT '$n_warnings' != '0'`) { + --echo Failure! Expected 0 warnings, got $n_warnings warnings. + SHOW WARNINGS; + SHOW BINLOG EVENTS; + --exit + } # The first event is format_description, the second is # Query_event('BEGIN'), and the third should be our Table_map. --let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 3) @@ -328,7 +352,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { # we should instead execute: #--enable_query_log #SHOW BINLOG EVENTS; - #--die + #--exit # Here, we should really source # include/show_binlog_events.inc. But due to BUG#41913, that @@ -352,6 +376,18 @@ if (`SELECT '$CRC_RET_sel_retval' != ''`) { --disable_result_log --eval $CRC_RET_sel_retval --enable_result_log + + # Currently, due to a bug, we do get warnings here, so we don't + # fail. When the bug is fixed, we should execute the following. + + #--let $n_warnings= `SHOW COUNT(*) WARNINGS` + #if (`SELECT '$n_warnings' != '0'`) { + # --enable_query_log + # --echo Failure! Expected 0 warnings, got $n_warnings warnings. + # SHOW WARNINGS; + # SHOW BINLOG EVENTS; + # --exit + #} } #--echo debug: <<< max_table_size*2 end repeat; end| call bug14210_fill_table()| Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: delete from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 (a) values (repeat('a', 255)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t3 select a from t3 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. drop procedure bug14210_fill_table| create table t4 like t3| create procedure bug14210() diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index f4c9e4091b9..2968dcffa20 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -13,10 +13,10 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert delayed into t1 values (null),(null),(null),(null) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. insert delayed into t1 values (null),(null),(400),(null); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert delayed into t1 values (null),(null),(400),(null) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. select * from t1; a 207 diff --git a/mysql-test/suite/binlog/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result index 97daba735b2..b01ef8929d9 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ps.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result @@ -11,7 +11,7 @@ prepare s from "insert into t1 select 100 limit ?"; set @a=100; execute s using @a; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: insert into t1 select 100 limit 100 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int) diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index f6c8d6421bc..463da7b2bdf 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -4,10 +4,10 @@ CREATE TABLE t1 (a int, b int, primary key (a)); INSERT INTO t1 VALUES (1,2), (2,3); UPDATE t1 SET b='4' WHERE a=1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET b='4' WHERE a=1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1; ### NOT filtered database => assertion: binlog disabled and warnings ARE NOT shown SET SQL_LOG_BIN= 0; @@ -25,6 +25,10 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a int, b int, primary key (a)); INSERT INTO t1 VALUES (1,2), (2,3); UPDATE t1 SET b='4' WHERE a=1 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1; DROP DATABASE b42851; diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 685a0f9ef57..0243693c120 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -1,32 +1,41 @@ #### Setup tables #### -CREATE TABLE t0 (a CHAR(40)); -CREATE TABLE t1 (a CHAR(40)); -CREATE TABLE t2 (a CHAR(40)); -CREATE TABLE t3 (a CHAR(40)); -CREATE TABLE ta1 (a CHAR(40)); -CREATE TABLE ta2 (a CHAR(40)); -CREATE TABLE ta3 (a CHAR(40)); +CREATE TABLE t0 (a CHAR(100)); +CREATE TABLE t1 (a CHAR(100)); +CREATE TABLE t2 (a CHAR(100)); +CREATE TABLE t3 (a CHAR(100)); +CREATE TABLE ta0 (a CHAR(100)); +CREATE TABLE ta1 (a CHAR(100)); +CREATE TABLE ta2 (a CHAR(100)); +CREATE TABLE ta3 (a CHAR(100)); CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); -CREATE TABLE double_autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); -CREATE TRIGGER double_autoinc_trig BEFORE INSERT ON double_autoinc_table FOR EACH ROW BEGIN -INSERT INTO autoinc_table VALUES (NULL); -END| -CREATE TABLE data_table (a CHAR(40)); +CREATE TABLE data_table (a CHAR(100)); INSERT INTO data_table VALUES ('foo'); CREATE TABLE trigger_table_1 (a INT); CREATE TABLE trigger_table_2 (a INT); CREATE TABLE trigger_table_3 (a INT); +CREATE TABLE double_autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); +CREATE TRIGGER double_autoinc_trig +BEFORE INSERT ON double_autoinc_table FOR EACH ROW +BEGIN +INSERT INTO autoinc_table VALUES (NULL); +END| +CREATE FUNCTION multi_unsafe_func() RETURNS INT +BEGIN +INSERT INTO t0 VALUES(CONCAT(@@hostname, @@hostname)); +INSERT INTO t0 VALUES(0); +INSERT INTO t0 VALUES(CONCAT(UUID(), @@hostname)); +RETURN 1; +END| CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB"; ==== Testing UUID() unsafeness ==== Invoking function func_retval_1 returning value from unsafe UUID() function. CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN UUID(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -34,12 +43,10 @@ SELECT func_retval_1(); Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function. CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 VALUES (func_retval_2()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -48,24 +55,20 @@ DROP FUNCTION func_retval_2; Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe UUID() function. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe UUID() function. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -82,13 +85,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe UUID() function. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -96,12 +96,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function. CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT func_retval_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -110,11 +109,10 @@ DROP VIEW view_retval_2; Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe UUID() function. PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -122,37 +120,29 @@ DROP FUNCTION func_retval_1; Invoking function func_sidef_1 invoking unsafe UUID() function. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (UUID()); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe UUID() function. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -171,14 +161,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe UUID() function. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -186,25 +172,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe UUID() function. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -212,34 +194,29 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe UUID() function. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (UUID()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe UUID() function. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe UUID() function. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -258,24 +235,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe UUID() function. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe UUID() function. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -283,37 +256,29 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe UUID() function. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (UUID()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe UUID() function. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe UUID() function. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -332,26 +297,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe UUID() function. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe UUID() function. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -360,11 +319,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe UUID() function. CREATE VIEW view_retval_1 AS SELECT UUID(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_1` AS SELECT UUID() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -372,22 +331,20 @@ SELECT * FROM view_retval_1; Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe UUID() function. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe UUID() function. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -402,12 +359,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe UUID() function. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -415,11 +370,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe UUID() function. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT * FROM view_retval_1 -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -428,10 +383,10 @@ DROP VIEW view_retval_2; Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe UUID() function. PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -439,19 +394,19 @@ DROP VIEW view_retval_1; Invoking prepared statement prep_1 invoking unsafe UUID() function. PREPARE prep_1 FROM "INSERT INTO t0 VALUES (UUID())"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe UUID() function. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 VALUES (UUID()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -461,11 +416,10 @@ SELECT UUID(); Invoking function func_retval_1 returning value from unsafe @@hostname variable. CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN @@hostname; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -473,12 +427,10 @@ SELECT func_retval_1(); Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable. CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 VALUES (func_retval_2()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -487,24 +439,20 @@ DROP FUNCTION func_retval_2; Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -521,13 +469,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -535,12 +480,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable. CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT func_retval_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -549,11 +493,10 @@ DROP VIEW view_retval_2; Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe @@hostname variable. PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -561,37 +504,29 @@ DROP FUNCTION func_retval_1; Invoking function func_sidef_1 invoking unsafe @@hostname variable. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (@@hostname); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -610,14 +545,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -625,25 +556,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -651,34 +578,29 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe @@hostname variable. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (@@hostname); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe @@hostname variable. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe @@hostname variable. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -697,24 +619,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe @@hostname variable. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe @@hostname variable. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -722,37 +640,29 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe @@hostname variable. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (@@hostname); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe @@hostname variable. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe @@hostname variable. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -771,26 +681,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe @@hostname variable. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe @@hostname variable. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -798,19 +702,19 @@ DROP TRIGGER trig_1; Invoking prepared statement prep_1 invoking unsafe @@hostname variable. PREPARE prep_1 FROM "INSERT INTO t0 VALUES (@@hostname)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe @@hostname variable. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 VALUES (@@hostname); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (@@hostname) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -818,37 +722,29 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT * FROM data_table LIMIT 1; RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -867,14 +763,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -882,25 +774,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -908,34 +796,29 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT * FROM data_table LIMIT 1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -954,24 +837,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe SELECT...LIMIT statement. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -979,37 +858,29 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT * FROM data_table LIMIT 1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1028,26 +899,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe SELECT...LIMIT statement. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1056,11 +921,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE VIEW view_retval_1 AS SELECT * FROM data_table LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_1` AS SELECT * FROM data_table LIMIT 1 -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1068,22 +933,20 @@ SELECT * FROM view_retval_1; Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1098,12 +961,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1111,11 +972,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT * FROM view_retval_1 -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1124,10 +985,10 @@ DROP VIEW view_retval_2; Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1135,19 +996,19 @@ DROP VIEW view_retval_1; Invoking prepared statement prep_1 invoking unsafe SELECT...LIMIT statement. PREPARE prep_1 FROM "INSERT INTO t0 SELECT * FROM data_table LIMIT 1"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe SELECT...LIMIT statement. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 SELECT * FROM data_table LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT * FROM data_table LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1157,37 +1018,29 @@ SELECT * FROM data_table LIMIT 1; Invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO t0 VALUES (1), (2); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1206,14 +1059,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1221,25 +1070,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1247,34 +1092,29 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO t0 VALUES (1), (2); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1293,24 +1133,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe INSERT DELAYED statement. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1318,37 +1154,29 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO t0 VALUES (1), (2); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1367,26 +1195,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe INSERT DELAYED statement. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1394,19 +1216,19 @@ DROP TRIGGER trig_1; Invoking prepared statement prep_1 invoking unsafe INSERT DELAYED statement. PREPARE prep_1 FROM "INSERT DELAYED INTO t0 VALUES (1), (2)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe INSERT DELAYED statement. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT DELAYED INTO t0 VALUES (1), (2); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT DELAYED INTO t0 VALUES (1), (2) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1414,14 +1236,14 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Invoking function func_sidef_1 invoking unsafe update of two autoinc columns. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO t1 SELECT func_sidef_1(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO t2 SELECT func_sidef_2(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1429,7 +1251,7 @@ DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. CALL proc_2(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1451,7 +1273,7 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO trigger_table_2 VALUES (1); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1459,7 +1281,7 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1467,7 +1289,7 @@ DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. EXECUTE prep_2; * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1476,7 +1298,7 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe update of two autoinc columns. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. CALL proc_1(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1493,7 +1315,7 @@ master-bin.000001 # Query # # COMMIT Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO t2 SELECT func_sidef_2(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1501,7 +1323,7 @@ DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. CALL proc_2(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1520,7 +1342,7 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO trigger_table_2 VALUES (1); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1528,7 +1350,7 @@ DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. EXECUTE prep_2; * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1547,14 +1369,14 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe update of two autoinc columns. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO trigger_table_1 VALUES (1); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO t2 SELECT func_sidef_2(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1562,7 +1384,7 @@ DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. CALL proc_2(); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1584,7 +1406,7 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO trigger_table_2 VALUES (1); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1592,7 +1414,7 @@ DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. EXECUTE prep_2; * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1601,14 +1423,14 @@ DROP TRIGGER trig_1; Invoking prepared statement prep_1 invoking unsafe update of two autoinc columns. PREPARE prep_1 FROM "INSERT INTO double_autoinc_table VALUES (NULL)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. EXECUTE prep_1; * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe update of two autoinc columns. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 0 warnings. INSERT INTO double_autoinc_table VALUES (NULL); * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1617,11 +1439,10 @@ INSERT INTO double_autoinc_table VALUES (NULL); Invoking function func_retval_1 returning value from unsafe UDF. CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN myfunc_int(10); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1629,12 +1450,10 @@ SELECT func_retval_1(); Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 VALUES (func_retval_2()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1643,24 +1462,20 @@ DROP FUNCTION func_retval_2; Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe UDF. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe UDF. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1677,13 +1492,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe UDF. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1691,12 +1503,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT func_retval_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1705,11 +1516,10 @@ DROP VIEW view_retval_2; Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe UDF. PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (func_retval_1()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1717,37 +1527,29 @@ DROP FUNCTION func_retval_1; Invoking function func_sidef_1 invoking unsafe UDF. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe UDF. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1766,14 +1568,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe UDF. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1781,25 +1579,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe UDF. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1807,34 +1601,29 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe UDF. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe UDF. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe UDF. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1853,24 +1642,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe UDF. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe UDF. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1878,37 +1663,29 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe UDF. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe UDF. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe UDF. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1927,26 +1704,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe UDF. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe UDF. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1955,32 +1726,30 @@ DROP TRIGGER trig_1; Invoking view view_sidef_1 invoking unsafe UDF. CREATE VIEW view_sidef_1 AS SELECT myfunc_int(10); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_1` AS SELECT myfunc_int(10) -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_sidef_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking view view_sidef_1 invoking unsafe UDF. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1995,12 +1764,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking view view_sidef_1 invoking unsafe UDF. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2008,21 +1775,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT * FROM view_sidef_1 -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking view view_sidef_1 invoking unsafe UDF. PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_sidef_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2030,19 +1797,19 @@ DROP VIEW view_sidef_1; Invoking prepared statement prep_1 invoking unsafe UDF. PREPARE prep_1 FROM "INSERT INTO t0 VALUES (myfunc_int(10))"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe UDF. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 VALUES (myfunc_int(10)); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 VALUES (myfunc_int(10)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2050,37 +1817,29 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2099,14 +1858,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2114,25 +1869,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_sidef_2` AS SELECT func_sidef_1() -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_sidef_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT func_sidef_1() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2140,10 +1891,10 @@ DROP FUNCTION func_sidef_1; Invoking procedure proc_1 invoking unsafe use of mysql.general_log. CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2157,23 +1908,20 @@ master-bin.000001 # Query # # COMMIT Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2189,23 +1937,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. PREPARE prep_2 FROM "CALL proc_1()"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2221,37 +1966,29 @@ DROP PROCEDURE proc_1; Invoking trigger trig_1 invoking unsafe use of mysql.general_log. CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2270,26 +2007,20 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta1 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_1 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2298,11 +2029,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE VIEW view_retval_1 AS SELECT COUNT(*) FROM mysql.general_log; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_1` AS SELECT COUNT(*) FROM mysql.general_log -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2310,22 +2041,20 @@ SELECT * FROM view_retval_1; Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT func_sidef_2() +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2340,12 +2069,10 @@ DROP PROCEDURE proc_2; Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO ta2 VALUES (47) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO trigger_table_2 VALUES (1) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2353,11 +2080,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `view_retval_2` AS SELECT * FROM view_retval_1 -* binlog_format = STATEMENT: expect warning. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t2 SELECT * FROM view_retval_2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2366,10 +2093,10 @@ DROP VIEW view_retval_2; Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM view_retval_1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2377,29 +2104,691 @@ DROP VIEW view_retval_1; Invoking prepared statement prep_1 invoking unsafe use of mysql.general_log. PREPARE prep_1 FROM "INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log"; -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; Invoking unsafe use of mysql.general_log. -* binlog_format = STATEMENT: expect warning. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. SELECT COUNT(*) FROM mysql.general_log; + +==== Testing a statement that is unsafe in many ways ==== + +Invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; RETURN 0; END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 6 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 6 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; END; +* binlog_format = STATEMENT: expect 6 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 6 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 6 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 6 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 6 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 6 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking prepared statement prep_1 invoking statement that is unsafe in many ways. +PREPARE prep_1 FROM "INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1"; +* binlog_format = STATEMENT: expect 6 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking statement that is unsafe in many ways. +* binlog_format = STATEMENT: expect 6 warnings. +INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing a statement that is unsafe several times ==== + +Invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VALUES (multi_unsafe_func()); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VALUES (multi_unsafe_func()); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT + +Invoking function func_sidef_2 invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VALUES (multi_unsafe_func()); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE VIEW view_sidef_1 AS SELECT multi_unsafe_func(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t1 SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +Failure! Event number 3 was a 'Query', not a 'Table_map'. +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_sidef_1; + +Invoking prepared statement prep_1 invoking statement that is unsafe several times. +PREPARE prep_1 FROM "INSERT INTO ta0 VALUES (multi_unsafe_func())"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking statement that is unsafe several times. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO ta0 VALUES (multi_unsafe_func()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER double_autoinc_trig; -DROP TABLE t0, t1, t2, t3, ta1, ta2, ta3, +DROP TABLE t0, t1, t2, t3, ta0, ta1, ta2, ta3, autoinc_table, double_autoinc_table, data_table, trigger_table_1, trigger_table_2, trigger_table_3; DROP FUNCTION myfunc_int; +DROP FUNCTION multi_unsafe_func; ==== Special system variables that should *not* be unsafe ==== CREATE TABLE t1 (a VARCHAR(1000)); CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); @@ -2428,24 +2817,24 @@ INSERT INTO autoinc_table VALUES (NULL); The following variables *should* give a warning, despite they are replicated. INSERT INTO t1 VALUES (@@session.sql_mode); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (@@session.sql_mode) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. INSERT INTO t1 VALUES (@@session.insert_id); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (@@session.insert_id) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. DROP TABLE t1, autoinc_table; CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b)); INSERT INTO t1 SELECT * FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. REPLACE INTO t1 SELECT * FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: REPLACE INTO t1 SELECT * FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. UPDATE t1 SET a=1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET a=1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DELETE FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: DELETE FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. CREATE PROCEDURE p1() BEGIN INSERT INTO t1 SELECT * FROM t1 LIMIT 1; @@ -2455,10 +2844,7 @@ DELETE FROM t1 LIMIT 1; END| CALL p1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t1 LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: REPLACE INTO t1 SELECT * FROM t1 LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET a=1 LIMIT 1 -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: DELETE FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP PROCEDURE p1; DROP TABLE t1; DROP TABLE IF EXISTS t1; @@ -2466,7 +2852,7 @@ CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100)); INSERT INTO t1 VALUES ('a','b'); UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1(i INT PRIMARY KEY); @@ -2475,7 +2861,7 @@ CREATE TABLE t3(i INT, ch CHAR(50)); "Should issue message Statement may not be safe to log in statement format." INSERT INTO t1 SELECT * FROM t2 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t2 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. CREATE FUNCTION func6() RETURNS INT BEGIN @@ -2487,10 +2873,7 @@ END| "Should issue message Statement may not be safe to log in statement format only once" INSERT INTO t3 VALUES(func6(), UUID()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (10) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (11) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES (12) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t3 VALUES(func6(), UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. "Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements" CREATE FUNCTION fun_check_log_bin() RETURNS INT BEGIN @@ -2503,7 +2886,7 @@ SELECT fun_check_log_bin(); fun_check_log_bin() 100 Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES(@@global.sync_binlog) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. "SQL_LOG_BIN should be ON still" SHOW VARIABLES LIKE "SQL_LOG_BIN"; Variable_name Value @@ -2559,16 +2942,16 @@ CREATE TABLE t1(i INT PRIMARY KEY); CREATE TABLE t2(i INT PRIMARY KEY); INSERT INTO t1 SELECT * FROM t2 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 SELECT * FROM t2 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. INSERT INTO t1 VALUES(@@global.sync_binlog); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t1 VALUES(@@global.sync_binlog) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. UPDATE t1 SET i = 999 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE t1 SET i = 999 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DELETE FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: DELETE FROM t1 LIMIT 1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1, t2; SET @@SESSION.SQL_MODE = @save_sql_mode; SET @old_binlog_format = @@session.binlog_format; diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index caf172e4a0e..8fb09fe9ab7 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -92,105 +92,149 @@ # related to logging format (not just 'Unsafe statement binlogged in # statement mode since BINLOG_FORMAT = STATEMENT'). -source include/have_udf.inc; -source include/have_log_bin.inc; -source include/have_binlog_format_statement.inc; +--source include/have_udf.inc +--source include/have_log_bin.inc +--source include/have_binlog_format_statement.inc --echo #### Setup tables #### -CREATE TABLE t0 (a CHAR(40)); -CREATE TABLE t1 (a CHAR(40)); -CREATE TABLE t2 (a CHAR(40)); -CREATE TABLE t3 (a CHAR(40)); -CREATE TABLE ta1 (a CHAR(40)); -CREATE TABLE ta2 (a CHAR(40)); -CREATE TABLE ta3 (a CHAR(40)); +CREATE TABLE t0 (a CHAR(100)); +CREATE TABLE t1 (a CHAR(100)); +CREATE TABLE t2 (a CHAR(100)); +CREATE TABLE t3 (a CHAR(100)); +CREATE TABLE ta0 (a CHAR(100)); +CREATE TABLE ta1 (a CHAR(100)); +CREATE TABLE ta2 (a CHAR(100)); +CREATE TABLE ta3 (a CHAR(100)); CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); -CREATE TABLE double_autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); ---DELIMITER | -CREATE TRIGGER double_autoinc_trig BEFORE INSERT ON double_autoinc_table FOR EACH ROW BEGIN - INSERT INTO autoinc_table VALUES (NULL); -END| ---DELIMITER ; -CREATE TABLE data_table (a CHAR(40)); +CREATE TABLE data_table (a CHAR(100)); INSERT INTO data_table VALUES ('foo'); CREATE TABLE trigger_table_1 (a INT); CREATE TABLE trigger_table_2 (a INT); CREATE TABLE trigger_table_3 (a INT); +CREATE TABLE double_autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); + +--DELIMITER | +CREATE TRIGGER double_autoinc_trig +BEFORE INSERT ON double_autoinc_table FOR EACH ROW +BEGIN + INSERT INTO autoinc_table VALUES (NULL); +END| + +CREATE FUNCTION multi_unsafe_func() RETURNS INT +BEGIN + INSERT INTO t0 VALUES(CONCAT(@@hostname, @@hostname)); + INSERT INTO t0 VALUES(0); + INSERT INTO t0 VALUES(CONCAT(UUID(), @@hostname)); + RETURN 1; +END| +--DELIMITER ; + --replace_result $UDF_EXAMPLE_LIB UDF_EXAMPLE_LIB -eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB"; +--eval CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "$UDF_EXAMPLE_LIB" # In each iteration of this loop, we select one method to make the # statement unsafe. -let $unsafe_type= 0; -while (`SELECT $unsafe_type < 7`) { +--let $unsafe_type= 0 +while (`SELECT $unsafe_type < 9`) { --echo if (`SELECT $unsafe_type = 0`) { --echo ==== Testing UUID() unsafeness ==== - let $desc_0= unsafe UUID() function; - let $stmt_sidef_0= INSERT INTO t0 VALUES (UUID()); - let $value_0= UUID(); - let $sel_sidef_0=; - let $sel_retval_0= SELECT UUID(); + --let $desc_0= unsafe UUID() function + --let $stmt_sidef_0= INSERT INTO t0 VALUES (UUID()) + --let $value_0= UUID() + --let $sel_sidef_0= + --let $sel_retval_0= SELECT UUID() + --let $CRC_ARG_expected_number_of_warnings= 1 } if (`SELECT $unsafe_type = 1`) { --echo ==== Testing @@hostname unsafeness ==== - let $desc_0= unsafe @@hostname variable; - let $stmt_sidef_0= INSERT INTO t0 VALUES (@@hostname); - let $value_0= @@hostname; - let $sel_sidef_0=; + --let $desc_0= unsafe @@hostname variable + --let $stmt_sidef_0= INSERT INTO t0 VALUES (@@hostname) + --let $value_0= @@hostname + --let $sel_sidef_0= # $sel_retval is going to be used in views. Views cannot execute # statements that refer to @@variables. Hence, we set $set_retval # to empty instead of SELECT @@hostname. - let $sel_retval_0=; + --let $sel_retval_0= + --let $CRC_ARG_expected_number_of_warnings= 1 } if (`SELECT $unsafe_type = 2`) { --echo ==== Testing SELECT...LIMIT unsafeness ==== - let $desc_0= unsafe SELECT...LIMIT statement; - let $stmt_sidef_0= INSERT INTO t0 SELECT * FROM data_table LIMIT 1; - let $value_0=; - let $sel_sidef_0=; - let $sel_retval_0= SELECT * FROM data_table LIMIT 1; + --let $desc_0= unsafe SELECT...LIMIT statement + --let $stmt_sidef_0= INSERT INTO t0 SELECT * FROM data_table LIMIT 1 + --let $value_0= + --let $sel_sidef_0= + --let $sel_retval_0= SELECT * FROM data_table LIMIT 1 + --let $CRC_ARG_expected_number_of_warnings= 1 } if (`SELECT $unsafe_type = 3`) { --echo ==== Testing INSERT DELAYED unsafeness ==== - let $desc_0= unsafe INSERT DELAYED statement; - let $stmt_sidef_0= INSERT DELAYED INTO t0 VALUES (1), (2); - let $value_0=; - let $sel_sidef_0=; - let $sel_retval_0=; + --let $desc_0= unsafe INSERT DELAYED statement + --let $stmt_sidef_0= INSERT DELAYED INTO t0 VALUES (1), (2) + --let $value_0= + --let $sel_sidef_0= + --let $sel_retval_0= + --let $CRC_ARG_expected_number_of_warnings= 1 } if (`SELECT $unsafe_type = 4`) { --echo ==== Testing unsafeness of insert of two autoinc values ==== - let $desc_0= unsafe update of two autoinc columns; - let $stmt_sidef_0= INSERT INTO double_autoinc_table VALUES (NULL); - let $value_0=; - let $sel_sidef_0=; - let $sel_retval_0=; + --let $desc_0= unsafe update of two autoinc columns + --let $stmt_sidef_0= INSERT INTO double_autoinc_table VALUES (NULL) + --let $value_0= + --let $sel_sidef_0= + --let $sel_retval_0= + # Note: we will expect 1 warning when BUG#45827 is fixed. + --let $CRC_ARG_expected_number_of_warnings= 0 } if (`SELECT $unsafe_type = 5`) { --echo ==== Testing unsafeness of UDF's ==== - let $desc_0= unsafe UDF; - let $stmt_sidef_0= INSERT INTO t0 VALUES (myfunc_int(10)); - let $value_0= myfunc_int(10); - let $sel_sidef_0= SELECT myfunc_int(10); - let $sel_retval_0= ; + --let $desc_0= unsafe UDF + --let $stmt_sidef_0= INSERT INTO t0 VALUES (myfunc_int(10)) + --let $value_0= myfunc_int(10) + --let $sel_sidef_0= SELECT myfunc_int(10) + --let $sel_retval_0= + --let $CRC_ARG_expected_number_of_warnings= 1 } if (`SELECT $unsafe_type = 6`) { --echo ==== Testing unsafeness of access to mysql.general_log ==== - let $desc_0= unsafe use of mysql.general_log; - let $stmt_sidef_0= INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; - let $value_0=; - let $sel_sidef_0=; - let $sel_retval_0= SELECT COUNT(*) FROM mysql.general_log; + --let $desc_0= unsafe use of mysql.general_log + --let $stmt_sidef_0= INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log + --let $value_0= + --let $sel_sidef_0= + --let $sel_retval_0= SELECT COUNT(*) FROM mysql.general_log + --let $CRC_ARG_expected_number_of_warnings= 1 + } + + if (`SELECT $unsafe_type = 7`) { + --echo ==== Testing a statement that is unsafe in many ways ==== + --let $desc_0= statement that is unsafe in many ways + # Concatenate three unsafe values, and then concatenate NULL to + # that so that the result is NULL and we instead use autoinc. + --let $stmt_sidef_0= INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1 + --let $value_0= + --let $sel_sidef_0= + --let $sel_retval_0= + # Note: we will expect 7 warnings when BUG#45827 is fixed. + --let $CRC_ARG_expected_number_of_warnings= 6 + } + + if (`SELECT $unsafe_type = 8`) { + --echo ==== Testing a statement that is unsafe several times ==== + --let $desc_0= statement that is unsafe several times + --let $stmt_sidef_0= INSERT INTO ta0 VALUES (multi_unsafe_func()) + --let $value_0= + --let $sel_sidef_0= SELECT multi_unsafe_func() + --let $sel_retval_0= + --let $CRC_ARG_expected_number_of_warnings= 2 } # In each iteration of the following loop, we select one way to @@ -201,24 +245,24 @@ while (`SELECT $unsafe_type < 7`) { # In the last iteration, $call_type_1=7, we don't create a recursive # construct. Instead, we just invoke the unsafe statement directly. - let $call_type_1= 0; + --let $call_type_1= 0 while (`SELECT $call_type_1 < 8`) { #--echo debug: level 1, types $call_type_1 -> $unsafe_type - let $CRC_ARG_level= 1; - let $CRC_ARG_type= $call_type_1; - let $CRC_ARG_stmt_sidef= $stmt_sidef_0; - let $CRC_ARG_value= $value_0; - let $CRC_ARG_sel_sidef= $sel_sidef_0; - let $CRC_ARG_sel_retval= $sel_retval_0; - let $CRC_ARG_desc= $desc_0; - source extra/rpl_tests/create_recursive_construct.inc; - let $stmt_sidef_1= $CRC_RET_stmt_sidef; - let $value_1= $CRC_RET_value; - let $sel_sidef_1= $CRC_RET_sel_sidef; - let $sel_retval_1= $CRC_RET_sel_retval; - let $is_toplevel_1= $CRC_RET_is_toplevel; - let $drop_1= $CRC_RET_drop; - let $desc_1= $CRC_RET_desc; + --let $CRC_ARG_level= 1 + --let $CRC_ARG_type= $call_type_1 + --let $CRC_ARG_stmt_sidef= $stmt_sidef_0 + --let $CRC_ARG_value= $value_0 + --let $CRC_ARG_sel_sidef= $sel_sidef_0 + --let $CRC_ARG_sel_retval= $sel_retval_0 + --let $CRC_ARG_desc= $desc_0 + --source extra/rpl_tests/create_recursive_construct.inc + --let $stmt_sidef_1= $CRC_RET_stmt_sidef + --let $value_1= $CRC_RET_value + --let $sel_sidef_1= $CRC_RET_sel_sidef + --let $sel_retval_1= $CRC_RET_sel_retval + --let $is_toplevel_1= $CRC_RET_is_toplevel + --let $drop_1= $CRC_RET_drop + --let $desc_1= $CRC_RET_desc # Some statements must be top-level statements, i.e., cannot be # called as a sub-statement of any recursive construct. (One @@ -232,24 +276,24 @@ while (`SELECT $unsafe_type < 7`) { # the previous recursive construct in another recursive # construct. - let $call_type_2= 0; + --let $call_type_2= 0 while (`SELECT $call_type_2 < 7`) { #--echo debug: level 2, types $call_type_2 -> $call_type_1 -> $unsafe_type - let $CRC_ARG_level= 2; - let $CRC_ARG_type= $call_type_2; - let $CRC_ARG_stmt_sidef= $stmt_sidef_1; - let $CRC_ARG_value= $value_1; - let $CRC_ARG_sel_sidef= $sel_sidef_1; - let $CRC_ARG_sel_retval= $sel_retval_1; - let $CRC_ARG_desc= $desc_1; - source extra/rpl_tests/create_recursive_construct.inc; - let $stmt_sidef_2= $CRC_RET_stmt_sidef; - let $value_2= $CRC_RET_value; - let $sel_sidef_2= $CRC_RET_sel_sidef; - let $sel_retval_2= $CRC_RET_sel_retval; - let $is_toplevel_2= $CRC_RET_is_toplevel; - let $drop_2= $CRC_RET_drop; - let $desc_2= $CRC_RET_desc; + --let $CRC_ARG_level= 2 + --let $CRC_ARG_type= $call_type_2 + --let $CRC_ARG_stmt_sidef= $stmt_sidef_1 + --let $CRC_ARG_value= $value_1 + --let $CRC_ARG_sel_sidef= $sel_sidef_1 + --let $CRC_ARG_sel_retval= $sel_retval_1 + --let $CRC_ARG_desc= $desc_1 + --source extra/rpl_tests/create_recursive_construct.inc + --let $stmt_sidef_2= $CRC_RET_stmt_sidef + --let $value_2= $CRC_RET_value + --let $sel_sidef_2= $CRC_RET_sel_sidef + --let $sel_retval_2= $CRC_RET_sel_retval + --let $is_toplevel_2= $CRC_RET_is_toplevel + --let $drop_2= $CRC_RET_drop + --let $desc_2= $CRC_RET_desc if (!$is_toplevel_2) { @@ -261,51 +305,52 @@ while (`SELECT $unsafe_type < 7`) { # the previous recursive construct in another recursive # construct. - let $call_type_3= 0; + --let $call_type_3= 0 while (`SELECT $call_type_3 < 7`) { #--echo debug: level 3, types $call_type_2 -> $call_type_2 -> $call_type_1 -> $unsafe_type - let $CRC_ARG_level= 3; - let $CRC_ARG_type= $call_type_3; - let $CRC_ARG_stmt_sidef= $stmt_sidef_2; - let $CRC_ARG_value= $value_2; - let $CRC_ARG_sel_sidef= $sel_sidef_2; - let $CRC_ARG_sel_retval= $sel_retval_2; - let $CRC_ARG_desc= $desc_2; - source extra/rpl_tests/create_recursive_construct.inc; + --let $CRC_ARG_level= 3 + --let $CRC_ARG_type= $call_type_3 + --let $CRC_ARG_stmt_sidef= $stmt_sidef_2 + --let $CRC_ARG_value= $value_2 + --let $CRC_ARG_sel_sidef= $sel_sidef_2 + --let $CRC_ARG_sel_retval= $sel_retval_2 + --let $CRC_ARG_desc= $desc_2 + --source extra/rpl_tests/create_recursive_construct.inc # Drop created object. if (`SELECT '$drop_3' != ''`) { - eval $drop_3; + --eval $drop_3 } - inc $call_type_3; + --inc $call_type_3 } # while (call_type_3) } # if (0) } # if (!is_toplevel_2) # Drop created object. if (`SELECT '$drop_2' != ''`) { - eval $drop_2; + --eval $drop_2 } - inc $call_type_2; + --inc $call_type_2 } # while (call_type_2) } # if (!is_toplevel_1) # Drop created object. if (`SELECT '$drop_1' != ''`) { - eval $drop_1; + --eval $drop_1 } - inc $call_type_1; + --inc $call_type_1 } # while (call_type_1) - inc $unsafe_type; + --inc $unsafe_type } # while (unsafe_type) DROP TRIGGER double_autoinc_trig; -DROP TABLE t0, t1, t2, t3, ta1, ta2, ta3, +DROP TABLE t0, t1, t2, t3, ta0, ta1, ta2, ta3, autoinc_table, double_autoinc_table, data_table, trigger_table_1, trigger_table_2, trigger_table_3; DROP FUNCTION myfunc_int; +DROP FUNCTION multi_unsafe_func; --echo ==== Special system variables that should *not* be unsafe ==== diff --git a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result index 5252562acef..cff694318b3 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result +++ b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result @@ -52,8 +52,8 @@ a a 7 Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO logtbl VALUES( NAME_CONST('sect',2), NAME_CONST('test',1), NAME_CONST('cnt',3)) -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO logtbl VALUES( NAME_CONST('sect',2), NAME_CONST('test',1)+1, NAME_CONST('cnt',183)) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN INSERT INTO logtbl VALUES (sect,test,found_rows); END $$ diff --git a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result index a2fc22d9951..6a1475485f7 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result @@ -10,7 +10,7 @@ CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a)); INSERT INTO test.t1 VALUES(1,'test'); UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. create procedure test.p1() begin INSERT INTO test.t1 VALUES(2,'test'); @@ -18,8 +18,7 @@ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2; end| CALL test.p1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO test.t1 VALUES(2,'test') -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2 +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. SELECT * FROM test.t1 ORDER BY blob_column; a blob_column 1 abase diff --git a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test index 30342126d24..9b8346ef21b 100644 --- a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test +++ b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test @@ -1,6 +1,14 @@ source include/master-slave.inc; source include/have_binlog_format_mixed.inc; +# It is not possible to replicate FOUND_ROWS() using statement-based +# replication, but there is a workaround that stores the result of +# FOUND_ROWS() into a user variable and then replicates this instead. +# +# The purpose of this test case is to test that the workaround works +# properly even when inside stored programs (i.e., stored routines and +# triggers). + --echo ==== Initialize ==== --echo **** On Master **** diff --git a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test index 940d9f73d13..9137dcfacd2 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test +++ b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test @@ -4,10 +4,10 @@ source include/master-slave.inc; # It is not possible to replicate FOUND_ROWS() using statement-based # replication, but there is a workaround that stores the result of # FOUND_ROWS() into a user variable and then replicates this instead. - -# The purpose of this test case is to test that the workaround -# function properly even when inside stored programs (i.e., stored -# routines and triggers). +# +# The purpose of this test case is to test that the workaround works +# properly even when inside stored programs (i.e., stored routines and +# triggers). --echo ==== Initialize ==== diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result index 3a31ecd77ba..fbb02b15d29 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -64,7 +64,7 @@ SET @@session.binlog_format = MIXED; * Unsafe statement and stmt-only engine INSERT INTO t_stmt VALUES (UUID()); Warnings: -Note 1639 Unsafe statement binlogged as statement since storage engine is limited to statement-logging. Statement: INSERT INTO t_stmt VALUES (UUID()) +Note 1639 Unsafe statement binlogged as statement since storage engine is limited to statement-logging. Reason: Statement uses a system function whose value may differ on slave. ---- binlog_format=statement ---- [on slave] include/stop_slave.inc @@ -93,7 +93,7 @@ ERROR HY000: Cannot execute row injection: binlogging impossible since BINLOG_FO * Unsafe statement and binlog_format=statement INSERT INTO t VALUES (UUID()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Statement: INSERT INTO t VALUES (UUID()) +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. ---- master: binlog_format=mixed, slave: binlog_format=statement ---- SET @@global.binlog_format = MIXED; SET @@session.binlog_format = MIXED; diff --git a/sql/item_create.cc b/sql/item_create.cc index 23a921be91c..c124128b3f8 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -2379,7 +2379,7 @@ Create_udf_func::create(THD *thd, udf_func *udf, List *item_list) if (item_list != NULL) arg_count= item_list->elements; - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_UDF); DBUG_ASSERT( (udf->type == UDFTYPE_FUNCTION) || (udf->type == UDFTYPE_AGGREGATE)); @@ -3365,7 +3365,7 @@ Item* Create_func_found_rows::create(THD *thd) { DBUG_ENTER("Create_func_found_rows::create"); - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_found_rows()); } @@ -3794,7 +3794,7 @@ Item* Create_func_load_file::create(THD *thd, Item *arg1) { DBUG_ENTER("Create_func_load_file::create"); - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); DBUG_RETURN(new (thd->mem_root) Item_load_file(arg1)); } @@ -4264,7 +4264,7 @@ Item* Create_func_row_count::create(THD *thd) { DBUG_ENTER("Create_func_row_count::create"); - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_row_count()); } @@ -4574,7 +4574,7 @@ Item* Create_func_uuid::create(THD *thd) { DBUG_ENTER("Create_func_uuid::create"); - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_uuid()); } @@ -4586,7 +4586,7 @@ Item* Create_func_uuid_short::create(THD *thd) { DBUG_ENTER("Create_func_uuid_short::create"); - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_uuid_short()); } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 629a24585b3..3d1782682c1 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -508,7 +508,7 @@ sp_head::operator delete(void *ptr, size_t size) throw() sp_head::sp_head() :Query_arena(&main_mem_root, INITIALIZED_FOR_SP), - m_flags(0), m_recursion_level(0), m_next_cached_sp(0), + m_flags(0), unsafe_flags(0), m_recursion_level(0), m_next_cached_sp(0), m_cont_level(0) { const LEX_STRING str_reset= { NULL, 0 }; @@ -2104,13 +2104,10 @@ sp_head::restore_lex(THD *thd) oldlex->trg_table_fields.push_back(&sublex->trg_table_fields); - /* - If this substatement needs row-based, the entire routine does too (we - cannot switch from statement-based to row-based only for this - substatement). - */ - if (sublex->is_stmt_unsafe()) - m_flags|= BINLOG_ROW_BASED_IF_MIXED; + /* If this substatement is unsafe, the entire routine is too. */ + DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags: 0x%x", + thd->lex->get_stmt_unsafe_flags())); + unsafe_flags|= sublex->get_stmt_unsafe_flags(); /* Add routines which are used by statement to respective set for diff --git a/sql/sp_head.h b/sql/sp_head.h index 7faccb7afbb..3de9abd6760 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -165,9 +165,8 @@ public: HAS_COMMIT_OR_ROLLBACK= 128, LOG_SLOW_STATEMENTS= 256, // Used by events LOG_GENERAL_LOG= 512, // Used by events - BINLOG_ROW_BASED_IF_MIXED= 1024, - HAS_SQLCOM_RESET= 2048, - HAS_SQLCOM_FLUSH= 4096 + HAS_SQLCOM_RESET= 1024, + HAS_SQLCOM_FLUSH= 2048 }; /** TYPE_ENUM_FUNCTION, TYPE_ENUM_PROCEDURE or TYPE_ENUM_TRIGGER */ @@ -198,6 +197,11 @@ public: private: Stored_program_creation_ctx *m_creation_ctx; + /** + Boolean combination of (1<set_stmt_unsafe(); + DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", + lex->get_stmt_unsafe_flags())); + DBUG_PRINT("info", ("sp_head(0x%p=%s)->unsafe_flags: 0x%x", + this, name(), unsafe_flags)); + lex->set_stmt_unsafe_flags(unsafe_flags); DBUG_VOID_RETURN; } diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 6359fb7b914..bec50443ee4 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -5152,12 +5152,17 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table) int THD::decide_logging_format(TABLE_LIST *tables) { DBUG_ENTER("THD::decide_logging_format"); + DBUG_PRINT("info", ("query: %s", query)); + DBUG_PRINT("info", ("variables.binlog_format: %ld", + variables.binlog_format)); + DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", + lex->get_stmt_unsafe_flags())); if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG)) { /* - Compute the starting vectors for the computations by creating a - set with all the capabilities bits set and one with no - capabilities bits set. + Compute one bit field with the union of all the engine + capabilities, and one with the intersection of all the engine + capabilities. */ handler::Table_flags flags_some_set= 0; handler::Table_flags flags_all_set= @@ -5180,15 +5185,14 @@ int THD::decide_logging_format(TABLE_LIST *tables) /* Get the capabilities vector for all involved storage engines and - mask out the flags for the binary log. (Currently, the binlog - flags only include the capabilities of the storage engines.) + mask out the flags for the binary log. */ for (TABLE_LIST *table= tables; table; table= table->next_global) { if (table->placeholder()) continue; if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) - lex->set_stmt_unsafe(); + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_TABLE); if (table->lock_type >= TL_WRITE_ALLOW_WRITE) { ulonglong const flags= table->table->file->ha_table_flags(); @@ -5210,12 +5214,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) DBUG_PRINT("info", ("flags_some_set: %s%s", FLAGSTR(flags_some_set, HA_BINLOG_STMT_CAPABLE), FLAGSTR(flags_some_set, HA_BINLOG_ROW_CAPABLE))); - DBUG_PRINT("info", ("variables.binlog_format: %ld", - variables.binlog_format)); DBUG_PRINT("info", ("multi_engine: %s", multi_engine ? "TRUE" : "FALSE")); int error= 0; + int unsafe_flags; /* If more than one engine is involved in the statement and at @@ -5258,14 +5261,20 @@ int THD::decide_logging_format(TABLE_LIST *tables) */ my_error((error= ER_BINLOG_ROW_MODE_AND_STMT_ENGINE), MYF(0)); } - else if (lex->is_stmt_unsafe()) + else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) { /* 3. Warning: Unsafe statement binlogged as statement since storage engine is limited to statement-logging. */ - binlog_warning_flags|= - (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_ENGINE); + binlog_unsafe_warning_flags|= + (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE) | + (unsafe_flags << BINLOG_STMT_WARNING_COUNT); + DBUG_PRINT("info", ("Scheduling warning to be issued by " + "binlog_query: %s", + ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE))); + DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x", + binlog_unsafe_warning_flags)); } /* log in statement format! */ } @@ -5291,14 +5300,20 @@ int THD::decide_logging_format(TABLE_LIST *tables) */ my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), ""); } - else if (lex->is_stmt_unsafe()) + else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) { /* 7. Warning: Unsafe statement logged as statement due to binlog_format = STATEMENT */ - binlog_warning_flags|= - (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_MODE); + binlog_unsafe_warning_flags|= + (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE) | + (unsafe_flags << BINLOG_STMT_WARNING_COUNT); + DBUG_PRINT("info", ("Scheduling warning to be issued by " + "binlog_query: '%s'", + ER(ER_BINLOG_UNSAFE_STATEMENT))); + DBUG_PRINT("info", ("binlog_stmt_flags: 0x%x", + binlog_unsafe_warning_flags)); } /* log in statement format! */ } @@ -5315,9 +5330,21 @@ int THD::decide_logging_format(TABLE_LIST *tables) } } - if (error) + if (error) { + DBUG_PRINT("info", ("decision: no logging since an error was generated")); DBUG_RETURN(-1); + } + DBUG_PRINT("info", ("decision: logging in %s format", + is_current_stmt_binlog_format_row() ? + "ROW" : "STATEMENT")); } +#ifndef DBUG_OFF + else + DBUG_PRINT("info", ("decision: no logging since " + "mysql_bin_log.is_open() = %d " + "and (options & OPTION_BIN_LOG) = 0x%llx", + mysql_bin_log.is_open(), (options & OPTION_BIN_LOG))); +#endif DBUG_RETURN(0); } @@ -5401,7 +5428,7 @@ int lock_tables(THD *thd, TABLE_LIST *tables, uint count, bool *need_reopen) if (thd->variables.binlog_format == BINLOG_FORMAT_MIXED && has_two_write_locked_tables_with_auto_increment(tables)) { - thd->lex->set_stmt_unsafe(); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_TWO_AUTOINC_COLUMNS); thd->set_current_stmt_binlog_row_based_if_mixed(); } } diff --git a/sql/sql_class.cc b/sql/sql_class.cc index f401daaee9b..4f8f0a30544 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -39,6 +39,7 @@ #include #endif #include +#include #include "sp_rcontext.h" #include "sp_cache.h" @@ -540,7 +541,7 @@ THD::THD() lock_id(&main_lock_id), user_time(0), in_sub_stmt(0), sql_log_bin_toplevel(false), - binlog_warning_flags(0UL), binlog_table_maps(0), + binlog_unsafe_warning_flags(0), binlog_table_maps(0), table_map_for_update(0), arg_of_last_insert_id_function(FALSE), first_successful_insert_id_in_prev_stmt(0), @@ -3633,6 +3634,93 @@ show_query_type(THD::enum_binlog_query_type qtype) #endif +/** + Auxiliary method used by @c binlog_query() to raise warnings. + + @param err An ER_BINLOG_UNSAFE_* constant; the warning to print. +*/ +void THD::issue_unsafe_warnings() +{ + DBUG_ENTER("issue_unsafe_warnings"); + /* + Ensure that binlog_unsafe_warning_flags is big enough to hold all + bits. This is actually a constant expression. + */ + DBUG_ASSERT(BINLOG_STMT_WARNING_COUNT + 2 * LEX::BINLOG_STMT_UNSAFE_COUNT <= + sizeof(binlog_unsafe_warning_flags) * CHAR_BIT); + + /** + @note The order of the elements of this array must correspond to + the order of elements in enum_binlog_stmt_unsafe. + */ + static const char *explanations[LEX::BINLOG_STMT_UNSAFE_COUNT] = + { + "Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.", + "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted.", + "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave.", + "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave.", + "Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave.", + "Statement uses a system variable whose value may differ on slave.", + "Statement uses a system function whose value may differ on slave." + }; + uint32 flags= binlog_unsafe_warning_flags; + /* No warnings (yet) for this statement. */ + if (flags == 0) + DBUG_VOID_RETURN; + + /* Get the types of unsafeness that affect the current statement. */ + uint32 unsafe_type_flags= flags >> BINLOG_STMT_WARNING_COUNT; + DBUG_ASSERT((unsafe_type_flags & LEX::BINLOG_STMT_UNSAFE_ALL_FLAGS) != 0); + /* + Clear (1) bits above BINLOG_STMT_UNSAFE_COUNT; (2) bits for + warnings that have been printed already. + */ + unsafe_type_flags &= (LEX::BINLOG_STMT_UNSAFE_ALL_FLAGS ^ + (unsafe_type_flags >> LEX::BINLOG_STMT_UNSAFE_COUNT)); + /* If all warnings have been printed already, return. */ + if (unsafe_type_flags == 0) + DBUG_VOID_RETURN; + + /* Figure out which error code to issue. */ + int err; + if (binlog_unsafe_warning_flags & + (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE)) + err= ER_BINLOG_UNSAFE_AND_STMT_ENGINE; + else { + DBUG_ASSERT(binlog_unsafe_warning_flags & + (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE)); + err= ER_BINLOG_UNSAFE_STATEMENT; + } + + DBUG_PRINT("info", ("flags: 0x%x err: %d", unsafe_type_flags, err)); + + /* + For each unsafe_type, check if the statement is unsafe in this way + and issue a warning. + */ + for (int unsafe_type=0; + unsafe_type < LEX::BINLOG_STMT_UNSAFE_COUNT; + unsafe_type++) + { + if ((unsafe_type_flags & (1 << unsafe_type)) != 0) + { + push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, err, + "%s Reason: %s", + ER(err), explanations[unsafe_type]); + sql_print_warning("%s Reason: %s Statement: %s", + ER(err), explanations[unsafe_type], query); + } + } + /* + Mark these unsafe types as already printed, to avoid printing + warnings for them again. + */ + binlog_unsafe_warning_flags|= unsafe_type_flags << + (BINLOG_STMT_WARNING_COUNT + LEX::BINLOG_STMT_UNSAFE_COUNT); + DBUG_VOID_RETURN; +} + + /** Log the current query. @@ -3688,34 +3776,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, know for sure if the statement will be logged. */ if (sql_log_bin_toplevel) - { - if (binlog_warning_flags & - (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_ENGINE)) - { - push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_BINLOG_UNSAFE_AND_STMT_ENGINE, - "%s Statement: %.*s", - ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE), - MYSQL_ERRMSG_SIZE, query_arg); - sql_print_warning("%s Statement: %.*s", - ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE), - MYSQL_ERRMSG_SIZE, query_arg); - binlog_warning_flags|= 1 << BINLOG_WARNING_FLAG_PRINTED; - } - else if (binlog_warning_flags & - (1 << BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_MODE)) - { - push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, - ER_BINLOG_UNSAFE_STATEMENT, - "%s Statement: %.*s", - ER(ER_BINLOG_UNSAFE_STATEMENT), - MYSQL_ERRMSG_SIZE, query_arg); - sql_print_warning("%s Statement: %.*s", - ER(ER_BINLOG_UNSAFE_STATEMENT), - MYSQL_ERRMSG_SIZE, query_arg); - binlog_warning_flags|= 1 << BINLOG_WARNING_FLAG_PRINTED; - } - } + issue_unsafe_warnings(); switch (qtype) { /* @@ -3738,6 +3799,10 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, format; it cannot be logged in row format. This is typically used by DDL statements. It is an error to use this query type if current_stmt_binlog_row_based is set. + + @todo Currently there are places that call this method with + STMT_QUERY_TYPE and current_stmt_binlog_row_based. Fix those + places and add assert to ensure correct behavior. /Sven */ case THD::STMT_QUERY_TYPE: /* diff --git a/sql/sql_class.h b/sql/sql_class.h index 5e069f1cbb6..cf008cbf865 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1422,38 +1422,79 @@ public: int binlog_flush_pending_rows_event(bool stmt_end); int binlog_remove_pending_rows_event(bool clear_maps); - int is_current_stmt_binlog_format_row() { + /** + Determine the binlog format of the current statement. + + @retval 0 if the current statement will be logged in statement + format. + @retval nonzero if the current statement will be logged in row + format. + */ + int is_current_stmt_binlog_format_row() const { DBUG_ASSERT(current_stmt_binlog_format == BINLOG_FORMAT_STMT || current_stmt_binlog_format == BINLOG_FORMAT_ROW); return current_stmt_binlog_format == BINLOG_FORMAT_ROW; } private: - /* - Tells if current statement should binlog row-based(1) or stmt-based(0) + /** + Indicates the format in which the current statement will be + logged. This can only be set from @c decide_logging_format(). */ enum_binlog_format current_stmt_binlog_format; - enum enum_binlog_warning_flag { - /* ER_BINLOG_UNSAFE_AND_STMT_ENGINE affects current stmt */ - BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_ENGINE = 0, - /* ER_BINLOG_UNSAFE_AND_STMT_MODE affects current stmt */ - BINLOG_WARNING_FLAG_UNSAFE_AND_STMT_MODE, - /* One of the warnings has already been printed */ - BINLOG_WARNING_FLAG_PRINTED, - /* number of elements of this enum; insert new members above */ - BINLOG_WARNING_FLAG_COUNT - }; /** - Flags holding the status of binlog-related warnings for the - current statement. This is a binary combination of (1<lex object may change; e.g., if a + stored routine is invoked. Only THD persists between the calls. + */ + uint32 binlog_unsafe_warning_flags; + + void issue_unsafe_warnings(); /* Number of outstanding table maps, i.e., table maps in the @@ -2138,6 +2179,14 @@ public: inline void set_current_stmt_binlog_row_based_if_mixed() { DBUG_ENTER("set_current_stmt_binlog_row_based_if_mixed"); + /* + This should only be called from decide_logging_format. + + @todo Once we have ensured this, uncomment the following + statement, remove the big comment below that, and remove the + in_sub_stmt==0 condition from the following 'if'. + */ + /* DBUG_ASSERT(in_sub_stmt == 0); */ /* If in a stored/function trigger, the caller should already have done the change. We test in_sub_stmt to prevent introducing bugs where people @@ -2149,7 +2198,7 @@ public: */ if ((variables.binlog_format == BINLOG_FORMAT_MIXED) && (in_sub_stmt == 0)) - current_stmt_binlog_format= BINLOG_FORMAT_ROW; + set_current_stmt_binlog_row_based(); DBUG_VOID_RETURN; } @@ -2189,9 +2238,10 @@ public: show_system_thread(system_thread))); if ((temporary_tables == NULL) && (in_sub_stmt == 0)) { - current_stmt_binlog_format= - (variables.binlog_format == BINLOG_FORMAT_ROW) ? - BINLOG_FORMAT_ROW : BINLOG_FORMAT_STMT; + if (variables.binlog_format == BINLOG_FORMAT_ROW) + set_current_stmt_binlog_row_based(); + else + clear_current_stmt_binlog_row_based(); } DBUG_VOID_RETURN; } diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index e48731079eb..3cc4a6ea1a1 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1745,7 +1745,7 @@ public: decide_logging_format is made. We should probably call thd->decide_logging_format() directly instead. /Sven */ - thd.lex->set_stmt_unsafe(); + thd.lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_DELAYED); thd.set_current_stmt_binlog_row_based_if_mixed(); bzero((char*) &thd.net, sizeof(thd.net)); // Safety diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 9528d8f8f29..17ef4e7abd1 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1043,49 +1043,143 @@ public: } } - /** - Has the parser/scanner detected that this statement is unsafe? - @retval 0 if the statement is not marked as unsafe - @retval nonzero if the statement is marked as unsafe + /** + Enumeration listing of all types of unsafe statement. + + @note The order of elements of this enumeration type must + correspond to the order of the elements of the @c explanations + array defined in the body of @c THD::issue_unsafe_warnings. + */ + enum enum_binlog_stmt_unsafe { + /** + SELECT..LIMIT is unsafe because the set of rows returned cannot + be predicted. + */ + BINLOG_STMT_UNSAFE_LIMIT= 0, + /** + INSERT DELAYED is unsafe because the time when rows are inserted + cannot be predicted. + */ + BINLOG_STMT_UNSAFE_INSERT_DELAYED, + /** + Access to log tables is unsafe because slave and master probably + log different things. + */ + BINLOG_STMT_UNSAFE_SYSTEM_TABLE, + /** + Update of two autoincrement columns is unsafe. With one + autoincrement column, we store the counter in the binlog so that + slave can restore the correct value. But we can only store one + such counter per statement, so updating more than one + autoincrement column is not safe. + */ + BINLOG_STMT_UNSAFE_TWO_AUTOINC_COLUMNS, + /** + Using a UDF (user-defined function) is unsafe. + */ + BINLOG_STMT_UNSAFE_UDF, + /** + Using most system variables is unsafe, because slave may run + with different options than master. + */ + BINLOG_STMT_UNSAFE_SYSTEM_VARIABLE, + /** + Using some functions is unsafe (e.g., UUID). + */ + BINLOG_STMT_UNSAFE_FUNCTION, + + /* The last element of this enumeration type. */ + BINLOG_STMT_UNSAFE_COUNT + }; + /** + This has all flags from 0 (inclusive) to BINLOG_STMT_FLAG_COUNT + (exclusive) set. + */ + static const int BINLOG_STMT_UNSAFE_ALL_FLAGS= + ((1 << BINLOG_STMT_UNSAFE_COUNT) - 1); + + /** + Determine if this statement is marked as unsafe. + + @retval 0 if the statement is not marked as unsafe. + @retval nonzero if the statement is marked as unsafe. */ inline bool is_stmt_unsafe() const { - return binlog_stmt_flags & (1U << BINLOG_STMT_FLAG_UNSAFE); + return get_stmt_unsafe_flags() != 0; } /** - Is this statement actually a row injection? + Flag the current (top-level) statement as unsafe. + The flag will be reset after the statement has finished. + + @param unsafe_type The type of unsafety: one of the @c + BINLOG_STMT_FLAG_UNSAFE_* flags in @c enum_binlog_stmt_flag. + */ + inline void set_stmt_unsafe(enum_binlog_stmt_unsafe unsafe_type) { + DBUG_ENTER("set_stmt_unsafe"); + DBUG_ASSERT(unsafe_type >= 0 && unsafe_type < BINLOG_STMT_UNSAFE_COUNT); + binlog_stmt_flags|= (1U << unsafe_type); + DBUG_VOID_RETURN; + } + + /** + Set the bits of binlog_stmt_flags determining the type of + unsafeness of the current statement. No existing bits will be + cleared, but new bits may be set. + + @param flags A binary combination of zero or more bits, (1<reset_for_next_command(); @@ -5674,7 +5673,7 @@ void THD::reset_for_next_command() thd->sent_row_count= thd->examined_row_count= 0; thd->reset_current_stmt_binlog_row_based(); - thd->binlog_warning_flags= 0; + thd->binlog_unsafe_warning_flags= 0; DBUG_PRINT("debug", ("current_stmt_binlog_row_based: %d", diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 2a4c5c950fe..c285e40a148 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -1306,8 +1306,8 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table, If the view's body needs row-based binlogging (e.g. the VIEW is created from SELECT UUID()), the top statement also needs it. */ - if (lex->is_stmt_unsafe()) - old_lex->set_stmt_unsafe(); + old_lex->set_stmt_unsafe_flags(lex->get_stmt_unsafe_flags()); + view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE && lex->can_be_merged()); LINT_INIT(view_main_select_tables); diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c98fd93c1a7..bf8479894f6 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7213,7 +7213,7 @@ function_call_keyword: $$= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context()); if ($$ == NULL) MYSQL_YYABORT; - Lex->set_stmt_unsafe(); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); Lex->safe_to_cache_query= 0; } | DATE_SYM '(' expr ')' @@ -7368,7 +7368,7 @@ function_call_keyword: $$= new (YYTHD->mem_root) Item_func_user(); if ($$ == NULL) MYSQL_YYABORT; - Lex->set_stmt_unsafe(); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); Lex->safe_to_cache_query=0; } | YEAR_SYM '(' expr ')' @@ -8098,7 +8098,7 @@ variable_aux: if (!($$= get_system_var(YYTHD, $2, $3, $4))) MYSQL_YYABORT; if (!((Item_func_get_system_var*) $$)->is_written_to_binlog()) - Lex->set_stmt_unsafe(); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_VARIABLE); } ; @@ -8944,7 +8944,10 @@ opt_limit_clause: ; limit_clause: - LIMIT limit_options { Lex->set_stmt_unsafe(); } + LIMIT limit_options + { + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_LIMIT); + } ; limit_options: @@ -9006,7 +9009,7 @@ delete_limit_clause: { SELECT_LEX *sel= Select; sel->select_limit= $2; - Lex->set_stmt_unsafe(); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_LIMIT); sel->explicit_limit= 1; } ; @@ -9463,7 +9466,7 @@ insert_lock_option: | DELAYED_SYM { $$= TL_WRITE_DELAYED; - Lex->set_stmt_unsafe(); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_DELAYED); } | HIGH_PRIORITY { $$= TL_WRITE; } ; @@ -9473,7 +9476,7 @@ replace_lock_option: | DELAYED_SYM { $$= TL_WRITE_DELAYED; - Lex->set_stmt_unsafe(); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_INSERT_DELAYED); } ; diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 39e311fbd4b..c72d13df939 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -6861,10 +6861,9 @@ ha_innobase::external_lock( if (lock_type == F_WRLCK && !(table_flags() & HA_BINLOG_STMT_CAPABLE) && thd_binlog_format(thd) == BINLOG_FORMAT_STMT) { - int skip = 0; - /* used by test case */ - DBUG_EXECUTE_IF("no_innodb_binlog_errors", skip = 1;); - if (!skip) { + /* The error may be suppressed by test cases, by setting + the no_innodb_binlog_errors debug symbol. */ + if (DBUG_EVALUATE_IF("no_innodb_binlog_errors", 0, 1)) { my_error(ER_BINLOG_STMT_MODE_AND_ROW_ENGINE, MYF(0), " InnoDB is limited to row-logging when " "transaction isolation level is " From d88192976ccc2675d1e161817bd7e2e779896a85 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 22 Jul 2009 18:29:26 +0200 Subject: [PATCH 05/69] Post-push fix for BUG#39934 Moved decide_logging_format to sql_class.cc sql/sql_base.cc: Moved decide_logging_format to sql_class.cc The auxiliary macro FLAGSTR is not needed here any more. sql/sql_class.cc: - Moved decide_logging_format from sql_base.cc to here. - To avoid copying the FLAGSTR macro, I changed some DBUG_PRINT to just print flags in hex. No need to pretty-print debug traces. - Changed the type of 'flags' to handler::Table_flags because that's the return type of handler::ha_table_flags. --- sql/sql_base.cc | 298 ----------------------------------------------- sql/sql_class.cc | 292 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 292 insertions(+), 298 deletions(-) diff --git a/sql/sql_base.cc b/sql/sql_base.cc index bec50443ee4..d06967e2009 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -28,7 +28,6 @@ #include #endif -#define FLAGSTR(S,F) ((S) & (F) ? #F " " : "") /** This internal handler is used to trap internally @@ -5052,303 +5051,6 @@ static void mark_real_tables_as_free_for_reuse(TABLE_LIST *table) } -/** - Decide on logging format to use for the statement and issue errors - or warnings as needed. The decision depends on the following - parameters: - - - The logging mode, i.e., the value of binlog_format. Can be - statement, mixed, or row. - - - The type of statement. There are three types of statements: - "normal" safe statements; unsafe statements; and row injections. - An unsafe statement is one that, if logged in statement format, - might produce different results when replayed on the slave (e.g., - INSERT DELAYED). A row injection is either a BINLOG statement, or - a row event executed by the slave's SQL thread. - - - The capabilities of tables modified by the statement. The - *capabilities vector* for a table is a set of flags associated - with the table. Currently, it only includes two flags: *row - capability flag* and *statement capability flag*. - - The row capability flag is set if and only if the engine can - handle row-based logging. The statement capability flag is set if - and only if the table can handle statement-based logging. - - Decision table for logging format - --------------------------------- - - The following table summarizes how the format and generated - warning/error depends on the tables' capabilities, the statement - type, and the current binlog_format. - - Row capable N NNNNNNNNN YYYYYYYYY YYYYYYYYY - Statement capable N YYYYYYYYY NNNNNNNNN YYYYYYYYY - - Statement type * SSSUUUIII SSSUUUIII SSSUUUIII - - binlog_format * SMRSMRSMR SMRSMRSMR SMRSMRSMR - - Logged format - SS-SS---- -RR-RR-RR SRRSRR-RR - Warning/Error 1 --2332444 5--5--6-- ---7--6-- - - Legend - ------ - - Row capable: N - Some table not row-capable, Y - All tables row-capable - Stmt capable: N - Some table not stmt-capable, Y - All tables stmt-capable - Statement type: (S)afe, (U)nsafe, or Row (I)njection - binlog_format: (S)TATEMENT, (M)IXED, or (R)OW - Logged format: (S)tatement or (R)ow - Warning/Error: Warnings and error messages are as follows: - - 1. Error: Cannot execute statement: binlogging impossible since both - row-incapable engines and statement-incapable engines are - involved. - - 2. Error: Cannot execute statement: binlogging impossible since - BINLOG_FORMAT = ROW and at least one table uses a storage engine - limited to statement-logging. - - 3. Warning: Unsafe statement binlogged as statement since storage - engine is limited to statement-logging. - - 4. Error: Cannot execute row injection: binlogging impossible since - at least one table uses a storage engine limited to - statement-logging. - - 5. Error: Cannot execute statement: binlogging impossible since - BINLOG_FORMAT = STATEMENT and at least one table uses a storage - engine limited to row-logging. - - 6. Error: Cannot execute row injection: binlogging impossible since - BINLOG_FORMAT = STATEMENT. - - 7. Warning: Unsafe statement binlogged in statement format since - BINLOG_FORMAT = STATEMENT. - - In addition, we can produce the following error (not depending on - the variables of the decision diagram): - - 8. Error: Cannot execute statement: binlogging impossible since more - than one engine is involved and at least one engine is - self-logging. - - For each error case above, the statement is prevented from being - logged, we report an error, and roll back the statement. For - warnings, we set the thd->binlog_flags variable: the warning will be - printed only if the statement is successfully logged. - - @see THD::binlog_query - - @param[in] thd Client thread - @param[in] tables Tables involved in the query - - @retval 0 No error; statement can be logged. - @retval -1 One of the error conditions above applies (1, 2, 4, 5, or 6). -*/ - -int THD::decide_logging_format(TABLE_LIST *tables) -{ - DBUG_ENTER("THD::decide_logging_format"); - DBUG_PRINT("info", ("query: %s", query)); - DBUG_PRINT("info", ("variables.binlog_format: %ld", - variables.binlog_format)); - DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", - lex->get_stmt_unsafe_flags())); - if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG)) - { - /* - Compute one bit field with the union of all the engine - capabilities, and one with the intersection of all the engine - capabilities. - */ - handler::Table_flags flags_some_set= 0; - handler::Table_flags flags_all_set= - HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; - - my_bool multi_engine= FALSE; - void* prev_ht= NULL; - -#ifndef DBUG_OFF - { - static const char *prelocked_mode_name[] = { - "NON_PRELOCKED", - "PRELOCKED", - "PRELOCKED_UNDER_LOCK_TABLES", - }; - DBUG_PRINT("debug", ("prelocked_mode: %s", - prelocked_mode_name[prelocked_mode])); - } -#endif - - /* - Get the capabilities vector for all involved storage engines and - mask out the flags for the binary log. - */ - for (TABLE_LIST *table= tables; table; table= table->next_global) - { - if (table->placeholder()) - continue; - if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) - lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_TABLE); - if (table->lock_type >= TL_WRITE_ALLOW_WRITE) - { - ulonglong const flags= table->table->file->ha_table_flags(); - DBUG_PRINT("info", ("table: %s; ha_table_flags: %s%s", - table->table_name, - FLAGSTR(flags, HA_BINLOG_STMT_CAPABLE), - FLAGSTR(flags, HA_BINLOG_ROW_CAPABLE))); - if (prev_ht && prev_ht != table->table->file->ht) - multi_engine= TRUE; - prev_ht= table->table->file->ht; - flags_all_set &= flags; - flags_some_set |= flags; - } - } - - DBUG_PRINT("info", ("flags_all_set: %s%s", - FLAGSTR(flags_all_set, HA_BINLOG_STMT_CAPABLE), - FLAGSTR(flags_all_set, HA_BINLOG_ROW_CAPABLE))); - DBUG_PRINT("info", ("flags_some_set: %s%s", - FLAGSTR(flags_some_set, HA_BINLOG_STMT_CAPABLE), - FLAGSTR(flags_some_set, HA_BINLOG_ROW_CAPABLE))); - DBUG_PRINT("info", ("multi_engine: %s", - multi_engine ? "TRUE" : "FALSE")); - - int error= 0; - int unsafe_flags; - - /* - If more than one engine is involved in the statement and at - least one is doing it's own logging (is *self-logging*), the - statement cannot be logged atomically, so we generate an error - rather than allowing the binlog to become corrupt. - */ - if (multi_engine && - (flags_some_set & HA_HAS_OWN_BINLOGGING)) - { - my_error((error= ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE), - MYF(0)); - } - - /* both statement-only and row-only engines involved */ - if ((flags_all_set & (HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE)) == 0) - { - /* - 1. Error: Binary logging impossible since both row-incapable - engines and statement-incapable engines are involved - */ - my_error((error= ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE), MYF(0)); - } - /* statement-only engines involved */ - else if ((flags_all_set & HA_BINLOG_ROW_CAPABLE) == 0) - { - if (lex->is_stmt_row_injection()) - { - /* - 4. Error: Cannot execute row injection since table uses - storage engine limited to statement-logging - */ - my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0)); - } - else if (variables.binlog_format == BINLOG_FORMAT_ROW) - { - /* - 2. Error: Cannot modify table that uses a storage engine - limited to statement-logging when BINLOG_FORMAT = ROW - */ - my_error((error= ER_BINLOG_ROW_MODE_AND_STMT_ENGINE), MYF(0)); - } - else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) - { - /* - 3. Warning: Unsafe statement binlogged as statement since - storage engine is limited to statement-logging. - */ - binlog_unsafe_warning_flags|= - (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE) | - (unsafe_flags << BINLOG_STMT_WARNING_COUNT); - DBUG_PRINT("info", ("Scheduling warning to be issued by " - "binlog_query: %s", - ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE))); - DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x", - binlog_unsafe_warning_flags)); - } - /* log in statement format! */ - } - /* no statement-only engines */ - else - { - /* binlog_format = STATEMENT */ - if (variables.binlog_format == BINLOG_FORMAT_STMT) - { - if (lex->is_stmt_row_injection()) - { - /* - 6. Error: Cannot execute row injection since - BINLOG_FORMAT = STATEMENT - */ - my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_MODE), MYF(0)); - } - else if ((flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) - { - /* - 5. Error: Cannot modify table that uses a storage engine - limited to row-logging when binlog_format = STATEMENT - */ - my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), ""); - } - else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) - { - /* - 7. Warning: Unsafe statement logged as statement due to - binlog_format = STATEMENT - */ - binlog_unsafe_warning_flags|= - (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE) | - (unsafe_flags << BINLOG_STMT_WARNING_COUNT); - DBUG_PRINT("info", ("Scheduling warning to be issued by " - "binlog_query: '%s'", - ER(ER_BINLOG_UNSAFE_STATEMENT))); - DBUG_PRINT("info", ("binlog_stmt_flags: 0x%x", - binlog_unsafe_warning_flags)); - } - /* log in statement format! */ - } - /* No statement-only engines and binlog_format != STATEMENT. - I.e., nothing prevents us from row logging if needed. */ - else - { - if (lex->is_stmt_unsafe() || lex->is_stmt_row_injection() - || (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) - { - /* log in row format! */ - set_current_stmt_binlog_row_based_if_mixed(); - } - } - } - - if (error) { - DBUG_PRINT("info", ("decision: no logging since an error was generated")); - DBUG_RETURN(-1); - } - DBUG_PRINT("info", ("decision: logging in %s format", - is_current_stmt_binlog_format_row() ? - "ROW" : "STATEMENT")); - } -#ifndef DBUG_OFF - else - DBUG_PRINT("info", ("decision: no logging since " - "mysql_bin_log.is_open() = %d " - "and (options & OPTION_BIN_LOG) = 0x%llx", - mysql_bin_log.is_open(), (options & OPTION_BIN_LOG))); -#endif - - DBUG_RETURN(0); -} - /* Lock all tables in list diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 4f8f0a30544..fa6d14ba367 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3158,6 +3158,298 @@ void xid_cache_delete(XID_STATE *xid_state) pthread_mutex_unlock(&LOCK_xid_cache); } + +/** + Decide on logging format to use for the statement and issue errors + or warnings as needed. The decision depends on the following + parameters: + + - The logging mode, i.e., the value of binlog_format. Can be + statement, mixed, or row. + + - The type of statement. There are three types of statements: + "normal" safe statements; unsafe statements; and row injections. + An unsafe statement is one that, if logged in statement format, + might produce different results when replayed on the slave (e.g., + INSERT DELAYED). A row injection is either a BINLOG statement, or + a row event executed by the slave's SQL thread. + + - The capabilities of tables modified by the statement. The + *capabilities vector* for a table is a set of flags associated + with the table. Currently, it only includes two flags: *row + capability flag* and *statement capability flag*. + + The row capability flag is set if and only if the engine can + handle row-based logging. The statement capability flag is set if + and only if the table can handle statement-based logging. + + Decision table for logging format + --------------------------------- + + The following table summarizes how the format and generated + warning/error depends on the tables' capabilities, the statement + type, and the current binlog_format. + + Row capable N NNNNNNNNN YYYYYYYYY YYYYYYYYY + Statement capable N YYYYYYYYY NNNNNNNNN YYYYYYYYY + + Statement type * SSSUUUIII SSSUUUIII SSSUUUIII + + binlog_format * SMRSMRSMR SMRSMRSMR SMRSMRSMR + + Logged format - SS-SS---- -RR-RR-RR SRRSRR-RR + Warning/Error 1 --2332444 5--5--6-- ---7--6-- + + Legend + ------ + + Row capable: N - Some table not row-capable, Y - All tables row-capable + Stmt capable: N - Some table not stmt-capable, Y - All tables stmt-capable + Statement type: (S)afe, (U)nsafe, or Row (I)njection + binlog_format: (S)TATEMENT, (M)IXED, or (R)OW + Logged format: (S)tatement or (R)ow + Warning/Error: Warnings and error messages are as follows: + + 1. Error: Cannot execute statement: binlogging impossible since both + row-incapable engines and statement-incapable engines are + involved. + + 2. Error: Cannot execute statement: binlogging impossible since + BINLOG_FORMAT = ROW and at least one table uses a storage engine + limited to statement-logging. + + 3. Warning: Unsafe statement binlogged as statement since storage + engine is limited to statement-logging. + + 4. Error: Cannot execute row injection: binlogging impossible since + at least one table uses a storage engine limited to + statement-logging. + + 5. Error: Cannot execute statement: binlogging impossible since + BINLOG_FORMAT = STATEMENT and at least one table uses a storage + engine limited to row-logging. + + 6. Error: Cannot execute row injection: binlogging impossible since + BINLOG_FORMAT = STATEMENT. + + 7. Warning: Unsafe statement binlogged in statement format since + BINLOG_FORMAT = STATEMENT. + + In addition, we can produce the following error (not depending on + the variables of the decision diagram): + + 8. Error: Cannot execute statement: binlogging impossible since more + than one engine is involved and at least one engine is + self-logging. + + For each error case above, the statement is prevented from being + logged, we report an error, and roll back the statement. For + warnings, we set the thd->binlog_flags variable: the warning will be + printed only if the statement is successfully logged. + + @see THD::binlog_query + + @param[in] thd Client thread + @param[in] tables Tables involved in the query + + @retval 0 No error; statement can be logged. + @retval -1 One of the error conditions above applies (1, 2, 4, 5, or 6). +*/ + +int THD::decide_logging_format(TABLE_LIST *tables) +{ + DBUG_ENTER("THD::decide_logging_format"); + DBUG_PRINT("info", ("query: %s", query)); + DBUG_PRINT("info", ("variables.binlog_format: %ld", + variables.binlog_format)); + DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", + lex->get_stmt_unsafe_flags())); + if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG)) + { + /* + Compute one bit field with the union of all the engine + capabilities, and one with the intersection of all the engine + capabilities. + */ + handler::Table_flags flags_some_set= 0; + handler::Table_flags flags_all_set= + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; + + my_bool multi_engine= FALSE; + void* prev_ht= NULL; + +#ifndef DBUG_OFF + { + static const char *prelocked_mode_name[] = { + "NON_PRELOCKED", + "PRELOCKED", + "PRELOCKED_UNDER_LOCK_TABLES", + }; + DBUG_PRINT("debug", ("prelocked_mode: %s", + prelocked_mode_name[prelocked_mode])); + } +#endif + + /* + Get the capabilities vector for all involved storage engines and + mask out the flags for the binary log. + */ + for (TABLE_LIST *table= tables; table; table= table->next_global) + { + if (table->placeholder()) + continue; + if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_TABLE); + if (table->lock_type >= TL_WRITE_ALLOW_WRITE) + { + handler::Table_flags const flags= table->table->file->ha_table_flags(); + DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx", + table->table_name, flags)); + if (prev_ht && prev_ht != table->table->file->ht) + multi_engine= TRUE; + prev_ht= table->table->file->ht; + flags_all_set &= flags; + flags_some_set |= flags; + } + } + + DBUG_PRINT("info", ("flags_all_set: 0x%llx", flags_all_set)); + DBUG_PRINT("info", ("flags_some_set: 0x%llx", flags_some_set)); + DBUG_PRINT("info", ("multi_engine: %d", multi_engine)); + + int error= 0; + int unsafe_flags; + + /* + If more than one engine is involved in the statement and at + least one is doing it's own logging (is *self-logging*), the + statement cannot be logged atomically, so we generate an error + rather than allowing the binlog to become corrupt. + */ + if (multi_engine && + (flags_some_set & HA_HAS_OWN_BINLOGGING)) + { + my_error((error= ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE), + MYF(0)); + } + + /* both statement-only and row-only engines involved */ + if ((flags_all_set & (HA_BINLOG_STMT_CAPABLE | HA_BINLOG_ROW_CAPABLE)) == 0) + { + /* + 1. Error: Binary logging impossible since both row-incapable + engines and statement-incapable engines are involved + */ + my_error((error= ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE), MYF(0)); + } + /* statement-only engines involved */ + else if ((flags_all_set & HA_BINLOG_ROW_CAPABLE) == 0) + { + if (lex->is_stmt_row_injection()) + { + /* + 4. Error: Cannot execute row injection since table uses + storage engine limited to statement-logging + */ + my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE), MYF(0)); + } + else if (variables.binlog_format == BINLOG_FORMAT_ROW) + { + /* + 2. Error: Cannot modify table that uses a storage engine + limited to statement-logging when BINLOG_FORMAT = ROW + */ + my_error((error= ER_BINLOG_ROW_MODE_AND_STMT_ENGINE), MYF(0)); + } + else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) + { + /* + 3. Warning: Unsafe statement binlogged as statement since + storage engine is limited to statement-logging. + */ + binlog_unsafe_warning_flags|= + (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE) | + (unsafe_flags << BINLOG_STMT_WARNING_COUNT); + DBUG_PRINT("info", ("Scheduling warning to be issued by " + "binlog_query: %s", + ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE))); + DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x", + binlog_unsafe_warning_flags)); + } + /* log in statement format! */ + } + /* no statement-only engines */ + else + { + /* binlog_format = STATEMENT */ + if (variables.binlog_format == BINLOG_FORMAT_STMT) + { + if (lex->is_stmt_row_injection()) + { + /* + 6. Error: Cannot execute row injection since + BINLOG_FORMAT = STATEMENT + */ + my_error((error= ER_BINLOG_ROW_INJECTION_AND_STMT_MODE), MYF(0)); + } + else if ((flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) + { + /* + 5. Error: Cannot modify table that uses a storage engine + limited to row-logging when binlog_format = STATEMENT + */ + my_error((error= ER_BINLOG_STMT_MODE_AND_ROW_ENGINE), MYF(0), ""); + } + else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) + { + /* + 7. Warning: Unsafe statement logged as statement due to + binlog_format = STATEMENT + */ + binlog_unsafe_warning_flags|= + (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE) | + (unsafe_flags << BINLOG_STMT_WARNING_COUNT); + DBUG_PRINT("info", ("Scheduling warning to be issued by " + "binlog_query: '%s'", + ER(ER_BINLOG_UNSAFE_STATEMENT))); + DBUG_PRINT("info", ("binlog_stmt_flags: 0x%x", + binlog_unsafe_warning_flags)); + } + /* log in statement format! */ + } + /* No statement-only engines and binlog_format != STATEMENT. + I.e., nothing prevents us from row logging if needed. */ + else + { + if (lex->is_stmt_unsafe() || lex->is_stmt_row_injection() + || (flags_all_set & HA_BINLOG_STMT_CAPABLE) == 0) + { + /* log in row format! */ + set_current_stmt_binlog_row_based_if_mixed(); + } + } + } + + if (error) { + DBUG_PRINT("info", ("decision: no logging since an error was generated")); + DBUG_RETURN(-1); + } + DBUG_PRINT("info", ("decision: logging in %s format", + is_current_stmt_binlog_format_row() ? + "ROW" : "STATEMENT")); + } +#ifndef DBUG_OFF + else + DBUG_PRINT("info", ("decision: no logging since " + "mysql_bin_log.is_open() = %d " + "and (options & OPTION_BIN_LOG) = 0x%llx", + mysql_bin_log.is_open(), (options & OPTION_BIN_LOG))); +#endif + + DBUG_RETURN(0); +} + + /* Implementation of interface to write rows to the binary log through the thread. The thread is responsible for writing the rows it has From fa32b4f29618a43cd989e997bb4ff3079ffe914a Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 22 Jul 2009 22:14:20 +0200 Subject: [PATCH 06/69] Post-push fixes for BUG#39934 Suppress warnings if binlog_format=STATEMENT and the current database is filtered out using --binlog-[do|ignore]-db. This was a regression in my previous patch. mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result: updated result file mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt: Added binlog filtering rule. mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test: Added tests that no error is printed when table is filtered out by binlog filtering rules. sql/sql_class.cc: Don't decide logging format if the statement is filtered out from the binlog using binlog filtering rules. --- .../binlog/r/binlog_stm_unsafe_warning.result | 4 -- .../r/rpl_ndb_binlog_format_errors.result | 32 ++++++++---- .../t/rpl_ndb_binlog_format_errors-master.opt | 2 +- .../t/rpl_ndb_binlog_format_errors.test | 51 +++++++++++++++---- sql/sql_class.cc | 19 +++++-- 5 files changed, 80 insertions(+), 28 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index 463da7b2bdf..fc20f21cde0 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -25,10 +25,6 @@ DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a int, b int, primary key (a)); INSERT INTO t1 VALUES (1,2), (2,3); UPDATE t1 SET b='4' WHERE a=1 LIMIT 1; -Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1; -Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1; DROP DATABASE b42851; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result index fbb02b15d29..b7a5c09b756 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -16,11 +16,16 @@ CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB; CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB; CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM; +CREATE DATABASE other; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; [on slave] DROP TABLE t_slave_stmt; CREATE TABLE t_slave_stmt (a INT) ENGINE = EXAMPLE; [on master] +BINLOG ' +1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; ==== Test ==== ---- binlog_format=row ---- * Modify tables of more than one engine, one of which is self-logging @@ -45,10 +50,6 @@ set global sql_slave_skip_counter=1; include/start_slave.inc * Row injection and stmt-only table: use BINLOG statement BINLOG ' -1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC -'; -BINLOG ' 1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= 1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= '; @@ -77,23 +78,35 @@ SET @@session.binlog_format = STATEMENT; INSERT INTO t_row VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. * Row-only engine and binlog_format=statement: generic message -SET @@session.debug= "+d,no_innodb_binlog_errors"; +SET @@session.debug= '+d,no_innodb_binlog_errors'; INSERT INTO t_row VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. +* Same statement, but db filtered out - no error +USE other; +INSERT INTO test.t_row VALUES (1); +USE test; +SET @@session.debug= ''; * Row injection and binlog_format=statement: BINLOG statement BINLOG ' -b9pVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAABv2lVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC -'; -BINLOG ' cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= '; ERROR HY000: Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT. +* Same statement, but db filtered out - no error +USE other; +BINLOG ' +cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB +cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= +'; +USE test; * Unsafe statement and binlog_format=statement INSERT INTO t VALUES (UUID()); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +* Same statement, but db filtered out - no message +USE other; +INSERT INTO test.t VALUES (UUID()); +USE test; ---- master: binlog_format=mixed, slave: binlog_format=statement ---- SET @@global.binlog_format = MIXED; SET @@session.binlog_format = MIXED; @@ -107,6 +120,7 @@ include/start_slave.inc [on master] ==== Clean up ==== DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt; +DROP DATABASE other; SET @@global.binlog_format = @old_binlog_format; SET @@session.binlog_format = @old_binlog_format; UNINSTALL PLUGIN example; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt index ffa981152ea..efea2bf1db5 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors-master.opt @@ -1 +1 @@ ---innodb $EXAMPLE_PLUGIN_OPT +--innodb $EXAMPLE_PLUGIN_OPT --binlog-ignore-db=other diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test index 18a6aac8c5d..7d3758bc969 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -51,6 +51,9 @@ CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB; CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB; CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM; + +CREATE DATABASE other; + # This makes the innodb table row-only SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; @@ -63,6 +66,14 @@ CREATE TABLE t_slave_stmt (a INT) ENGINE = EXAMPLE; --echo [on master] --connection master +# This is a format description event. It is needed because any BINLOG +# statement containing a row event must be preceded by a BINLOG +# statement containing a format description event. +BINLOG ' +1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC +'; + --echo ==== Test ==== @@ -94,11 +105,6 @@ INSERT INTO t_slave_stmt VALUES (1); --source include/wait_for_slave_sql_error_and_skip.inc --echo * Row injection and stmt-only table: use BINLOG statement -# This is a format description event -BINLOG ' -1gRVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC -'; # This is a Table_map_event and a Write_rows_event. Together, they are # equivalent to 'INSERT INTO t_stmt VALUES (1)' --error ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE @@ -141,17 +147,24 @@ SET @@session.binlog_format = STATEMENT; --error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE INSERT INTO t_row VALUES (1); +# Commented out since innodb gives an error (this is a bug) +#--echo * Same statement, but db filtered out - no error +#USE other; +#INSERT INTO test.t_row VALUES (1); +#USE test; + --echo * Row-only engine and binlog_format=statement: generic message -SET @@session.debug= "+d,no_innodb_binlog_errors"; +SET @@session.debug= '+d,no_innodb_binlog_errors'; --error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE INSERT INTO t_row VALUES (1); +--echo * Same statement, but db filtered out - no error +USE other; +INSERT INTO test.t_row VALUES (1); +USE test; +SET @@session.debug= ''; + --echo * Row injection and binlog_format=statement: BINLOG statement -# This is a format description event -BINLOG ' -b9pVSg8BAAAAZgAAAGoAAAABAAQANS4xLjM2LWRlYnVnLWxvZwAAAAAAAAAAAAAAAAAAAAAAAAAA -AAAAAAAAAAAAAAAAAABv2lVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC -'; # This is a Table_map_event and a Write_rows_event. Together, they are # equivalent to 'INSERT INTO t VALUES (1)'. --error ER_BINLOG_ROW_INJECTION_AND_STMT_MODE @@ -160,10 +173,25 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= '; +--echo * Same statement, but db filtered out - no error +# This is a Table_map_event and a Write_rows_event. Together, they are +# equivalent to 'INSERT INTO t VALUES (1)'. +USE other; +BINLOG ' +cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB +cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= +'; +USE test; + --echo * Unsafe statement and binlog_format=statement # This will give a warning. INSERT INTO t VALUES (UUID()); +--echo * Same statement, but db filtered out - no message +USE other; +INSERT INTO test.t VALUES (UUID()); +USE test; + --echo ---- master: binlog_format=mixed, slave: binlog_format=statement ---- @@ -186,6 +214,7 @@ INSERT INTO t VALUES (UUID()); --echo ==== Clean up ==== DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt; +DROP DATABASE other; SET @@global.binlog_format = @old_binlog_format; SET @@session.binlog_format = @old_binlog_format; UNINSTALL PLUGIN example; diff --git a/sql/sql_class.cc b/sql/sql_class.cc index fa6d14ba367..c8661ab322e 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3264,7 +3264,15 @@ int THD::decide_logging_format(TABLE_LIST *tables) variables.binlog_format)); DBUG_PRINT("info", ("lex->get_stmt_unsafe_flags(): 0x%x", lex->get_stmt_unsafe_flags())); - if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG)) + + /* + We should not decide logging format if the binlog is closed or + binlogging is off, or if the statement is filtered out from the + binlog by filtering rules. + */ + if (mysql_bin_log.is_open() && (options & OPTION_BIN_LOG) && + !(variables.binlog_format == BINLOG_FORMAT_STMT && + !binlog_filter->db_ok(db))) { /* Compute one bit field with the union of all the engine @@ -3442,8 +3450,13 @@ int THD::decide_logging_format(TABLE_LIST *tables) else DBUG_PRINT("info", ("decision: no logging since " "mysql_bin_log.is_open() = %d " - "and (options & OPTION_BIN_LOG) = 0x%llx", - mysql_bin_log.is_open(), (options & OPTION_BIN_LOG))); + "and (options & OPTION_BIN_LOG) = 0x%llx " + "and binlog_format = %d " + "and binlog_filter->db_ok(db) = %d", + mysql_bin_log.is_open(), + (options & OPTION_BIN_LOG), + variables.binlog_format, + binlog_filter->db_ok(db))); #endif DBUG_RETURN(0); From bfb1de9c065b6e9fd6b9fecb1c2db2b4475d3135 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 19 Aug 2009 13:38:30 +0200 Subject: [PATCH 07/69] post-push fixes for BUG#39934 Removed hard-coded error messages. All messages are now in errmsg.txt Also renamed enumeration value BINLOG_STMT_UNSAFE_FUNCTION to BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION to make the naming consistent with BINLOG_STMT_UNSAFE_SYSTEM_VARIABLE. sql/item_create.cc: Renamed BINLOG_STMT_UNSAFE_FUNCTION to BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION sql/share/errmsg.txt: Moved hard-coded strings from THD::issue_unsafe_warnings() to errmsg.txt. sql/sql_class.cc: - Moved error messages to errmsg.txt. - Updated comment above THD::issue_unsafe_warnings(). sql/sql_lex.h: Renamed BINLOG_STMT_UNSAFE_FUNCTION to BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION sql/sql_yacc.yy: Renamed BINLOG_STMT_UNSAFE_FUNCTION to BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION --- sql/item_create.cc | 10 +++++----- sql/share/errmsg.txt | 20 ++++++++++++++++++++ sql/sql_class.cc | 29 +++++++++++++++-------------- sql/sql_lex.h | 2 +- sql/sql_yacc.yy | 4 ++-- 5 files changed, 43 insertions(+), 22 deletions(-) diff --git a/sql/item_create.cc b/sql/item_create.cc index c124128b3f8..09303e00ea6 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -3365,7 +3365,7 @@ Item* Create_func_found_rows::create(THD *thd) { DBUG_ENTER("Create_func_found_rows::create"); - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_found_rows()); } @@ -3794,7 +3794,7 @@ Item* Create_func_load_file::create(THD *thd, Item *arg1) { DBUG_ENTER("Create_func_load_file::create"); - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->uncacheable(UNCACHEABLE_SIDEEFFECT); DBUG_RETURN(new (thd->mem_root) Item_load_file(arg1)); } @@ -4264,7 +4264,7 @@ Item* Create_func_row_count::create(THD *thd) { DBUG_ENTER("Create_func_row_count::create"); - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_row_count()); } @@ -4574,7 +4574,7 @@ Item* Create_func_uuid::create(THD *thd) { DBUG_ENTER("Create_func_uuid::create"); - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_uuid()); } @@ -4586,7 +4586,7 @@ Item* Create_func_uuid_short::create(THD *thd) { DBUG_ENTER("Create_func_uuid_short::create"); - thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + thd->lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); thd->lex->safe_to_cache_query= 0; DBUG_RETURN(new (thd->mem_root) Item_func_uuid_short()); } diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 1f466dd3db6..1dbab075614 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6215,3 +6215,23 @@ ER_BINLOG_ROW_INJECTION_AND_STMT_MODE eng "Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT." ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE eng "Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging." + +ER_BINLOG_UNSAFE_LIMIT + eng "Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted." +ER_BINLOG_UNSAFE_INSERT_DELAYED + eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted." +ER_BINLOG_UNSAFE_SYSTEM_TABLE + eng "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave." +ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS + eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave." +ER_BINLOG_UNSAFE_UDF + eng "Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave." +ER_BINLOG_UNSAFE_SYSTEM_VARIABLE + eng "Statement uses a system variable whose value may differ on slave." +ER_BINLOG_UNSAFE_SYSTEM_FUNCTION + eng "Statement uses a system function whose value may differ on slave." + +ER_BINLOG_UNSAFE_WARNING_SHORT + eng "%s Reason: %s" +ER_BINLOG_UNSAFE_WARNING_LONG + eng "%s Reason: %s Statement: %s" diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c8661ab322e..6cd4fbb5e38 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3942,7 +3942,8 @@ show_query_type(THD::enum_binlog_query_type qtype) /** Auxiliary method used by @c binlog_query() to raise warnings. - @param err An ER_BINLOG_UNSAFE_* constant; the warning to print. + The type of warning and the type of unsafeness is stored in + THD::binlog_unsafe_warning_flags. */ void THD::issue_unsafe_warnings() { @@ -3958,15 +3959,15 @@ void THD::issue_unsafe_warnings() @note The order of the elements of this array must correspond to the order of elements in enum_binlog_stmt_unsafe. */ - static const char *explanations[LEX::BINLOG_STMT_UNSAFE_COUNT] = + static const int explanations[LEX::BINLOG_STMT_UNSAFE_COUNT] = { - "Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.", - "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted.", - "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave.", - "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave.", - "Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave.", - "Statement uses a system variable whose value may differ on slave.", - "Statement uses a system function whose value may differ on slave." + ER_BINLOG_UNSAFE_LIMIT, + ER_BINLOG_UNSAFE_INSERT_DELAYED, + ER_BINLOG_UNSAFE_SYSTEM_TABLE, + ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS, + ER_BINLOG_UNSAFE_UDF, + ER_BINLOG_UNSAFE_SYSTEM_VARIABLE, + ER_BINLOG_UNSAFE_SYSTEM_FUNCTION }; uint32 flags= binlog_unsafe_warning_flags; /* No warnings (yet) for this statement. */ @@ -3977,7 +3978,7 @@ void THD::issue_unsafe_warnings() uint32 unsafe_type_flags= flags >> BINLOG_STMT_WARNING_COUNT; DBUG_ASSERT((unsafe_type_flags & LEX::BINLOG_STMT_UNSAFE_ALL_FLAGS) != 0); /* - Clear (1) bits above BINLOG_STMT_UNSAFE_COUNT; (2) bits for + Clear: (1) bits above BINLOG_STMT_UNSAFE_COUNT; (2) bits for warnings that have been printed already. */ unsafe_type_flags &= (LEX::BINLOG_STMT_UNSAFE_ALL_FLAGS ^ @@ -4010,10 +4011,10 @@ void THD::issue_unsafe_warnings() if ((unsafe_type_flags & (1 << unsafe_type)) != 0) { push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, err, - "%s Reason: %s", - ER(err), explanations[unsafe_type]); - sql_print_warning("%s Reason: %s Statement: %s", - ER(err), explanations[unsafe_type], query); + ER(ER_BINLOG_UNSAFE_WARNING_SHORT), + ER(err), ER(explanations[unsafe_type])); + sql_print_warning(ER(ER_BINLOG_UNSAFE_WARNING_LONG), + ER(err), ER(explanations[unsafe_type]), query); } } /* diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 17ef4e7abd1..0ac4f526e5a 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1087,7 +1087,7 @@ public: /** Using some functions is unsafe (e.g., UUID). */ - BINLOG_STMT_UNSAFE_FUNCTION, + BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION, /* The last element of this enumeration type. */ BINLOG_STMT_UNSAFE_COUNT diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index bf8479894f6..8dbb19a9cbd 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7213,7 +7213,7 @@ function_call_keyword: $$= new (YYTHD->mem_root) Item_func_current_user(Lex->current_context()); if ($$ == NULL) MYSQL_YYABORT; - Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); Lex->safe_to_cache_query= 0; } | DATE_SYM '(' expr ')' @@ -7368,7 +7368,7 @@ function_call_keyword: $$= new (YYTHD->mem_root) Item_func_user(); if ($$ == NULL) MYSQL_YYABORT; - Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_FUNCTION); + Lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION); Lex->safe_to_cache_query=0; } | YEAR_SYM '(' expr ')' From 613068c10a64400b364b31552f5f12897645b4d3 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 30 Sep 2009 18:20:52 +0200 Subject: [PATCH 08/69] post-merge fixes to make tests pass after merging BUG#39934 to 5.1-rep+3. --- mysql-test/r/sp_trans.result | 2 -- mysql-test/t/sp_trans.test | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/sp_trans.result b/mysql-test/r/sp_trans.result index 49bc70473dd..3cc251bc0a6 100644 --- a/mysql-test/r/sp_trans.result +++ b/mysql-test/r/sp_trans.result @@ -506,8 +506,6 @@ select count(*)*255 from t3 into table_size; until table_size > max_table_size*2 end repeat; end| call bug14210_fill_table()| -Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. drop procedure bug14210_fill_table| create table t4 like t3| create procedure bug14210() diff --git a/mysql-test/t/sp_trans.test b/mysql-test/t/sp_trans.test index 0b04b9d7668..4c9eb985adf 100644 --- a/mysql-test/t/sp_trans.test +++ b/mysql-test/t/sp_trans.test @@ -527,7 +527,9 @@ begin select count(*)*255 from t3 into table_size; until table_size > max_table_size*2 end repeat; end| +--disable_warnings call bug14210_fill_table()| +--enable_warnings drop procedure bug14210_fill_table| create table t4 like t3| From 89f8e5eff3b4dea09eff2135348ed41af33e1063 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 30 Sep 2009 17:53:58 +0100 Subject: [PATCH 09/69] Fixes tree_name for tree mysql-5.1-rep+3. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index f044f8e62da..d07d0e6178d 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.1" +tree_name = "mysql-5.1-rep+3" From 66481aebb0300678b0882f0f60b43cb2025a3285 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Wed, 14 Oct 2009 18:32:08 +0200 Subject: [PATCH 10/69] BUG#39934: Slave stops for engine that only support row-based logging Post-push fix. Problem: After the original bugfix, if a statement is unsafe, binlog_format=mixed, and engine is statement-only, a warning was generated and the statement executed. However, it is a fundamental principle of binlogging that binlog_format=mixed should guarantee correct logging, no compromise. So correct behavior is to generate an error and don't execute the statement. Fix: Generate error instead of warning. Since issue_unsafe_warnings can only generate one error message, this allows us to simplify the code a bit too: decide_logging_format does not have to save the error code for issue_unsafe_warnings mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result: updated result file mysql-test/suite/binlog/r/binlog_stm_ps.result: updated result file mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result: updated result file mysql-test/suite/binlog/r/binlog_unsafe.result: updated result file mysql-test/suite/rpl/r/rpl_stm_found_rows.result: updated result file mysql-test/suite/rpl/r/rpl_stm_loadfile.result: updated result file mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result: updated result file mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test: updated test: - ER_BINLOG_UNSAFE_AND_STMT_ENGINE is now an error. - added test for multiple types of unsafety sql/share/errmsg.txt: - Reformulated ER_BINLOG_UNSAFE_AND_STMT_ENGINE to reflect that it is now an error, not a warning. - Added "Reason for unsafeness" to ER_BINLOG_UNSAFE_STATEMENT and ER_BINLOG_UNSAFE_AND_STMT_ENGINE. sql/sql_class.cc: In decide_logging_format: - generate an error immediately in case 3, instead of scheduling a warning to be generated later. also updated comments accordingly - in case 7, there is only one unsafe warning error code now, so we don't need to store it in binlog_unsafe_warning_flags (see changes in sql_lex.h) - fixed compilation warning in DBUG_PRINT In issue_binlog_warning: - moved array of error codes to sql_lex.h (so that they are accessible also from decide_logging_format) - simplified code after the first set of bits in binlog_unsafe_warning_flags was removed sql/sql_class.h: - got rid of enum_binlog_stmt_warning. It's not needed anymore since we only have one type of unsafe warning (one of them turned into an error) - updated comments accordingly sql/sql_lex.cc: added initialization of the array of error codes that has been moved from THD::issue_unsafe_warnings to LEX. sql/sql_lex.h: Moved array of error codes from THD::issue_unsafe_warnings to LEX. --- .../r/binlog_statement_insert_delayed.result | 4 +- .../suite/binlog/r/binlog_stm_ps.result | 2 +- .../binlog/r/binlog_stm_unsafe_warning.result | 8 +- .../suite/binlog/r/binlog_unsafe.result | 706 +++++++++--------- .../suite/rpl/r/rpl_stm_found_rows.result | 4 +- .../suite/rpl/r/rpl_stm_loadfile.result | 4 +- .../r/rpl_ndb_binlog_format_errors.result | 14 +- .../t/rpl_ndb_binlog_format_errors.test | 15 +- sql/share/errmsg.txt | 10 +- sql/sql_class.cc | 92 +-- sql/sql_class.h | 31 +- sql/sql_lex.cc | 17 + sql/sql_lex.h | 5 + 13 files changed, 450 insertions(+), 462 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 2968dcffa20..8723e810976 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -13,10 +13,10 @@ master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. insert delayed into t1 values (null),(null),(400),(null); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. select * from t1; a 207 diff --git a/mysql-test/suite/binlog/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result index b01ef8929d9..e294a8127c7 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ps.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result @@ -11,7 +11,7 @@ prepare s from "insert into t1 select 100 limit ?"; set @a=100; execute s using @a; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int) diff --git a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result index bbe69fd1c14..3186f29f106 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result +++ b/mysql-test/suite/binlog/r/binlog_stm_unsafe_warning.result @@ -4,10 +4,10 @@ CREATE TABLE t1 (a int, b int, primary key (a)); INSERT INTO t1 VALUES (1,2), (2,3); UPDATE t1 SET b='4' WHERE a=1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. UPDATE t1 SET b='5' WHERE a=2 ORDER BY a LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1; ### NOT filtered database => assertion: binlog disabled and warnings ARE NOT shown SET SQL_LOG_BIN= 0; @@ -38,11 +38,11 @@ CREATE TABLE t1 (a VARCHAR(36), b VARCHAR(10)); SET GLOBAL LOG_WARNINGS = 0; INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. SET GLOBAL LOG_WARNINGS = 1; INSERT INTO t1 VALUES(UUID(), 'Bug#46265'); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. DROP TABLE t1; SET GLOBAL log_warnings = @old_log_warnings; # Count the number of times the "Unsafe" message was printed diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 0243693c120..e5a667b094a 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -35,7 +35,7 @@ CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUE * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -46,7 +46,7 @@ CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUE * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -58,7 +58,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -68,7 +68,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALU * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -88,7 +88,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -96,11 +96,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UUID() function. CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -112,7 +112,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -123,7 +123,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -132,7 +132,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -142,7 +142,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -164,7 +164,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -172,11 +172,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UUID() function. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -186,7 +186,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -197,7 +197,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALU * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -206,7 +206,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -216,7 +216,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -238,7 +238,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -248,7 +248,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -259,7 +259,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -268,7 +268,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -278,7 +278,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -300,7 +300,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -310,7 +310,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -319,11 +319,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe UUID() function. CREATE VIEW view_retval_1 AS SELECT UUID(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -334,7 +334,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -344,7 +344,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -362,7 +362,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -370,11 +370,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe UUID() function. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -386,7 +386,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -397,7 +397,7 @@ PREPARE prep_1 FROM "INSERT INTO t0 VALUES (UUID())"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -406,7 +406,7 @@ Invoking unsafe UUID() function. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 VALUES (UUID()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -419,7 +419,7 @@ CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUE * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -430,7 +430,7 @@ CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUE * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -442,7 +442,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -452,7 +452,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALU * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -472,7 +472,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -480,11 +480,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe @@hostname variable. CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -496,7 +496,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -507,7 +507,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -516,7 +516,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -526,7 +526,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -548,7 +548,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -556,11 +556,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe @@hostname variable. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -570,7 +570,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -581,7 +581,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALU * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -590,7 +590,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -600,7 +600,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -622,7 +622,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -632,7 +632,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -643,7 +643,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -652,7 +652,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -662,7 +662,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -684,7 +684,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -694,7 +694,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -705,7 +705,7 @@ PREPARE prep_1 FROM "INSERT INTO t0 VALUES (@@hostname)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -714,7 +714,7 @@ Invoking unsafe @@hostname variable. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 VALUES (@@hostname); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -725,7 +725,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -734,7 +734,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -744,7 +744,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -766,7 +766,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -774,11 +774,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe SELECT...LIMIT statement. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -788,7 +788,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -799,7 +799,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -808,7 +808,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -818,7 +818,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -840,7 +840,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -850,7 +850,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -861,7 +861,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -870,7 +870,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -880,7 +880,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -902,7 +902,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -912,7 +912,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -921,11 +921,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE VIEW view_retval_1 AS SELECT * FROM data_table LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -936,7 +936,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -946,7 +946,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -964,7 +964,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -972,11 +972,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe SELECT...LIMIT statement. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -988,7 +988,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -999,7 +999,7 @@ PREPARE prep_1 FROM "INSERT INTO t0 SELECT * FROM data_table LIMIT 1"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -1008,7 +1008,7 @@ Invoking unsafe SELECT...LIMIT statement. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 SELECT * FROM data_table LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1021,7 +1021,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1030,7 +1030,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1040,7 +1040,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1062,7 +1062,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1070,11 +1070,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe INSERT DELAYED statement. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -1084,7 +1084,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1095,7 +1095,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1104,7 +1104,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1114,7 +1114,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1136,7 +1136,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1146,7 +1146,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1157,7 +1157,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1166,7 +1166,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1176,7 +1176,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1198,7 +1198,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1208,7 +1208,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1219,7 +1219,7 @@ PREPARE prep_1 FROM "INSERT DELAYED INTO t0 VALUES (1), (2)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -1228,7 +1228,7 @@ Invoking unsafe INSERT DELAYED statement. * binlog_format = STATEMENT: expect 1 warnings. INSERT DELAYED INTO t0 VALUES (1), (2); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1442,7 +1442,7 @@ CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUE * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 VALUES (func_retval_1()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1453,7 +1453,7 @@ CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUE * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 VALUES (func_retval_2()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1465,7 +1465,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1475,7 +1475,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALU * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1495,7 +1495,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1503,11 +1503,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. CREATE VIEW view_retval_2 AS SELECT func_retval_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -1519,7 +1519,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1530,7 +1530,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1539,7 +1539,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1549,7 +1549,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1571,7 +1571,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1579,11 +1579,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -1593,7 +1593,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1604,7 +1604,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALU * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1613,7 +1613,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1623,7 +1623,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1645,7 +1645,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1655,7 +1655,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1666,7 +1666,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1675,7 +1675,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1685,7 +1685,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1707,7 +1707,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1717,7 +1717,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1726,11 +1726,11 @@ DROP TRIGGER trig_1; Invoking view view_sidef_1 invoking unsafe UDF. CREATE VIEW view_sidef_1 AS SELECT myfunc_int(10); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_sidef_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1739,7 +1739,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1749,7 +1749,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1767,7 +1767,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1775,11 +1775,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -1789,7 +1789,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1800,7 +1800,7 @@ PREPARE prep_1 FROM "INSERT INTO t0 VALUES (myfunc_int(10))"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -1809,7 +1809,7 @@ Invoking unsafe UDF. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 VALUES (myfunc_int(10)); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1820,7 +1820,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1829,7 +1829,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1839,7 +1839,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1861,7 +1861,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1869,11 +1869,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -1883,7 +1883,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1894,7 +1894,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1911,7 +1911,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1921,7 +1921,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1940,7 +1940,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1950,7 +1950,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -1969,7 +1969,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1978,7 +1978,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1988,7 +1988,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2010,7 +2010,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2020,7 +2020,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2029,11 +2029,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE VIEW view_retval_1 AS SELECT COUNT(*) FROM mysql.general_log; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2044,7 +2044,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2054,7 +2054,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2072,7 +2072,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2080,11 +2080,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2096,7 +2096,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2107,7 +2107,7 @@ PREPARE prep_1 FROM "INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -2116,7 +2116,7 @@ Invoking unsafe use of mysql.general_log. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2129,12 +2129,12 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2143,12 +2143,12 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2158,12 +2158,12 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 6 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2187,12 +2187,12 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2200,21 +2200,21 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -2224,12 +2224,12 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 6 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2240,12 +2240,12 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO * binlog_format = STATEMENT: expect 6 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2254,12 +2254,12 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2269,12 +2269,12 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 6 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2298,12 +2298,12 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2313,12 +2313,12 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 6 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2329,12 +2329,12 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2343,12 +2343,12 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2358,12 +2358,12 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 6 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2387,12 +2387,12 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 6 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2402,12 +2402,12 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 6 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2418,12 +2418,12 @@ PREPARE prep_1 FROM "INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID * binlog_format = STATEMENT: expect 6 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -2432,12 +2432,12 @@ Invoking statement that is unsafe in many ways. * binlog_format = STATEMENT: expect 6 warnings. INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2448,8 +2448,8 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2458,8 +2458,8 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2469,8 +2469,8 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 2 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2494,8 +2494,8 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2503,13 +2503,13 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -2519,8 +2519,8 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 2 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2531,8 +2531,8 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VAL * binlog_format = STATEMENT: expect 2 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2551,8 +2551,8 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2562,8 +2562,8 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 2 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2584,8 +2584,8 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2595,8 +2595,8 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 2 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2617,8 +2617,8 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2627,8 +2627,8 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2638,8 +2638,8 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 2 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2663,8 +2663,8 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2674,8 +2674,8 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 2 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2684,13 +2684,13 @@ DROP TRIGGER trig_1; Invoking view view_sidef_1 invoking statement that is unsafe several times. CREATE VIEW view_sidef_1 AS SELECT multi_unsafe_func(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t1 SELECT * FROM view_sidef_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2699,8 +2699,8 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2710,8 +2710,8 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 2 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. Failure! Event number 3 was a 'Query', not a 'Table_map'. @@ -2731,8 +2731,8 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2740,13 +2740,13 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times. CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -2756,8 +2756,8 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; * binlog_format = STATEMENT: expect 2 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2768,8 +2768,8 @@ PREPARE prep_1 FROM "INSERT INTO ta0 VALUES (multi_unsafe_func())"; * binlog_format = STATEMENT: expect 2 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -2778,8 +2778,8 @@ Invoking statement that is unsafe several times. * binlog_format = STATEMENT: expect 2 warnings. INSERT INTO ta0 VALUES (multi_unsafe_func()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER double_autoinc_trig; @@ -2817,24 +2817,24 @@ INSERT INTO autoinc_table VALUES (NULL); The following variables *should* give a warning, despite they are replicated. INSERT INTO t1 VALUES (@@session.sql_mode); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. INSERT INTO t1 VALUES (@@session.insert_id); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. DROP TABLE t1, autoinc_table; CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b)); INSERT INTO t1 SELECT * FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. REPLACE INTO t1 SELECT * FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. UPDATE t1 SET a=1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DELETE FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. CREATE PROCEDURE p1() BEGIN INSERT INTO t1 SELECT * FROM t1 LIMIT 1; @@ -2844,7 +2844,7 @@ DELETE FROM t1 LIMIT 1; END| CALL p1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP PROCEDURE p1; DROP TABLE t1; DROP TABLE IF EXISTS t1; @@ -2852,7 +2852,7 @@ CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100)); INSERT INTO t1 VALUES ('a','b'); UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1; DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1(i INT PRIMARY KEY); @@ -2861,7 +2861,7 @@ CREATE TABLE t3(i INT, ch CHAR(50)); "Should issue message Statement may not be safe to log in statement format." INSERT INTO t1 SELECT * FROM t2 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. CREATE FUNCTION func6() RETURNS INT BEGIN @@ -2873,7 +2873,7 @@ END| "Should issue message Statement may not be safe to log in statement format only once" INSERT INTO t3 VALUES(func6(), UUID()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. "Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements" CREATE FUNCTION fun_check_log_bin() RETURNS INT BEGIN @@ -2886,7 +2886,7 @@ SELECT fun_check_log_bin(); fun_check_log_bin() 100 Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. "SQL_LOG_BIN should be ON still" SHOW VARIABLES LIKE "SQL_LOG_BIN"; Variable_name Value @@ -2942,16 +2942,16 @@ CREATE TABLE t1(i INT PRIMARY KEY); CREATE TABLE t2(i INT PRIMARY KEY); INSERT INTO t1 SELECT * FROM t2 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. INSERT INTO t1 VALUES(@@global.sync_binlog); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. UPDATE t1 SET i = 999 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DELETE FROM t1 LIMIT 1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. DROP TABLE t1, t2; SET @@SESSION.SQL_MODE = @save_sql_mode; SET @old_binlog_format = @@session.binlog_format; diff --git a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result index cff694318b3..b12dda3e66b 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result +++ b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result @@ -52,8 +52,8 @@ a a 7 Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. CREATE PROCEDURE just_log(sect INT, test INT, found_rows INT) BEGIN INSERT INTO logtbl VALUES (sect,test,found_rows); END $$ diff --git a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result index 6a1475485f7..3551e38d5ef 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result @@ -10,7 +10,7 @@ CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a)); INSERT INTO test.t1 VALUES(1,'test'); UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. create procedure test.p1() begin INSERT INTO test.t1 VALUES(2,'test'); @@ -18,7 +18,7 @@ UPDATE test.t1 SET blob_column=LOAD_FILE('../../std_data/words2.dat') WHERE a=2; end| CALL test.p1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. SELECT * FROM test.t1 ORDER BY blob_column; a blob_column 1 abase diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result index 62f6be65928..b3d70a0ba75 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -16,6 +16,10 @@ CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB; CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB; CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM; +CREATE TABLE t_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM; +CREATE TABLE t_double_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM; +CREATE TRIGGER trig_autoinc BEFORE INSERT ON t_autoinc FOR EACH ROW BEGIN INSERT INTO t_stmt VALUES ('x'); END; +CREATE TRIGGER trig_double_autoinc BEFORE INSERT ON t_double_autoinc FOR EACH ROW BEGIN INSERT INTO t_autoinc VALUES (NULL); END; CREATE DATABASE other; SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED; [on slave] @@ -64,8 +68,10 @@ SET @@global.binlog_format = MIXED; SET @@session.binlog_format = MIXED; * Unsafe statement and stmt-only engine INSERT INTO t_stmt VALUES (UUID()); -Warnings: -Note 1641 Unsafe statement binlogged as statement since storage engine is limited to statement-logging. Reason: Statement uses a system function whose value may differ on slave. +ERROR HY000: Cannot execute statement: binlogging of unsafe statement is impossible when storage engine is limited to statement-logging and BINLOG_FORMAT = MIXED. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* Multi-unsafe statement and stmt-only engine +INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; +ERROR HY000: Cannot execute statement: binlogging of unsafe statement is impossible when storage engine is limited to statement-logging and BINLOG_FORMAT = MIXED. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. ---- binlog_format=statement ---- [on slave] include/stop_slave.inc @@ -102,7 +108,7 @@ USE test; * Unsafe statement and binlog_format=statement INSERT INTO t VALUES (UUID()); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * Same statement, but db filtered out - no message USE other; INSERT INTO test.t VALUES (UUID()); @@ -119,7 +125,7 @@ set global sql_slave_skip_counter=1; include/start_slave.inc [on master] ==== Clean up ==== -DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt; +DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt, t_autoinc, t_double_autoinc; DROP DATABASE other; SET @@global.binlog_format = @old_binlog_format; SET @@session.binlog_format = @old_binlog_format; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test index 580f9d8551e..caefba828c1 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -51,6 +51,11 @@ CREATE TABLE t_self_logging (a VARCHAR(100)) ENGINE = NDB; CREATE TABLE t_row (a VARCHAR(100)) ENGINE = INNODB; CREATE TABLE t_stmt (a VARCHAR(100)) ENGINE = EXAMPLE; CREATE TABLE t_slave_stmt (a VARCHAR(100)) ENGINE = MYISAM; +CREATE TABLE t_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM; +CREATE TABLE t_double_autoinc (a INT KEY AUTO_INCREMENT) ENGINE = MYISAM; + +--eval CREATE TRIGGER trig_autoinc BEFORE INSERT ON t_autoinc FOR EACH ROW BEGIN INSERT INTO t_stmt VALUES ('x'); END +--eval CREATE TRIGGER trig_double_autoinc BEFORE INSERT ON t_double_autoinc FOR EACH ROW BEGIN INSERT INTO t_autoinc VALUES (NULL); END CREATE DATABASE other; @@ -127,9 +132,15 @@ SET @@global.binlog_format = MIXED; SET @@session.binlog_format = MIXED; --echo * Unsafe statement and stmt-only engine -# This will give a warning. +--error ER_BINLOG_UNSAFE_AND_STMT_ENGINE INSERT INTO t_stmt VALUES (UUID()); +# Concatenate three unsafe values, and then concatenate NULL to +# that so that the result is NULL and we instead use autoinc. +--echo * Multi-unsafe statement and stmt-only engine +--error ER_BINLOG_UNSAFE_AND_STMT_ENGINE +INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; + --echo ---- binlog_format=statement ---- @@ -213,7 +224,7 @@ INSERT INTO t VALUES (UUID()); --echo ==== Clean up ==== -DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt; +DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt, t_autoinc, t_double_autoinc; DROP DATABASE other; SET @@global.binlog_format = @old_binlog_format; SET @@session.binlog_format = @old_binlog_format; diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 8c331b156c0..d9486f290a9 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6076,7 +6076,7 @@ ER_SLAVE_INCIDENT ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT eng "Table has no partition for some existing values" ER_BINLOG_UNSAFE_STATEMENT - eng "Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT." + eng "Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: %s" ER_SLAVE_FATAL_ERROR eng "Fatal error: %s" ER_SLAVE_RELAY_LOG_READ_FAILURE @@ -6211,7 +6211,7 @@ ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE ER_BINLOG_ROW_MODE_AND_STMT_ENGINE eng "Cannot execute statement: binlogging impossible since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging." ER_BINLOG_UNSAFE_AND_STMT_ENGINE - eng "Unsafe statement binlogged as statement since storage engine is limited to statement-logging." + eng "Cannot execute statement: binlogging of unsafe statement is impossible when storage engine is limited to statement-logging and BINLOG_FORMAT = MIXED. Reason for unsafeness: %s" ER_BINLOG_ROW_INJECTION_AND_STMT_ENGINE eng "Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging." ER_BINLOG_STMT_MODE_AND_ROW_ENGINE @@ -6236,7 +6236,5 @@ ER_BINLOG_UNSAFE_SYSTEM_VARIABLE ER_BINLOG_UNSAFE_SYSTEM_FUNCTION eng "Statement uses a system function whose value may differ on slave." -ER_BINLOG_UNSAFE_WARNING_SHORT - eng "%s Reason: %s" -ER_BINLOG_UNSAFE_WARNING_LONG - eng "%s Reason: %s Statement: %s" +ER_MESSAGE_AND_STATEMENT + eng "%s Statement: %s" diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 46f05441a44..a59ae99a16d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3282,8 +3282,8 @@ void xid_cache_delete(XID_STATE *xid_state) binlog_format * SMRSMRSMR SMRSMRSMR SMRSMRSMR - Logged format - SS-SS---- -RR-RR-RR SRRSRR-RR - Warning/Error 1 --2332444 5--5--6-- ---7--6-- + Logged format - SS-S----- -RR-RR-RR SRRSRR-RR + Warning/Error 1 --2732444 5--5--6-- ---7--6-- Legend ------ @@ -3303,8 +3303,9 @@ void xid_cache_delete(XID_STATE *xid_state) BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging. - 3. Warning: Unsafe statement binlogged as statement since storage - engine is limited to statement-logging. + 3. Error: Cannot execute statement: binlogging of unsafe statement + is impossible when storage engine is limited to statement-logging + and BINLOG_FORMAT = MIXED. 4. Error: Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to @@ -3457,17 +3458,16 @@ int THD::decide_logging_format(TABLE_LIST *tables) else if ((unsafe_flags= lex->get_stmt_unsafe_flags()) != 0) { /* - 3. Warning: Unsafe statement binlogged as statement since - storage engine is limited to statement-logging. + 3. Error: Cannot execute statement: binlogging of unsafe + statement is impossible when storage engine is limited to + statement-logging and BINLOG_FORMAT = MIXED. */ - binlog_unsafe_warning_flags|= - (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE) | - (unsafe_flags << BINLOG_STMT_WARNING_COUNT); - DBUG_PRINT("info", ("Scheduling warning to be issued by " - "binlog_query: %s", - ER(ER_BINLOG_UNSAFE_AND_STMT_ENGINE))); - DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x", - binlog_unsafe_warning_flags)); + for (int unsafe_type= 0; + unsafe_type < LEX::BINLOG_STMT_UNSAFE_COUNT; + unsafe_type++) + if (unsafe_flags & (1 << unsafe_type)) + my_error((error= ER_BINLOG_UNSAFE_AND_STMT_ENGINE), MYF(0), + ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); } /* log in statement format! */ } @@ -3499,13 +3499,11 @@ int THD::decide_logging_format(TABLE_LIST *tables) 7. Warning: Unsafe statement logged as statement due to binlog_format = STATEMENT */ - binlog_unsafe_warning_flags|= - (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE) | - (unsafe_flags << BINLOG_STMT_WARNING_COUNT); + binlog_unsafe_warning_flags|= unsafe_flags; DBUG_PRINT("info", ("Scheduling warning to be issued by " "binlog_query: '%s'", ER(ER_BINLOG_UNSAFE_STATEMENT))); - DBUG_PRINT("info", ("binlog_stmt_flags: 0x%x", + DBUG_PRINT("info", ("binlog_unsafe_warning_flags: 0x%x", binlog_unsafe_warning_flags)); } /* log in statement format! */ @@ -3536,7 +3534,7 @@ int THD::decide_logging_format(TABLE_LIST *tables) DBUG_PRINT("info", ("decision: no logging since " "mysql_bin_log.is_open() = %d " "and (options & OPTION_BIN_LOG) = 0x%llx " - "and binlog_format = %d " + "and binlog_format = %ld " "and binlog_filter->db_ok(db) = %d", mysql_bin_log.is_open(), (options & OPTION_BIN_LOG), @@ -4037,31 +4035,11 @@ void THD::issue_unsafe_warnings() Ensure that binlog_unsafe_warning_flags is big enough to hold all bits. This is actually a constant expression. */ - DBUG_ASSERT(BINLOG_STMT_WARNING_COUNT + 2 * LEX::BINLOG_STMT_UNSAFE_COUNT <= + DBUG_ASSERT(2 * LEX::BINLOG_STMT_UNSAFE_COUNT <= sizeof(binlog_unsafe_warning_flags) * CHAR_BIT); - /** - @note The order of the elements of this array must correspond to - the order of elements in enum_binlog_stmt_unsafe. - */ - static const int explanations[LEX::BINLOG_STMT_UNSAFE_COUNT] = - { - ER_BINLOG_UNSAFE_LIMIT, - ER_BINLOG_UNSAFE_INSERT_DELAYED, - ER_BINLOG_UNSAFE_SYSTEM_TABLE, - ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS, - ER_BINLOG_UNSAFE_UDF, - ER_BINLOG_UNSAFE_SYSTEM_VARIABLE, - ER_BINLOG_UNSAFE_SYSTEM_FUNCTION - }; - uint32 flags= binlog_unsafe_warning_flags; - /* No warnings (yet) for this statement. */ - if (flags == 0) - DBUG_VOID_RETURN; + uint32 unsafe_type_flags= binlog_unsafe_warning_flags; - /* Get the types of unsafeness that affect the current statement. */ - uint32 unsafe_type_flags= flags >> BINLOG_STMT_WARNING_COUNT; - DBUG_ASSERT((unsafe_type_flags & LEX::BINLOG_STMT_UNSAFE_ALL_FLAGS) != 0); /* Clear: (1) bits above BINLOG_STMT_UNSAFE_COUNT; (2) bits for warnings that have been printed already. @@ -4072,18 +4050,7 @@ void THD::issue_unsafe_warnings() if (unsafe_type_flags == 0) DBUG_VOID_RETURN; - /* Figure out which error code to issue. */ - int err; - if (binlog_unsafe_warning_flags & - (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE)) - err= ER_BINLOG_UNSAFE_AND_STMT_ENGINE; - else { - DBUG_ASSERT(binlog_unsafe_warning_flags & - (1 << BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE)); - err= ER_BINLOG_UNSAFE_STATEMENT; - } - - DBUG_PRINT("info", ("flags: 0x%x err: %d", unsafe_type_flags, err)); + DBUG_PRINT("info", ("unsafe_type_flags: 0x%x", unsafe_type_flags)); /* For each unsafe_type, check if the statement is unsafe in this way @@ -4095,20 +4062,25 @@ void THD::issue_unsafe_warnings() { if ((unsafe_type_flags & (1 << unsafe_type)) != 0) { - push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, err, - ER(ER_BINLOG_UNSAFE_WARNING_SHORT), - ER(err), ER(explanations[unsafe_type])); + push_warning_printf(this, MYSQL_ERROR::WARN_LEVEL_NOTE, + ER_BINLOG_UNSAFE_STATEMENT, + ER(ER_BINLOG_UNSAFE_STATEMENT), + ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); if (global_system_variables.log_warnings) - sql_print_warning(ER(ER_BINLOG_UNSAFE_WARNING_LONG), - ER(err), ER(explanations[unsafe_type]), query); + { + char buf[MYSQL_ERRMSG_SIZE * 2]; + sprintf(buf, ER(ER_BINLOG_UNSAFE_STATEMENT), + ER(LEX::binlog_stmt_unsafe_errcode[unsafe_type])); + sql_print_warning(ER(ER_MESSAGE_AND_STATEMENT), buf, query); + } } } /* Mark these unsafe types as already printed, to avoid printing warnings for them again. */ - binlog_unsafe_warning_flags|= unsafe_type_flags << - (BINLOG_STMT_WARNING_COUNT + LEX::BINLOG_STMT_UNSAFE_COUNT); + binlog_unsafe_warning_flags|= + unsafe_type_flags << LEX::BINLOG_STMT_UNSAFE_COUNT; DBUG_VOID_RETURN; } diff --git a/sql/sql_class.h b/sql/sql_class.h index abba64bebed..ad047514ae5 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1449,42 +1449,21 @@ private: */ enum_binlog_format current_stmt_binlog_format; - /** - Enumeration listing binlog-related warnings that a statement can - cause. - */ - enum enum_binlog_stmt_warning { - - /* ER_BINLOG_UNSAFE_AND_STMT_ENGINE affects current stmt */ - BINLOG_STMT_WARNING_UNSAFE_AND_STMT_ENGINE= 0, - - /* ER_BINLOG_UNSAFE_STATEMENT affects current stmt */ - BINLOG_STMT_WARNING_UNSAFE_AND_STMT_MODE, - - /** The last element of this enumeration type. */ - BINLOG_STMT_WARNING_COUNT - }; - /** Bit field for the state of binlog warnings. - There are three groups of bits: + There are two groups of bits: - - The low BINLOG_STMT_WARNING_COUNT bits indicate the type of - warning that the current (top-level) statement will issue. At - most one of these bits should be set (this is ensured by the - logic in decide_logging_format). - - - The following Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types - of unsafeness that the current statement has. + - The first Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of + unsafeness that the current statement has. - The following Lex::BINLOG_STMT_UNSAFE_COUNT bits list all types of unsafeness that the current statement has issued warnings for. Hence, this variable must be big enough to hold - BINLOG_STMT_WARNING_COUNT + 2 * Lex::BINLOG_STMT_UNSAFE_COUNT - bits. This is asserted in @c issue_unsafe_warnings(). + 2*Lex::BINLOG_STMT_UNSAFE_COUNT bits. This is asserted in @c + issue_unsafe_warnings(). The first and second groups of bits are set by @c decide_logging_format() when it detects that a warning should be diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index 2adbc44eb12..a36b947fecc 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -31,6 +31,23 @@ sys_var *trg_new_row_fake_var= (sys_var*) 0x01; +/** + @note The order of the elements of this array must correspond to + the order of elements in enum_binlog_stmt_unsafe. +*/ +const int +Query_tables_list::binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT] = +{ + ER_BINLOG_UNSAFE_LIMIT, + ER_BINLOG_UNSAFE_INSERT_DELAYED, + ER_BINLOG_UNSAFE_SYSTEM_TABLE, + ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS, + ER_BINLOG_UNSAFE_UDF, + ER_BINLOG_UNSAFE_SYSTEM_VARIABLE, + ER_BINLOG_UNSAFE_SYSTEM_FUNCTION +}; + + /* Longest standard keyword name */ #define TOCK_NAME_LENGTH 24 diff --git a/sql/sql_lex.h b/sql/sql_lex.h index d3b719f1b72..31bfc085b4c 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1099,6 +1099,11 @@ public: static const int BINLOG_STMT_UNSAFE_ALL_FLAGS= ((1 << BINLOG_STMT_UNSAFE_COUNT) - 1); + /** + Maps elements of enum_binlog_stmt_unsafe to error codes. + */ + static const int binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT]; + /** Determine if this statement is marked as unsafe. From d77873833966e137c62bb6fee909ad39363c4591 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Mon, 19 Oct 2009 10:26:22 +0200 Subject: [PATCH 11/69] BUG#39934: Slave stops for engine that only support row-based logging post-push fixes. the test case tried to use a udf that had not been loaded. removed the udf. mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result: updated result file mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test: myfunc_int() was supposed to be a udf. but the udf was not loaded. since the test already uses another plugin, and we don't support multiple plugin directories, i removed the udf function. it was not strictly needed. --- .../suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result | 4 +++- .../suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result index b3d70a0ba75..f15cb7775ca 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -70,7 +70,7 @@ SET @@session.binlog_format = MIXED; INSERT INTO t_stmt VALUES (UUID()); ERROR HY000: Cannot execute statement: binlogging of unsafe statement is impossible when storage engine is limited to statement-logging and BINLOG_FORMAT = MIXED. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * Multi-unsafe statement and stmt-only engine -INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; +INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, NULL) FROM mysql.general_log LIMIT 1; ERROR HY000: Cannot execute statement: binlogging of unsafe statement is impossible when storage engine is limited to statement-logging and BINLOG_FORMAT = MIXED. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. ---- binlog_format=statement ---- [on slave] @@ -125,6 +125,8 @@ set global sql_slave_skip_counter=1; include/start_slave.inc [on master] ==== Clean up ==== +DROP TRIGGER trig_autoinc; +DROP TRIGGER trig_double_autoinc; DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt, t_autoinc, t_double_autoinc; DROP DATABASE other; SET @@global.binlog_format = @old_binlog_format; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test index ec683d28eed..4daacb10a0a 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -139,11 +139,11 @@ SET @@session.binlog_format = MIXED; --error ER_BINLOG_UNSAFE_AND_STMT_ENGINE INSERT INTO t_stmt VALUES (UUID()); -# Concatenate three unsafe values, and then concatenate NULL to +# Concatenate two unsafe values, and then concatenate NULL to # that so that the result is NULL and we instead use autoinc. --echo * Multi-unsafe statement and stmt-only engine --error ER_BINLOG_UNSAFE_AND_STMT_ENGINE -INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; +INSERT DELAYED INTO t_double_autoinc SELECT CONCAT(UUID(), @@hostname, NULL) FROM mysql.general_log LIMIT 1; --echo ---- binlog_format=statement ---- @@ -228,6 +228,8 @@ INSERT INTO t VALUES (UUID()); --echo ==== Clean up ==== +DROP TRIGGER trig_autoinc; +DROP TRIGGER trig_double_autoinc; DROP TABLE t, t_self_logging, t_row, t_stmt, t_slave_stmt, t_autoinc, t_double_autoinc; DROP DATABASE other; SET @@global.binlog_format = @old_binlog_format; From be75d8ad92315ad72381231015b27593e2f9a820 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Mon, 19 Oct 2009 10:52:14 +0200 Subject: [PATCH 12/69] BUG#39934 - post-push fixes. The rpl_ndb/combinations file was introduced as part of the fix. The file contained an error: ndb suites shall not run with binlog_format=mixed. Removed that combination. mysql-test/suite/rpl_ndb/combinations: removed binlog_format=statement combination since ndb does not support statement format. mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test: Added have_binlog_format_mixed_or_row.inc. --- mysql-test/suite/rpl_ndb/combinations | 3 --- mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/combinations b/mysql-test/suite/rpl_ndb/combinations index 07042c2cbec..75712d234e1 100644 --- a/mysql-test/suite/rpl_ndb/combinations +++ b/mysql-test/suite/rpl_ndb/combinations @@ -1,8 +1,5 @@ [row] binlog-format=row -[stmt] -binlog-format=statement - [mix] binlog-format=mixed diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test index a20e42f1b24..17f2d00cbf6 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_tables.test @@ -45,6 +45,7 @@ --source include/have_ndb.inc --source include/have_innodb.inc --source include/ndb_master-slave.inc +--source include/have_binlog_format_mixed_or_row.inc --echo ---- setup master ---- From 631139c1ca3bd3e500f5ce0b41b67c0c82eeb32a Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Mon, 19 Oct 2009 15:12:59 +0200 Subject: [PATCH 13/69] BUG#39934: Slave stops for engine that only support row-based logging Post-push fix. Problem: In a previous patch for BUG#39934, rpl_idempotency.test was split in two tests. The mtr suppressions in the original test did not make it into the new test. This caused pushbuild warnings. Fix: copy the mtr suppressions from rpl_idempotency.test to rpl_row_idempotency.test mysql-test/suite/rpl/r/rpl_row_idempotency.result: updated result file mysql-test/suite/rpl/t/rpl_row_idempotency.test: copied the warnings from rpl_idempotency.test to rpl_row_idempotency.test --- mysql-test/suite/rpl/r/rpl_row_idempotency.result | 3 +++ mysql-test/suite/rpl/t/rpl_row_idempotency.test | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result index c2d1f3ffdd3..ccb7ce774e5 100644 --- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result @@ -4,6 +4,9 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); +call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); set @old_slave_exec_mode= @@global.slave_exec_mode; set @@global.slave_exec_mode= IDEMPOTENT; create table ti1 (b int primary key) engine = innodb; diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test index 35e74b80e92..ef8853dc50f 100644 --- a/mysql-test/suite/rpl/t/rpl_row_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test @@ -8,6 +8,12 @@ source include/have_innodb.inc; connection slave; source include/have_innodb.inc; +# Add suppression for expected warning(s) in slaves error log +call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); +call mtr.add_suppression("Slave: Cannot delete or update a parent row: a foreign key constraint fails .* Error_code: 1451"); +call mtr.add_suppression("Slave: Cannot add or update a child row: a foreign key constraint fails .* Error_code: 1452"); + + # bug#31609 Not all RBR slave errors reported as errors # bug#31552 Replication breaks when deleting rows from out-of-sync table # without PK From e78fae218681a1ad02f506b7d124e01cdd3452c9 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Thu, 29 Oct 2009 13:54:47 +0800 Subject: [PATCH 14/69] postfix result file for outfile_loaddata after merge --- mysql-test/r/outfile_loaddata.result | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/outfile_loaddata.result b/mysql-test/r/outfile_loaddata.result index 66ff28298ba..453e3adb54c 100644 --- a/mysql-test/r/outfile_loaddata.result +++ b/mysql-test/r/outfile_loaddata.result @@ -92,14 +92,14 @@ HEX(c1) C3 SELECT * INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' FIELDS ENCLOSED BY 0xC3 FROM t1; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported TRUNCATE t1; SELECT HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt')); HEX(LOAD_FILE('MYSQLTEST_VARDIR/tmp/bug32533.txt')) C35CC3C30A LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug32533.txt' INTO TABLE t1 FIELDS ENCLOSED BY 0xC3; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported SELECT HEX(c1) FROM t1; HEX(c1) C3 @@ -124,17 +124,17 @@ ERROR 42000: Field separator argument is not what is expected; check the manual # LOAD DATA rises error or has unpredictable result -- to be fixed later SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS ENCLOSED BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS ENCLOSED BY 'ÑŠ'; ERROR 42000: Field separator argument is not what is expected; check the manual SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS ESCAPED BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS ESCAPED BY 'ÑŠ'; ERROR 42000: Field separator argument is not what is expected; check the manual SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' FIELDS TERMINATED BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported ################################################## 1ÑŠABC-áâ÷ÑŠDEF-ÂÃÄ 2ÑŠ\NÑŠ\N @@ -142,7 +142,7 @@ Warning 1639 Non-ASCII separator arguments are not fully supported TRUNCATE t2; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary FIELDS TERMINATED BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported Warning 1265 Data truncated for column 'a' at row 1 Warning 1261 Row 1 doesn't contain data for all columns Warning 1261 Row 1 doesn't contain data for all columns @@ -156,7 +156,7 @@ a b c 2 NULL NULL SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES STARTING BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported ################################################## ÑŠ1 ABC-áâ÷ DEF-ÂÃÄ ÑŠ2 \N \N @@ -164,20 +164,20 @@ Warning 1639 Non-ASCII separator arguments are not fully supported TRUNCATE t2; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary LINES STARTING BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; a b c 1 ABC-ÐБВ DEF-ÂÃÄ 2 NULL NULL SELECT * FROM t1 INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' LINES TERMINATED BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported ################################################## 1 ABC-áâ÷ DEF-ÂÃÄÑŠ2 \N \NÑŠ################################################## TRUNCATE t2; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/t1.txt' INTO TABLE t2 CHARACTER SET binary LINES TERMINATED BY 'ÑŠ'; Warnings: -Warning 1639 Non-ASCII separator arguments are not fully supported +Warning 1638 Non-ASCII separator arguments are not fully supported SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a, b, c; a b c 1 ABC-ÐБВ DEF-ÂÃÄ From 19c380aaff1f1f3c0d21ac0c18904c21d7bdce76 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 3 Nov 2009 19:02:56 +0000 Subject: [PATCH 15/69] WL#2687 WL#5072 BUG#40278 BUG#47175 Non-transactional updates that take place inside a transaction present problems for logging because they are visible to other clients before the transaction is committed, and they are not rolled back even if the transaction is rolled back. It is not always possible to log correctly in statement format when both transactional and non-transactional tables are used in the same transaction. In the current patch, we ensure that such scenario is completely safe under the ROW and MIXED modes. --- .../mix_innodb_myisam_binlog.test | 24 +- .../rpl_tests}/rpl_binlog_max_cache_size.test | 132 +- .../extra/rpl_tests/rpl_extraSlave_Col.test | 45 +- mysql-test/extra/rpl_tests/rpl_flsh_tbls.test | 12 +- .../rpl_tests/rpl_implicit_commit_binlog.test | 375 + .../rpl/t => extra/rpl_tests}/rpl_innodb.test | 12 +- .../extra/rpl_tests/rpl_insert_delayed.test | 3 +- .../extra/rpl_tests/rpl_insert_ignore.test | 2 + mysql-test/extra/rpl_tests/rpl_loaddata.test | 9 +- mysql-test/extra/rpl_tests/rpl_log.test | 4 +- .../extra/rpl_tests/rpl_mixing_engines.inc | 503 + .../extra/rpl_tests/rpl_mixing_engines.test | 2274 ++- .../rpl_tests/rpl_show_relaylog_events.inc | 4 +- .../rpl_tests}/rpl_start_stop_slave.test | 10 +- .../rpl_tests}/rpl_stop_middle_group.test | 6 +- mysql-test/include/commit.inc | 28 +- mysql-test/r/commit_1innodb.result | 25 +- mysql-test/r/ctype_cp932_binlog_stm.result | 22 +- mysql-test/r/multi_update.result | 4 +- mysql-test/r/mysqlbinlog.result | 184 +- mysql-test/r/mysqlbinlog2.result | 753 +- mysql-test/r/mysqlbinlog_row_trans.result | 211 +- mysql-test/r/user_var-binlog.result | 20 +- .../suite/binlog/r/binlog_database.result | 8 + .../suite/binlog/r/binlog_killed.result | 4 + .../binlog/r/binlog_killed_simulate.result | 2 + .../suite/binlog/r/binlog_multi_engine.result | 14 +- .../binlog/r/binlog_row_insert_select.result | 2 +- .../r/binlog_row_mix_innodb_myisam.result | 144 +- .../r/binlog_statement_insert_delayed.result | 8 + .../suite/binlog/r/binlog_stm_binlog.result | 22 +- .../binlog/r/binlog_stm_ctype_ucs.result | 12 +- .../binlog/r/binlog_stm_insert_select.result | 2 + .../r/binlog_stm_mix_innodb_myisam.result | 81 +- .../suite/binlog/r/binlog_stm_ps.result | 6 + .../suite/binlog/r/binlog_stm_row.result | 10 + mysql-test/suite/binlog/t/binlog_killed.test | 2 +- .../binlog/t/binlog_killed_simulate.test | 2 +- .../suite/binlog/t/binlog_multi_engine.test | 10 +- .../suite/ndb/r/ndb_binlog_format.result | 9 + mysql-test/suite/ndb/t/ndb_binlog_format.test | 2 + .../rpl/r/rpl_begin_commit_rollback.result | 4 + mysql-test/suite/rpl/r/rpl_blackhole.result | 9 +- .../suite/rpl/r/rpl_concurrency_error.result | 17 + .../suite/rpl/r/rpl_extraCol_innodb.result | 378 +- .../suite/rpl/r/rpl_extraCol_myisam.result | 378 +- .../suite/rpl/r/rpl_innodb_mixed_dml.result | 2 - .../suite/rpl/r/rpl_insert_ignore.result | 1 + .../rpl/r/rpl_known_bugs_detection.result | 2 +- mysql-test/suite/rpl/r/rpl_loaddata.result | 10 +- .../suite/rpl/r/rpl_loaddata_fatal.result | 8 +- .../suite/rpl/r/rpl_loaddata_map.result | 2 + mysql-test/suite/rpl/r/rpl_log_pos.result | 4 +- .../suite/rpl/r/rpl_mix_insert_delayed.result | 1 + ...=> rpl_mixed_binlog_max_cache_size.result} | 29 +- .../r/rpl_mixed_implicit_commit_binlog.result | 529 + .../rpl/r/rpl_mixed_mixing_engines.result | 11260 ++++++++++++++ .../suite/rpl/r/rpl_mixed_row_innodb.result | 84 + mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result | 8 +- mysql-test/suite/rpl/r/rpl_read_only.result | 1 + mysql-test/suite/rpl/r/rpl_rotate_logs.result | 9 +- .../rpl/r/rpl_row_basic_11bugs-master.opt | 1 - .../rpl/r/rpl_row_basic_11bugs-slave.opt | 1 - .../r/rpl_row_binlog_max_cache_size.result | 138 + .../suite/rpl/r/rpl_row_create_table.result | 12 +- .../suite/rpl/r/rpl_row_flsh_tbls.result | 10 +- .../r/rpl_row_implicit_commit_binlog.result | 570 + .../suite/rpl/r/rpl_row_insert_delayed.result | 1 + mysql-test/suite/rpl/r/rpl_row_log.result | 9 +- .../suite/rpl/r/rpl_row_log_innodb.result | 9 +- .../suite/rpl/r/rpl_row_mixing_engines.result | 12784 ++++++++++++++++ .../rpl/r/rpl_row_show_relaylog_events.result | 6 +- mysql-test/suite/rpl/r/rpl_slave_skip.result | 6 +- mysql-test/suite/rpl/r/rpl_sp.result | 210 + .../r/rpl_stm_auto_increment_bug33029.result | 38 + .../r/rpl_stm_binlog_max_cache_size.result | 158 + .../suite/rpl/r/rpl_stm_flsh_tbls.result | 10 +- .../r/rpl_stm_implicit_commit_binlog.result | 528 + ...pl_innodb.result => rpl_stm_innodb.result} | 8 +- .../suite/rpl/r/rpl_stm_insert_delayed.result | 5 +- mysql-test/suite/rpl/r/rpl_stm_log.result | 31 +- .../r/rpl_stm_mix_show_relaylog_events.result | 104 +- .../suite/rpl/r/rpl_stm_mixing_engines.result | 11002 ++++++++++++- .../suite/rpl/r/rpl_stm_multi_query.result | 10 + ...result => rpl_stm_start_stop_slave.result} | 4 + ...esult => rpl_stm_stop_middle_group.result} | 7 + mysql-test/suite/rpl/r/rpl_stm_until.result | 4 +- .../suite/rpl/r/rpl_temp_table_mix_row.result | 2 + .../rpl/t/rpl_begin_commit_rollback.test | 6 + mysql-test/suite/rpl/t/rpl_blackhole.test | 20 +- .../suite/rpl/t/rpl_concurrency_error.test | 2 + mysql-test/suite/rpl/t/rpl_insert_ignore.test | 3 + .../suite/rpl/t/rpl_invoked_features.test | 12 +- mysql-test/suite/rpl/t/rpl_loaddata.test | 2 + .../suite/rpl/t/rpl_loaddata_fatal.test | 4 +- mysql-test/suite/rpl/t/rpl_log_pos.test | 2 +- ...pl_mixed_binlog_max_cache_size-master.opt} | 0 .../t/rpl_mixed_binlog_max_cache_size.test | 7 + .../t/rpl_mixed_implicit_commit_binlog.test | 9 + .../suite/rpl/t/rpl_mixed_mixing_engines.test | 10 + .../suite/rpl/t/rpl_mixed_row_innodb.test | 8 + mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test | 2 +- mysql-test/suite/rpl/t/rpl_read_only.test | 6 + .../suite/rpl/t/rpl_row_basic_11bugs.test | 1 + .../rpl_row_binlog_max_cache_size-master.opt | 1 + .../rpl/t/rpl_row_binlog_max_cache_size.test | 7 + .../rpl/t/rpl_row_implicit_commit_binlog.test | 9 + .../suite/rpl/t/rpl_row_mixing_engines.test | 11 + mysql-test/suite/rpl/t/rpl_row_until.test | 24 +- .../rpl_stm_binlog_max_cache_size-master.opt | 1 + .../rpl/t/rpl_stm_binlog_max_cache_size.test | 7 + mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test | 2 +- .../rpl/t/rpl_stm_implicit_commit_binlog.test | 9 + mysql-test/suite/rpl/t/rpl_stm_innodb.test | 8 + .../suite/rpl/t/rpl_stm_mixing_engines.test | 5 + .../suite/rpl/t/rpl_stm_start_stop_slave.test | 8 + .../rpl/t/rpl_stm_stop_middle_group.test | 9 + mysql-test/suite/rpl/t/rpl_stm_until.test | 2 +- mysql-test/suite/rpl/t/rpl_trigger.test | 2 + .../suite/rpl_ndb/r/rpl_ndb_extraCol.result | 378 +- mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result | 9 +- mysql-test/t/commit_1innodb.test | 2 + mysql-test/t/ctype_cp932_binlog_stm.test | 9 +- mysql-test/t/mysqlbinlog.test | 20 +- mysql-test/t/mysqlbinlog2.test | 18 +- sql/ha_ndbcluster_binlog.cc | 2 +- sql/handler.cc | 32 +- sql/log.cc | 1057 +- sql/log.h | 10 +- sql/log_event.cc | 113 +- sql/log_event.h | 58 +- sql/log_event_old.cc | 9 +- sql/mysql_priv.h | 3 +- sql/share/errmsg.txt | 2 + sql/sp.cc | 2 +- sql/sp_head.cc | 2 +- sql/sql_acl.cc | 2 +- sql/sql_base.cc | 4 +- sql/sql_class.cc | 120 +- sql/sql_class.h | 35 +- sql/sql_db.cc | 10 +- sql/sql_delete.cc | 20 +- sql/sql_insert.cc | 37 +- sql/sql_lex.cc | 3 +- sql/sql_lex.h | 7 + sql/sql_load.cc | 4 +- sql/sql_table.cc | 10 +- sql/sql_update.cc | 33 +- sql/sql_view.cc | 2 +- 149 files changed, 41957 insertions(+), 3661 deletions(-) rename mysql-test/{suite/rpl/t => extra/rpl_tests}/rpl_binlog_max_cache_size.test (84%) create mode 100644 mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test rename mysql-test/{suite/rpl/t => extra/rpl_tests}/rpl_innodb.test (93%) create mode 100644 mysql-test/extra/rpl_tests/rpl_mixing_engines.inc rename mysql-test/{suite/rpl/t => extra/rpl_tests}/rpl_start_stop_slave.test (91%) rename mysql-test/{suite/rpl/t => extra/rpl_tests}/rpl_stop_middle_group.test (97%) rename mysql-test/suite/rpl/r/{rpl_binlog_max_cache_size.result => rpl_mixed_binlog_max_cache_size.result} (87%) create mode 100644 mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result create mode 100644 mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result create mode 100644 mysql-test/suite/rpl/r/rpl_mixed_row_innodb.result delete mode 100644 mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt delete mode 100644 mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt create mode 100644 mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result create mode 100644 mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result create mode 100644 mysql-test/suite/rpl/r/rpl_row_mixing_engines.result create mode 100644 mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result create mode 100644 mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result rename mysql-test/suite/rpl/r/{rpl_innodb.result => rpl_stm_innodb.result} (97%) rename mysql-test/suite/rpl/r/{rpl_start_stop_slave.result => rpl_stm_start_stop_slave.result} (63%) rename mysql-test/suite/rpl/r/{rpl_stop_middle_group.result => rpl_stm_stop_middle_group.result} (77%) rename mysql-test/suite/rpl/t/{rpl_binlog_max_cache_size-master.opt => rpl_mixed_binlog_max_cache_size-master.opt} (100%) create mode 100644 mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test create mode 100644 mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test create mode 100644 mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test create mode 100644 mysql-test/suite/rpl/t/rpl_mixed_row_innodb.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test create mode 100644 mysql-test/suite/rpl/t/rpl_row_mixing_engines.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_innodb.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test create mode 100644 mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test diff --git a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test index da0b77fbc23..4abf21a9930 100644 --- a/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test +++ b/mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test @@ -8,6 +8,7 @@ -- source include/have_log_bin.inc -- source include/have_innodb.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); --disable_warnings drop table if exists t1, t2; @@ -323,23 +324,24 @@ let $MYSQLD_DATADIR= `select @@datadir`; # and does not make slave to stop) if (`select @@binlog_format = 'ROW'`) { - --exec $MYSQL_BINLOG --start-position=525 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output + --echo This does not matter in ROW mode as the rolled back changes do not contain transactional changes as these + --echo were previously flushed upon committing/rolling back each statement. } if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) { --exec $MYSQL_BINLOG --start-position=556 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output -} ---replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -eval select -(@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) -is not null; ---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR -eval select -@a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR -@a like "%#%error_code=0%ROLLBACK\\r\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", -@a not like "%#%error_code=%error_code=%"; + --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR + eval select + (@a:=load_file("$MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) + is not null; + --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR + eval select + @a like "%#%error_code=0%ROLLBACK\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR + @a like "%#%error_code=0%ROLLBACK\\r\\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", + @a not like "%#%error_code=%error_code=%"; +} drop table t1, t2; # diff --git a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test similarity index 84% rename from mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test rename to mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test index e1f1f8c54bb..55dc7ca6514 100644 --- a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size.test +++ b/mysql-test/extra/rpl_tests/rpl_binlog_max_cache_size.test @@ -22,13 +22,7 @@ # ######################################################################################## -######################################################################################## -# Configuring the environment -######################################################################################## ---source include/have_innodb.inc ---source include/master-slave.inc ---source include/not_embedded.inc ---source include/not_windows.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; @@ -50,30 +44,18 @@ eval INSERT INTO t1 (a, data) VALUES (1, --enable_query_log --echo *** Single statement on non-transactional table *** ---echo *** After WL#2687 the difference between STATEMENT/MIXED and ROW will not exist. *** --disable_query_log ---disable_warnings -if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) -{ - eval INSERT INTO t2 (a, data) VALUES (2, +--error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE +eval INSERT INTO t2 (a, data) VALUES (2, CONCAT($data, $data, $data, $data, $data, $data)); - --echo Got one of the listed errors -} -if (`SELECT @@binlog_format = 'ROW'`) -{ - --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE - eval INSERT INTO t2 (a, data) VALUES (2, - CONCAT($data, $data, $data, $data, $data, $data)); - - connection slave; - --source include/wait_for_slave_sql_to_stop.inc - SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; - START SLAVE SQL_THREAD; - --source include/wait_for_slave_sql_to_start.inc -} ---enable_warnings --enable_query_log +connection slave; +--source include/wait_for_slave_sql_to_stop.inc +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; +--source include/wait_for_slave_sql_to_start.inc + connection master; --disable_query_log @@ -86,7 +68,6 @@ eval INSERT INTO t2 (a, data) VALUES (5, $data); --enable_query_log --echo *** Single statement on both transactional and non-transactional tables. *** ---echo *** After WL#2687 we will be able to change the order of the tables. *** --disable_query_log --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data), @@ -95,13 +76,25 @@ eval UPDATE t2, t1 SET t2.data = CONCAT($data, $data, $data, $data), connection slave; --source include/wait_for_slave_sql_to_stop.inc -SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; + +if (`SELECT @@binlog_format = 'STATEMENT'`) +{ + SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +} +if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) +{ + SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; +} START SLAVE SQL_THREAD; --source include/wait_for_slave_sql_to_start.inc +connection master; -#--echo ######################################################################################## -#--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL -#--echo ######################################################################################## +let $diff_statement= SELECT * FROM t1; +--source include/diff_master_slave.inc + +--echo ######################################################################################## +--echo # 2 - BEGIN - IMPLICIT COMMIT by DDL +--echo ######################################################################################## connection master; TRUNCATE TABLE t1; @@ -149,14 +142,13 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (21, 's'); --enable_query_log -if (`SELECT @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) +if (`SELECT @@binlog_format = 'STATEMENT'`) { --disable_query_log CREATE TABLE t4 SELECT * FROM t1; --enable_query_log - --echo Got one of the listed errors } -if (`SELECT @@binlog_format = 'ROW'`) +if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) { --disable_query_log --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE @@ -186,6 +178,17 @@ BEGIN; CREATE TABLE t5 (a int); --enable_query_log +if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'` ) +{ + connection slave; + --source include/wait_for_slave_sql_to_stop.inc + + SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; + START SLAVE SQL_THREAD; + --source include/wait_for_slave_sql_to_start.inc + connection master; +} + let $diff_statement= SELECT * FROM t1; --source include/diff_master_slave.inc @@ -341,16 +344,30 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (1, $data); --eval INSERT INTO t1 (a, data) VALUES (2, $data); --eval INSERT INTO t2 (a, data) VALUES (3, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE ---eval INSERT INTO t1 (a, data) VALUES (4, $data); +if (`SELECT @@binlog_format = 'STATEMENT'`) +{ + --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE + --eval INSERT INTO t1 (a, data) VALUES (4, $data); +} +if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) +{ + --eval INSERT INTO t1 (a, data) VALUES (4, $data); +} --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (5, $data); --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (6, $data); --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE --eval INSERT INTO t1 (a, data) VALUES (7, $data); ---error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE ---eval UPDATE t2 SET data= CONCAT($data, $data); +if (`SELECT @@binlog_format = 'STATEMENT'`) +{ + --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE + --eval UPDATE t2 SET data= CONCAT($data, $data); +} +if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) +{ + --eval UPDATE t2 SET data= CONCAT($data, $data); +} --eval INSERT INTO t1 (a, data) VALUES (8, 's'); --eval INSERT INTO t1 (a, data) VALUES (9, 's'); --eval INSERT INTO t2 (a, data) VALUES (10, 's'); @@ -363,19 +380,38 @@ BEGIN; --eval INSERT INTO t1 (a, data) VALUES (15, $data); --eval INSERT INTO t1 (a, data) VALUES (16, $data); --eval INSERT INTO t2 (a, data) VALUES (17, $data); +if (`SELECT @@binlog_format = 'STATEMENT'`) +{ + --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE + --eval INSERT INTO t1 (a, data) VALUES (18, $data); +} +if (`SELECT @@binlog_format = 'ROW' || @@binlog_format = 'MIXED'`) +{ + --eval INSERT INTO t1 (a, data) VALUES (18, $data); +} --error ER_TRANS_CACHE_FULL, ER_ERROR_ON_WRITE ---eval INSERT INTO t1 (a, data) VALUES (18, $data); +--eval INSERT INTO t1 (a, data) VALUES (19, $data); --enable_query_log COMMIT; -connection slave; ---source include/wait_for_slave_sql_to_stop.inc +if (`SELECT @@binlog_format = 'STATEMENT'`) +{ + connection slave; + --source include/wait_for_slave_sql_to_stop.inc + + SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; + START SLAVE SQL_THREAD; + --source include/wait_for_slave_sql_to_start.inc + connection master; +} + +let $diff_statement= SELECT * FROM t1; +--source include/diff_master_slave.inc --echo ######################################################################################## --echo # CLEAN --echo ######################################################################################## ---disable_warnings connection master; DROP TABLE t1; DROP TABLE t2; @@ -384,12 +420,4 @@ DROP TABLE IF EXISTS t4; DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t6; DROP PROCEDURE p1; -connection slave; -DROP TABLE t1; -DROP TABLE t2; -DROP TABLE t3; -DROP TABLE IF EXISTS t4; -DROP TABLE IF EXISTS t5; -DROP TABLE IF EXISTS t6; -DROP PROCEDURE p1; ---enable_warnings +sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index 46168d6b97a..377f75b91db 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -97,9 +97,8 @@ SELECT * FROM t2 ORDER BY a; connection slave; START SLAVE; source include/wait_for_slave_sql_to_stop.inc; ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -150,9 +149,8 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -195,9 +193,8 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -240,9 +237,8 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -286,9 +282,8 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; #START SLAVE; @@ -495,9 +490,8 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -539,9 +533,8 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -811,9 +804,8 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; @@ -922,9 +914,8 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); --echo ******************************************** connection slave; --source include/wait_for_slave_sql_to_stop.inc ---replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # ---query_vertical SHOW SLAVE STATUS +--let $errno= query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1) +--echo Slave failed with Error $errno SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test index 0baf49c9fac..6de4a538e72 100644 --- a/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test +++ b/mysql-test/extra/rpl_tests/rpl_flsh_tbls.test @@ -20,19 +20,15 @@ rename table t1 to t5, t2 to t1; # first don't write it to the binlog, to test the NO_WRITE_TO_BINLOG keyword. flush no_write_to_binlog tables; # Check that it's not in the binlog. ---replace_result $SERVER_VERSION SERVER_VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -eval SHOW BINLOG EVENTS FROM $rename_event_pos ; +let $binlog_start= $rename_event_pos; +source include/show_binlog_events.inc; # Check that the master is not confused. select * from t3; # This FLUSH should go into the binlog to not confuse the slave. flush tables; # Check that it's in the binlog. ---replace_result $SERVER_VERSION SERVER_VERSION ---replace_column 2 # 5 # ---replace_regex /table_id: [0-9]+/table_id: #/ -eval SHOW BINLOG EVENTS FROM $rename_event_pos ; +let $binlog_start= $rename_event_pos; +source include/show_binlog_events.inc; sync_slave_with_master; # Check that the slave is not confused. diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test new file mode 100644 index 00000000000..39190611983 --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -0,0 +1,375 @@ +################################################################################ +# In this test case, we verify if some DDL statements implicitly commit a +# transaction and are written directly to the binary log without going +# through either the Statement- or Transactional-Cache. +# +# As any statement that goes through a cache is written to the binary log +# wrapped in a BEGIN...COMMIT, we proceed as follows: +# +# - create a transaction and insert some values into a transactional table. +# - execute a DDL statement that is supposed to implicitly commit the previous +# transaction. +# - Check in the binary log for a COMMIT mark which is supposed to be written +# before the DDL statement. +# - Check in the binary log if the DDL is not wrapped by a BEGIN..COMMIT. +# +# For further details, please, read WL#2687 and WL#5072. +################################################################################ + +--echo ######################################################################### +--echo # CONFIGURATION +--echo ######################################################################### +#Re-enable this after fixing BUG#46572 +#connection master; + +CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; + +INSERT INTO tt_1(ddl_case) VALUES(0); +INSERT INTO tt_2(ddl_case) VALUES(0); + +--echo ######################################################################### +--echo # CHECK IMPLICT COMMIT +--echo ######################################################################### +SET AUTOCOMMIT= 0; +let $ddl_cases= 41; +while (`SELECT $ddl_cases >= 1`) +{ + --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- + let $in_temporary= "no"; + # + # In SBR and MIXED modes, the commit event is usually the third event in the + # binary log: + # + # 1: BEGIN + # 2: INSERT + # 3: COMMIT + # 4: DDL EVENT which triggered the previous commmit. + # + if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 3; + } + # + # In RBR mode, the commit event is usually the fourth event in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: ROW EVENT + # 4: COMMIT + # 5: DDL EVENT which triggered the previous commmit. + # + if (`select @@binlog_format = 'ROW'`) + { + let $commit_event_row_number= 4; + } + let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1); + --enable_query_log + eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases); + if (`SELECT $ddl_cases = 41`) + { + let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; + } + if (`SELECT $ddl_cases = 40`) + { + let $cmd= LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; + } + if (`SELECT $ddl_cases = 39`) + { + let $cmd= ANALYZE TABLE nt_1; + } + if (`SELECT $ddl_cases = 38`) + { + let $cmd= CHECK TABLE nt_1; + } + if (`SELECT $ddl_cases = 37`) + { + let $cmd= OPTIMIZE TABLE nt_1; + } + if (`SELECT $ddl_cases = 36`) + { + let $cmd= REPAIR TABLE nt_1; + } + if (`SELECT $ddl_cases = 35`) + { + let $cmd= LOCK TABLES tt_1 WRITE; + } + if (`SELECT $ddl_cases = 34`) + { + let $cmd= UNLOCK TABLES; + } + if (`SELECT $ddl_cases = 33`) + { + let $cmd= CREATE USER 'user'@'localhost'; + } + if (`SELECT $ddl_cases = 32`) + { + let $cmd= GRANT ALL ON *.* TO 'user'@'localhost'; + } + if (`SELECT $ddl_cases = 31`) + { + let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); + } + if (`SELECT $ddl_cases = 30`) + { + let $cmd= REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; + } + if (`SELECT $ddl_cases = 29`) + { + let $cmd= RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; + } + if (`SELECT $ddl_cases = 28`) + { + let $cmd= DROP USER 'user_new'@'localhost'; + } + if (`SELECT $ddl_cases = 27`) + { + let $cmd= CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; + } + if (`SELECT $ddl_cases = 26`) + { + let $cmd= ALTER EVENT evt COMMENT 'evt'; + } + if (`SELECT $ddl_cases = 25`) + { + let $cmd= DROP EVENT evt; + } + if (`SELECT $ddl_cases = 24`) + { + let $cmd= CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; + } + if (`SELECT $ddl_cases = 23`) + { + let $cmd= DROP TRIGGER tr; + # + # In RBR mode, due to the trigger the tt_2 is also updated: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT + # 4: ROW EVENT + # 5: COMMIT + # 6: DDL EVENT which triggered the previous commmit. + # + if (`select @@binlog_format = 'ROW'`) + { + let $commit_event_row_number= 5; + } + } + if (`SELECT $ddl_cases = 22`) + { + let $cmd= CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; + } + if (`SELECT $ddl_cases = 21`) + { + let $cmd= ALTER FUNCTION fc COMMENT 'fc'; + } + if (`SELECT $ddl_cases = 20`) + { + let $cmd= DROP FUNCTION fc; + } + if (`SELECT $ddl_cases = 19`) + { + let $cmd= CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; + } + if (`SELECT $ddl_cases = 18`) + { + let $cmd= ALTER PROCEDURE pc COMMENT 'pc'; + } + if (`SELECT $ddl_cases = 17`) + { + let $cmd= DROP PROCEDURE pc; + } + if (`SELECT $ddl_cases = 16`) + { + let $cmd= CREATE VIEW v AS SELECT * FROM tt_1; + } + if (`SELECT $ddl_cases = 15`) + { + let $cmd= ALTER VIEW v AS SELECT * FROM tt_1; + } + if (`SELECT $ddl_cases = 14`) + { + let $cmd= DROP VIEW v; + } + if (`SELECT $ddl_cases = 13`) + { + let $cmd= CREATE INDEX ix ON tt_1(ddl_case); + } + if (`SELECT $ddl_cases = 12`) + { + let $cmd= DROP INDEX ix ON tt_1; + } + if (`SELECT $ddl_cases = 11`) + { + let $cmd= CREATE TEMPORARY TABLE tt_xx (a int); + let $in_temporary= "yes"; + # In SBR and MIXED modes, the DDL statement is written to the binary log but + # does not commit the current transaction. + # + # 1: BEGIN + # 2: INSERT + # 3: CREATE TEMPORARY + # + # In RBR the transaction is not committed either and the statement is not + # written to the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: ROW EVENT + # + if (`select @@binlog_format = 'STATEMENT' || @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 4; + } + } + if (`SELECT $ddl_cases = 10`) + { + let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int); + # + # In MIXED mode, the changes are logged as rows and we have what follows: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: ROW EVENT + # 4: COMMIT + # 5: DDL EVENT which triggered the previous commmit. + # + if (`select @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 4; + } + } + if (`SELECT $ddl_cases = 9`) + { + let $cmd= ALTER TABLE tt_xx RENAME new_tt_xx; + # + # In MIXED mode, the changes are logged as rows and we have what follows: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: ROW EVENT + # 4: COMMIT + # 5: DDL EVENT which triggered the previous commmit. + # + if (`select @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 4; + } + } + if (`SELECT $ddl_cases = 8`) + { + let $cmd= DROP TEMPORARY TABLE IF EXISTS new_tt_xx; + let $in_temporary= "yes"; + # + # In SBR and MIXED modes, the DDL statement is written to the binary log + # but does not commit the current transaction: + # + # 1: BEGIN + # 2: INSERT + # 3: DROP TEMPORARY + # + # In RBR the transaction is not committed either and the statement is not + # written to the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: ROW EVENT + # + if (`select @@binlog_format = 'STATEMENT'`) + { + let $commit_event_row_number= 4; + } + # In MIXED mode, the changes are logged as rows and we have what follows: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: ROW EVENT + # 4: DROP TEMPORARY table IF EXISTS + # + if (`select @@binlog_format = 'MIXED'`) + { + let $commit_event_row_number= 5; + } + } + if (`SELECT $ddl_cases = 7`) + { + let $cmd= CREATE TABLE tt_xx (a int); + } + if (`SELECT $ddl_cases = 6`) + { + let $cmd= ALTER TABLE tt_xx ADD COLUMN (b int); + } + if (`SELECT $ddl_cases = 5`) + { + let $cmd= RENAME TABLE tt_xx TO new_tt_xx; + } + if (`SELECT $ddl_cases = 4`) + { + let $cmd= TRUNCATE TABLE new_tt_xx; + } + if (`SELECT $ddl_cases = 3`) + { + let $cmd= DROP TABLE IF EXISTS tt_xx, new_tt_xx; + } + if (`SELECT $ddl_cases = 2`) + { + let $cmd= CREATE DATABASE db; + } + if (`SELECT $ddl_cases = 1`) + { + let $cmd= DROP DATABASE IF EXISTS db; + } + --eval $cmd + --disable_query_log + # + # When a temporary table is either created or dropped, there is no implicit + # commit. The flag in_temporary is used to avoid aborting the test in such + # cases. Thus we force the commit. + # + if (`SELECT $in_temporary = "yes"`) + { + --eval COMMIT + } + let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number); + if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`) + { + --echo it *does not* commit the current transaction. + --echo $cmd + --echo $event_commit + SHOW BINLOG EVENTS; + exit; + } + --echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + let $binlog_start= $first_binlog_position; + --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- + --source include/show_binlog_events.inc + --echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + --echo + dec $ddl_cases; +} +SET AUTOCOMMIT= 1; + +--echo ################################################################################### +--echo # CHECK CONSISTENCY +--echo ################################################################################### +# Re-enable this after fixing BUG#46572 +# #--sync_slave_with_master +# +# #--let $diff_table_1= master:test.tt_1 +# #--let $diff_table_2= slave:test.tt_1 +# #--source include/diff_tables.inc +# + +--echo ################################################################################### +--echo # CLEAN +--echo ################################################################################### +#Re-enable this after fixing BUG#46572 +#connection master; + +DROP TABLE tt_1; +DROP TABLE tt_2; + + +#Re-enable this after fixing BUG#46572 +#sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test similarity index 93% rename from mysql-test/suite/rpl/t/rpl_innodb.test rename to mysql-test/extra/rpl_tests/rpl_innodb.test index 64a85d27c88..c866b68466d 100644 --- a/mysql-test/suite/rpl/t/rpl_innodb.test +++ b/mysql-test/extra/rpl_tests/rpl_innodb.test @@ -1,9 +1,3 @@ -# File for specialities regarding replication from or to InnoDB -# tables. - -source include/master-slave.inc; -source include/have_innodb.inc; - # # Bug#11401: Load data infile 'REPLACE INTO' fails on slave. # @@ -76,7 +70,7 @@ sync_slave_with_master; connection slave; # We want to verify that the following transactions are written to the -# binlog, despite the transaction is rolled back. (The should be +# binlog, despite the transaction is rolled back. (They should be # written to the binlog since they contain non-transactional DROP # TEMPORARY TABLE). To see that, we use the auxiliary table t1, which # is transactional (InnoDB) on master and MyISAM on slave. t1 should @@ -84,6 +78,10 @@ connection slave; # the transaction to be logged. Since t1 is non-transactional on # slave, the change will not be rolled back, so the inserted rows will # stay in t1 and we can verify that the transaction was replicated. +# +# Note, however, that the previous explanation is not true for ROW and +# MIXED modes as rollback on a transactional table is not written to +# the binary log. ALTER TABLE mysqltest1.t1 ENGINE = MyISAM; SHOW CREATE TABLE mysqltest1.t1; diff --git a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test index 78f0bebd89d..a6bf2b294d1 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_delayed.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_delayed.test @@ -38,6 +38,7 @@ connection master; truncate table t1; # first scenario: duplicate on first row insert delayed into t1 values(10, "my name"); +flush table t1; if (`SELECT @@global.binlog_format = 'STATEMENT'`) { # statement below will be converted to non-delayed INSERT and so @@ -49,7 +50,7 @@ if (`SELECT @@global.binlog_format != 'STATEMENT'`) { insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); } -flush table t1; # to wait for INSERT DELAYED to be done +flush table t1; select * from t1; sync_slave_with_master; # when bug existed in statement-based binlogging, t1 on slave had diff --git a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test index 43d45ef6c60..ee09c316354 100644 --- a/mysql-test/extra/rpl_tests/rpl_insert_ignore.test +++ b/mysql-test/extra/rpl_tests/rpl_insert_ignore.test @@ -55,7 +55,9 @@ INSERT INTO t1 VALUES (2, 2); INSERT INTO t1 VALUES (3, 3); INSERT INTO t1 VALUES (4, 4); +--disable_warnings INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a; +--enable_warnings SELECT * FROM t1 ORDER BY a; diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test index 129a39ac509..a933a7b2372 100644 --- a/mysql-test/extra/rpl_tests/rpl_loaddata.test +++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test @@ -1,6 +1,3 @@ -# Requires statement logging --- source include/have_binlog_format_mixed_or_statement.inc - # See if replication of a "LOAD DATA in an autoincrement column" # Honours autoincrement values # i.e. if the master and slave have the same sequence @@ -71,7 +68,7 @@ set global sql_slave_skip_counter=1; start slave; sync_with_master; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # +--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # --query_vertical show slave status; # Trigger error again to test CHANGE MASTER @@ -93,7 +90,7 @@ stop slave; change master to master_user='test'; change master to master_user='root'; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # +--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # --query_vertical show slave status; # Trigger error again to test RESET SLAVE @@ -115,7 +112,7 @@ connection slave; stop slave; reset slave; --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 16 # 23 # 33 # +--replace_column 1 # 8 # 9 # 16 # 22 # 23 # 33 # --query_vertical show slave status; # Finally, see if logging is done ok on master for a failing LOAD DATA INFILE diff --git a/mysql-test/extra/rpl_tests/rpl_log.test b/mysql-test/extra/rpl_tests/rpl_log.test index 0517fea1be3..7efcb67b033 100644 --- a/mysql-test/extra/rpl_tests/rpl_log.test +++ b/mysql-test/extra/rpl_tests/rpl_log.test @@ -43,7 +43,7 @@ show binlog events from 107 limit 1; show binlog events from 107 limit 2; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ -show binlog events from 107 limit 2,1; +show binlog events from 107 limit 1,4; flush logs; # We need an extra update before doing save_master_pos. @@ -104,7 +104,7 @@ show binlog events in 'slave-bin.000001' from 4; --replace_column 2 # 5 # --replace_regex /\/\* xid=.* \*\//\/* XID *\// /table_id: [0-9]+/table_id: #/ show binlog events in 'slave-bin.000002' from 4; -source include/show_slave_status.inc; +source include/show_slave_status2.inc; # Need to recode the following diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc new file mode 100644 index 00000000000..68e67208f4a --- /dev/null +++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc @@ -0,0 +1,503 @@ +################################################################################ +# This is an auxiliary file used by rpl_mixing_engines.test, and that it +# executes SQL statements according to a format string, as specified in +# rpl_mixing_engines.test. In addition, it accepts the special format +# strings 'configure' and 'clean', used before and after everything else. +################################################################################ + +if (`SELECT HEX(@commands) = HEX('configure')`) +{ + connection master; + + SET SQL_LOG_BIN=0; + eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval SET SQL_LOG_BIN=1; + + connection slave; + + SET SQL_LOG_BIN=0; + eval CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; + eval CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + eval CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = $engine_type; + SET SQL_LOG_BIN=1; + + connection master; + + INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1); + INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1); + INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1); + INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1); + INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1); + INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1); + + INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1); + INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1); + INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1); + INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1); + INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1); + INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1); + + DELIMITER |; + + CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; + INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); + INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); + END| + + CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; + INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); + INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); + END| + + CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; + INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); + INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); + RETURN "fc_i_tt_5_suc"; + END| + + CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; + INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); + INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); + RETURN "fc_i_nt_5_suc"; + END| + + CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; + INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); + INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); + END| + + CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; + INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); + INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); + END| + + CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id; + INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); + INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); + END| + + CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW + BEGIN + DECLARE in_stmt_id INTEGER; + SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id; + SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; + INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); + INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); + END| + + DELIMITER ;| + + let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1); + + let $trans_id= 7; + let $stmt_id= 1; + let $commands= ''; + + SET @commands= ''; +} + +if (`SELECT HEX(@commands) = HEX('clean')`) +{ + connection master; + + DROP TABLE tt_1; + DROP TABLE tt_2; + DROP TABLE tt_3; + DROP TABLE tt_4; + DROP TABLE tt_5; + DROP TABLE tt_6; + + DROP TABLE nt_1; + DROP TABLE nt_2; + DROP TABLE nt_3; + DROP TABLE nt_4; + DROP TABLE nt_5; + DROP TABLE nt_6; + + DROP PROCEDURE pc_i_tt_5_suc; + DROP PROCEDURE pc_i_nt_5_suc; + DROP FUNCTION fc_i_tt_5_suc; + DROP FUNCTION fc_i_nt_5_suc; + + sync_slave_with_master; + + SET @commands= ''; +} + +if (`SELECT HEX(@commands) != HEX('')`) +{ + --disable_query_log + SET @command= SUBSTRING_INDEX(@commands, ' ', 1); + let $command= `SELECT @command`; + --eval SET @check_commands= '$commands' + if (`SELECT HEX(@check_commands) = HEX('''')`) + { + let $commands= `SELECT @commands`; + } + --echo -b-b-b-b-b-b-b-b-b-b-b- >> $command << -b-b-b-b-b-b-b-b-b-b-b- + let $pos_command= query_get_value("SHOW MASTER STATUS", Position, 1); + --enable_query_log + if (`SELECT HEX(@command) = HEX('B')`) + { + eval BEGIN; + } + if (`SELECT HEX(@command) = HEX('T')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('T-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('T-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval SELECT fc_i_tt_5_suc ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('T-proc')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval CALL pc_i_tt_5_suc ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('eT')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('Te')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('Te-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_5`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('Te-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id)); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('N')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('N-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('N-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval SELECT fc_i_nt_5_suc ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('N-proc')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval CALL pc_i_nt_5_suc ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('eN')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('Ne')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_1(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('Ne-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_5`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_5(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('Ne-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_1(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id)); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('tN')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1; + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('tNe')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM tt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM tt_1; + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('nT')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1; + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('nTe')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_1`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_1 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_1(trans_id, stmt_id, info) SELECT $trans_id, $stmt_id, COUNT(*) FROM nt_1 UNION SELECT $old_trans_id, $old_stmt_id, COUNT(*) FROM nt_1; + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('NT')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval UPDATE nt_3, tt_3 SET nt_3.info= "new text $trans_id --> $stmt_id", tt_3.info= "new text $trans_id --> $stmt_id" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('NT-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('NT-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_tt_5_suc($trans_id, $stmt_id)); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('NeT-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_4`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_4 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_4(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('NeT-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from nt_5`; + let $old_stmt_id= `SELECT max(stmt_id) from nt_5 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO nt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_tt_5_suc ($trans_id, $stmt_id)); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('TN')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval UPDATE tt_4, nt_4 SET tt_4.info= "new text $trans_id --> $stmt_id", nt_4.info= "new text $trans_id --> $stmt_id" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('TN-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('TN-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, fc_i_nt_5_suc($trans_id, $stmt_id)); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('TeN-trig')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_3`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_3 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_3(trans_id, stmt_id) VALUES ($trans_id, $stmt_id), ($old_trans_id, $old_stmt_id); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('TeN-func')`) + { + #--echo DEBUG-- (trans_id, stmt_id) --> ($trans_id, $stmt_id) + let $old_trans_id= `SELECT max(trans_id) from tt_5`; + let $old_stmt_id= `SELECT max(stmt_id) from tt_5 where trans_id= $old_trans_id`; + --error ER_DUP_ENTRY, ER_DUP_KEY + eval INSERT INTO tt_5(trans_id, stmt_id, info) VALUES ($trans_id, $stmt_id, ''), ($old_trans_id, $old_stmt_id, fc_i_nt_5_suc ($trans_id, $stmt_id)); + inc $stmt_id; + } + if (`SELECT HEX(@command) = HEX('CS-T->T')`) + { + --eval CREATE TABLE tt_xx_$trans_id engine=$engine_type SELECT * FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('CS-N->N')`) + { + --eval CREATE TABLE nt_xx_$trans_id engine=MyIsam SELECT * FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('CS-T->N')`) + { + --eval CREATE TABLE tt_xx_$trans_id engine=$engine_type SELECT * FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('CS-N->T')`) + { + --eval CREATE TABLE nt_xx_$trans_id engine=MyIsam SELECT * FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('CSe-T->T')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval CREATE TABLE tt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('CSe-N->N')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval CREATE TABLE nt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('CSe-T->N')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval CREATE TABLE tt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('CSe-N->T')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval CREATE TABLE nt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('CT')`) + { + --eval CREATE TEMPORARY TABLE tt_xx_$trans_id (a int) engine=$engine_type; + } + if (`SELECT HEX(@command) = HEX('drop-CS')`) + { + --disable_warnings + eval DROP TABLE IF EXISTS tt_xx_$trans_id, nt_xx_$trans_id; + --enable_warnings + } + if (`SELECT HEX(@command) = HEX('drop-CT')`) + { + --disable_warnings + eval DROP TEMPORARY TABLE IF EXISTS tt_xx_$trans_id; + --enable_warnings + } + if (`SELECT HEX(@command) = HEX('C')`) + { + eval COMMIT; + } + if (`SELECT HEX(@command) = HEX('R')`) + { + eval ROLLBACK; + } + if (`SELECT HEX(@command) = HEX('S1')`) + { + eval SAVEPOINT s1; + } + if (`SELECT HEX(@command) = HEX('R1')`) + { + eval ROLLBACK TO s1; + } + --disable_query_log + SET @commands= LTRIM(SUBSTRING(@commands, LENGTH(@command) + 1)); + inc $stmt_id; + + let $binlog_start= $pos_command; + --source include/show_binlog_events.inc + --echo -e-e-e-e-e-e-e-e-e-e-e- >> $command << -e-e-e-e-e-e-e-e-e-e-e- + if (`SELECT HEX(@commands) = HEX('')`) + { + let $binlog_start= $pos_trans_command; + --echo -b-b-b-b-b-b-b-b-b-b-b- >> $commands << -b-b-b-b-b-b-b-b-b-b-b- + --source include/show_binlog_events.inc + --echo -e-e-e-e-e-e-e-e-e-e-e- >> $commands << -e-e-e-e-e-e-e-e-e-e-e- + --echo + let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1); + let $stmt_id= 1; + inc $trans_id; + let $commands= ''; + } + + --source extra/rpl_tests/rpl_mixing_engines.inc +} diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test index cbda85527f1..ea36a241664 100644 --- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test +++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test @@ -1,710 +1,1662 @@ -################################################################################### -# This test checks if transactions that mixes transactional and non-transactional -# tables are correctly handled in statement mode. In an nutshell, we have what -# follows: +################################################################################ +# - Introduction +# This checks if transactions that mixes transactional and non-transactional +# are correctly handled. There are several types of statements that require +# attention because of their special behavior in transactions: # -# 1) "B T T C" generates in binlog the "B T T C" entries. +# * Non-transactional updates that take place inside a transaction present +# problems for logging because (1) they are visible to other clients before +# the transaction is committed, and (2) they are not rolled back even if the +# transaction is rolled back. It is not always possible to log correctly in +# statement format when both transactional and non-transactional tables are +# used in the same transaction. # -# 2) "B T T R" generates in binlog an "empty" entry. +# * Statements that do an implicit commit (i.e., most but not all DDL, and +# some utility commands) are logged specially due to unspecified requirements by +# NDB. +# +# * Statements that update temporary tables need special treatment since they +# are not logged in row format. # -# 3) "B T N C" generates in binlog the "B T N C" entries. +# - Definitions # -# 4) "B T N R" generates in binlog the "B T N R" entries. +# To reason about logging different table types, we make some preliminary +# definitions. # -# 5) "T" generates in binlog the "B T C" entry. +# * A table that has a transactional engine is called a T-table. # -# 6) "N" generates in binlog the "N" entry. +# * A table that has a non-transactional engine is called an N-table. # -# 7) "M" generates in binglog the "B M C" entries. +# * A statement makes an N-write if it makes any type of change to the server +# state that will not be changed by a ROLLBACK. # -# 8) "B N N T C" generates in binglog the "N N B T C" entries. +# * Events are either appended to the Transaction Cache (TC) or to the +# Statement Cache (SC) or written directly to the binlog. # -# 9) "B N N T R" generates in binlog the "N N B T R" entries. +# - Preliminary Rules # -# 10) "B N N C" generates in binglog the "N N" entries. +# The following preliminary rules are actually consequences of the principle +# that statements shall be correctly logged when binlog_format=MIXED or ROW. +# They also apply when binlog_format=STATEMENT: this makes statement format +# work in many practical cases. # -# 11) "B N N R" generates in binlog the "N N" entries. +# * (Causality) If statement A is executed before statement B, and B is logged +# in statement format, and B reads tables that A may modifies, then B shall be +# logged after A. # -# 12) "B M T C" generates in the binlog the "B M T C" entries. +# * (Durability) Events shall be written to the binary log at the moment they +# take effect. In particular, changes to N-tables shall be written to the +# binary log when they have been executed, and changes to T-tables shall be +# written to the binary log on commit. If --sync-binlog has been specified, +# then it suffices that events are be written to the binary log at the next +# synchronization point. # -# 13) "B M T R" generates in the binlog the "B M T R" entries. -################################################################################### - ---echo ################################################################################### ---echo # CONFIGURATION ---echo ################################################################################### +# * (causality-precedence) If causality and durability cannot both be +# fulfilled, then casuality is considered more important. +# +# - Rules for non-committing statements, except CREATE TEMPORARY TABLE...SELECT +# +# The preliminary rules above, together with the principles for logging format +# , have been used to construct the following rules. +# +# CALL statements are unrolled, so that each statement executed by the stored +# procedure is logged separately. (If a stored procedure A invokes a stored +# procedure B, then B is unrolled recursively). In the following, we assume +# that unrolling has already been done, and the word "statement" refers to a +# non-CALL top-level statement or a non-CALL sub-statement. +# +# Let S be a logged statement that does not have an implicit commit, except +# CREATE TEMPORARY TABLE...SELECT (This includes all "pure DML": INSERT, +# UPDATE, DELETE, REPLACE, TRUNCATE, SELECT, DO, CALL, EXECUTE, LOAD DATA +# INFILE, and BINLOG. It also includes CREATE TEMPORARY TABLE without SELECT, +# and DROP TEMPORARY TABLE. CREATE TEMPORARY TABLE...SELECT is handled in the +# next subsection). +# +# Before executing S, determine unsafeness: +# +# * If S either makes N-writes or reads from an N-table, and either S or a +# previous statement in the same transaction reads or writes to a T-table, +# then S is marked as unsafe. +# +# When logging S, determine where to log it by applying the following rules in +# order: +# +# * If S is to be logged in statement format (i.e., if one of the following +# holds: (1) STATEMENT; (2) MIXED and S is safe; (3) S is of DDL type, i.e., +# CREATE TEMPORARY TABLE): +# 1. If S produces an error and does not do any N-write, do not log. +# 2. Otherwise, if either S or any previous statement in the same +# transaction reads or writes in any T-tables, log to TC. +# 3. Otherwise, log to SC. +# +# * If S is to be logged in row format (i.e., if S is DML and one of the +# following holds: (1) ROW; (2) MIXED and S is unsafe): +# 1. Do not log row events that write to temporary tables. +# 2. Log row events that write to non-temporary N-tables to SC. +# 3. Log row events that write to non-temporary T-tables to TC, except +# rows that are rolled back due to an error. (Note: if there is an error, +# rows written to a T-table are kept if there are subsequent rows written +# to an N-table.) +# +# * At the end of S, write BEGIN + SC + COMMIT to the binlog and clear the +# SC. +# +# At end of transaction: +# +# * At COMMIT or implicit commit, where all XA tables in the transaction +# succeed in the "prepare" phase: +# 1. If the TC is non-empty, write BEGIN + TC + COMMIT to the binlog. +# 2. If the TC is empty, do nothing. +# +# * At ROLLBACK; or at COMMIT or implicit commit where some XA table fails +# in the "prepare" phase: +# 1. If the TC contains any N-write, write BEGIN + TC + ROLLBACK to the +# binlog. +# 2. If the TC does not contain any N-write, do nothing. +# +# * At ROLLBACK TO SAVEPOINT: +# 1. If the TC contains any N-write after the savepoint, write ROLLBACK TO +# SAVEPOINT to the TC. +# 2. Otherwise, clear the part of the TC that starts at the savepoint and +# extends to the end of the TC. (Bug#47327 breaks this rule) +# +# * Clear the TC at the end of the transaction. +# +# - Rules for CREATE [TEMPORARY] TABLE...SELECT +# +# First, unsafeness is determined as above (R-unsafe-transaction). Then the +# logging format is decided. Then the following rules apply. +# +# * If logging in statement format (i.e., one of the following holds: (1) +# STATEMENT; (2) MIXED and statement is safe): +# 1. If there is an error, do not write anything. +# 2. If there is no error and the TEMPORARY keyword is used, write the +# entire CREATE...SELECT statement to the TC. +# 3. If there is no error and the TEMPORARY keyword is not used, write the +# entire CREATE...SELECT directly to the binlog. +# +# * If logging in row format (i.e., one of the following holds: (1) ROW; (2) +# MIXED and statement is unsafe): +# 1. If the TEMPORARY keyword is used, do not write anything. +# 2. If the TEMPORARY keyword is not used, write CREATE TABLE (without +# select) + BEGIN + row events + COMMIT to the TC. If there is an error, +# clear the TC; otherwise flush the TC to the binlog at the end of the +# statement and then clear the TC. (Note: currently Bug#47899 breaks this +# rule) +# +# - Rules for committing statements, except CREATE [TEMPORARY] TABLE...SELECT +# +# * All other statements that have a pre-commit are written directly to the +# binlog. (Note: this is semantically equivalent to writing it to the SC and +# flushing the SC. However, due to requirements by NDB (which have not been +# clarified), we write directly to the binlog.) +# +# We use the include file rpl_mixing_engines.inc to generate sql commands from a +# format string. The format string consists of a sequence of 'codes' separated +# by spaces. The following codes exist: +# +# - Define the scope of a transaction: +# B - Begin. +# C - Commit. +# R - Rollback. +# S1 - Savepoint. +# R1 - Rollback to S1. +# +# - Change only T-Tables: +# T - Updates a T-Table. +# T-trig - Updates T-Tables through a trigger. +# T-func - Updates T-Tables through a function. +# T-proc - Updates T-Tables through a procedure. +# eT - Fails while updating the first tuple in a T-Table. +# Te - Fails while updating an n-tuple (n > 1) in a T-Table. +# Te-trig - Fails while updating an n-tuple (n > 1) in a T-Table. +# Te-func - Fails while updating an n-tuple (n > 1) in a T-Table. +# +# - Change only N-Tables +# N - Updates a N-Table. +# N-trig - Updates N-Tables through a trigger. +# N-func - Updates N-Tables through a function. +# N-proc - Updates N-Tables through a procedure. +# eN - Fails while updating the first tuple in a N-Table. +# Ne - Fails while updating an n-tuple (n > 1) in a N-Table. +# Ne-trig - Fails while updating an n-tuple (n > 1) in a N-Table. +# Ne-func - Fails while updating an n-tuple (n > 1) in a N-Table. +# +# - Read T-table and write N-table: +# tN - Updates a N-Table +# tNe - Fails while updating an n-tuple (n > 1) in a N-Table. +# +# - Read N-table and write T-table: +# nT - Updates a T-Table. +# nTe - Fails while updating an n-tuple (n > 1) in a T-Table. +# +# - Update both types of tables. First a N-Table and the a T-Table: +# NT - Upates both types of tables through an update statement. +# NT-trig - Updates both types of tables through a trigger. +# NT-func - Updates both types of tables through a procedure. +# NeT-trig - Fails while updating an n-tuple (n > 1) in a T-Table. +# NeT-func - Fails while updating an n-tuple (n > 1) in a T-Table. +# +# - Update both types of tables. First a T-Table and the a N-Table: +# TN - Upates both types of tables through an update statement. +# TN-trig - Updates both types of tables through a trigger. +# TN-func - Updates both types of tables through a procedure. +# TeN-trig - Fails while updating an n-tuple (n > 1) in a N-Table. +# TeN-func - Fails while updating an n-tuple (n > 1) in a N-Table. +# +# - This is CREATE...SELECT: +# CS-T->T - Creates a T-table selecting from a T-table. +# CS-N->N - Creates a N-table selecting from a N-table. +# CS-T->N - Creates a T-table selecting form a N-table. +# CS-N->T - Creates a N-table selecting from a T-table. +# CSe-T->T - Fails while creating a T-table selecting from a T-table. +# CSe-N->N - Fails while creating a N-table selecting from a N-table. +# CSe-T->N - Fails while creating a T-table selecting from a a N-table. +# CSe-N->T - Fails while creating a N-table selecting from a T-table. +# drop-CS - Drops any of the tables previously created. +# CT - Creates a temporary T-table. +# drop-CT - Drops a temporary T-table. +# +# The format of the entries in the binlog depends on the mode and on the type +# statements: S - statement and R - row. And when it is clear from the context +# which statement is referred to, we sometimes use "M" to denote a "Mixed" +# statement, i.e., one that accesses both a T-table and an N-table. +# +# For further details, please, read WL#2687 and WL#5072. +################################################################################ +--echo ######################################################################### +--echo # CONFIGURATION +--echo ######################################################################### + +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + +SET @commands= 'configure'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +--echo ######################################################################### +--echo # 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES +--echo ######################################################################### connection master; -SET SQL_LOG_BIN=0; -CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -SET SQL_LOG_BIN=1; +--echo +--echo +--echo +--echo +--echo # +--echo #1) Generates in the binlog what follows: +--echo # --> STMT "B T C" entries, format S. +--echo # --> ROW "B T C" entries, format R. +--echo # --> MIXED "B T C" entries, format S. +--echo # +SET @commands= 'T'; +--source extra/rpl_tests/rpl_mixing_engines.inc -connection slave; +SET @commands= 'T-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc -SET SQL_LOG_BIN=0; -CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -SET SQL_LOG_BIN=1; +SET @commands= 'T-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc -connection master; +SET @commands= 'T-proc'; +--source extra/rpl_tests/rpl_mixing_engines.inc -DELIMITER |; -CREATE FUNCTION f1 () RETURNS VARCHAR(64) -BEGIN - RETURN "Testing..."; -END| +--echo +--echo +--echo +--echo +--echo # +--echo #1.e) Generates in the binlog what follows: +--echo # --> STMT empty. +--echo # --> ROW empty. +--echo # --> MIXED empty. +--echo # +SET @commands= 'eT'; +--source extra/rpl_tests/rpl_mixing_engines.inc -CREATE FUNCTION f2 () RETURNS VARCHAR(64) -BEGIN - RETURN f1(); -END| +SET @commands= 'Te'; +--source extra/rpl_tests/rpl_mixing_engines.inc -CREATE PROCEDURE pc_i_tt_3 (IN x INT, IN y VARCHAR(64)) -BEGIN - INSERT INTO tt_3 VALUES (y,x,x); -END| +SET @commands= 'Te-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc -CREATE TRIGGER tr_i_tt_3_to_nt_3 BEFORE INSERT ON tt_3 FOR EACH ROW -BEGIN - INSERT INTO nt_3 VALUES (NEW.a, NEW.b, NEW.c); -END| +SET @commands= 'Te-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc -CREATE TRIGGER tr_i_nt_4_to_tt_4 BEFORE INSERT ON nt_4 FOR EACH ROW -BEGIN - INSERT INTO tt_4 VALUES (NEW.a, NEW.b, NEW.c); -END| +--echo +--echo +--echo +--echo +--echo # +--echo #2) Generates in the binlog what follows: +--echo # --> STMT "B N C" entry, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format S. +--echo # +SET @commands= 'N'; +--source extra/rpl_tests/rpl_mixing_engines.inc -DELIMITER ;| +SET @commands= 'N-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'N-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'N-proc'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #2.e) Generates in the binlog what follows if a N-table is changed: +--echo # --> STMT "B N C" entry, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format S. +--echo # +SET @commands= 'eN'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'Ne'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'Ne-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'Ne-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +--echo +--echo +--echo +--echo +--echo # +--echo #3) Generates in the binlog what follows: +--echo # --> STMT "B M C" entry if only N-Table is changed, format S. +--echo # --> STMT "B M C" entries, format S. +--echo # --> ROW "B N T B T C" entries, format R. +--echo # --> MIXED "B N T B T C" entries, format R. +--echo # +SET @commands= 'tN'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'nT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'NT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'NT-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'NT-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'TN'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'TN-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'TN-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #3.e) Generates in the binlog what follows: +--echo # --> STMT "B M C" entry if only N-Table is changed, format S. +--echo # --> STMT "B M R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +SET @commands= 'tNe'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'nTe'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'NeT-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'NeT-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'TeN-trig'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'TeN-func'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +--echo +--echo +--echo +--echo +--echo # +--echo #4) Generates in the binlog what follows: +--echo # --> STMT "B T T C" entries, format S. +--echo # --> ROW "B T T C" entries, format R. +--echo # --> MIXED "B T T C" entries, format S +--echo # +SET @commands= 'B T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #4.e) Generates in the binlog what follows: +--echo # --> STMT "B T C" entries, format S. +--echo # --> ROW "B T C" entries, format R. +--echo # --> MIXED "B T C" entries, format S. +--echo # +SET @commands= 'B T eT C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Te C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Te-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Te-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B eT T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #5) Generates in the binlog what follows: +--echo # --> STMT empty. +--echo # --> ROW empty. +--echo # --> MIXED empty. +--echo # +SET @commands= 'B T T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #5.e) Generates in the binlog what follows: +--echo # --> STMT empty. +--echo # --> ROW empty. +--echo # --> MIXED empty. +--echo # +SET @commands= 'B T eT R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Te R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Te-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Te-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B eT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #6) Generates in the binlog what follows: +--echo # --> STMT "B N C B N C" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S. +--echo # +SET @commands= 'B N N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #6.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B N C B N C" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S. +--echo # +SET @commands= 'B N eN C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N Ne C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N Ne-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N Ne-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B eN N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Ne N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Ne-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Ne-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #7) Generates in the binlog what follows: +--echo # --> STMT "B N C B N C" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S. +--echo # +SET @commands= 'B N N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #7.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B N C B N C" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S. +--echo # +SET @commands= 'B N eN R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N Ne R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N Ne-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N Ne-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B eN N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Ne N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Ne-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Ne-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #8) Generates in the binlog what follows: +--echo # --> STMT "B T N C" entries, format S. +--echo # --> ROW "B N C B T C" entries, format R. +--echo # --> MIXED "B N C B T C" entries, format R in N and S in T. +--echo # +SET @commands= 'B T N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #8.e) Generates in the binlog what follows if T-* fails: +--echo # --> STMT "B N C" entry, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # Otherwise, what follows if N-* fails and a N-Table is changed: +--echo # --> STMT "B T N C" entries, format S. +--echo # --> ROW "B N C B T C" entries, format R. +--echo # --> MIXED "B N C B T C" entries, format R in N and S in T. +--echo # +SET @commands= 'B eT N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T eN C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Ne C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #9) Generates in the binlog what follows: +--echo # --> STMT "B T N R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # +SET @commands= 'B T N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-trig N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-func N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T-proc N-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #9.e) Generates in the binlog what follows if T* fails: +--echo # --> STMT "B N C" entry, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # Otherwise, what follows if N* fails and a N-Table is changed: +--echo # --> STMT "B T N R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # +SET @commands= 'B eT N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B Te N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T eN R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T Ne R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + + +--echo +--echo +--echo +--echo +--echo # +--echo #10) Generates in the binlog: +--echo # --> STMT "B N C B T C" entries, format S. +--echo # --> ROW "B N C B T C" entries, format R. +--echo # --> MIXED "B N C B T C" entries, format S. +--echo # +SET @commands= 'B N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T-proc C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #11) Generates in the binlog what follows: +--echo # --> STMT "B N C" entries, format S. +--echo # --> ROW "B N C" entries, format R. +--echo # --> MIXED "B N C" entries, format S. +--echo # + +SET @commands= 'B N T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-trig T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-func T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T-proc R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N-proc T-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #12) Generates in the binlog what follows: +--echo # --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M T C" entries, format S. +--echo # --> ROW "B N C B T T C" entries, format R. +--echo # --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +--echo # +SET @commands= 'B tN T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nT T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #12.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M T C" entries, format S. +--echo # --> ROW "B N C B T T C" entries, format R. +--echo # --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. + --echo # +SET @commands= 'B tNe T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nTe T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-trig T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-func T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #13) "B M T R" generates in the binlog: +--echo # --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M T R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # +SET @commands= 'B tN T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #13.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M T R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # +SET @commands= 'B tNe T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nTe T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-trig T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-func T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #14) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B T M C" entries, format S. +--echo # --> ROW "B N C B T T C" entries, format R. +--echo # --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +--echo # +SET @commands= 'B T tN C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T nT C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NT C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NT-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NT-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TN C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TN-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TN-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #14.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B T M C" entries, format S. +--echo # --> ROW "B N C B T C" entry, format R. +--echo # --> MIXED "B N C B T C" entry, format R. +--echo # +SET @commands= 'B T tNe C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T nTe C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NeT-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NeT-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TeN-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TeN-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +--echo +--echo +--echo +--echo +--echo # +--echo #15) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B T M R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # +SET @commands= 'B T tN R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T nT R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NT R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NT-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NT-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TN R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TN-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TN-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #15.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B T M R" entries, format S. +--echo # --> ROW "B N C" entry, format R. +--echo # --> MIXED "B N C" entry, format R. +--echo # +SET @commands= 'B T tNe R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T nTe R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NeT-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T NeT-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TeN-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B T TeN-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #16) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M N C" entries, format S. +--echo # --> ROW "B N C B N C B T C" entries, format R. +--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> MIXED "B N C B N C B T C" entries, format R. +--echo # +SET @commands= 'B tN N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nT N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #16.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M N C" entries, format S. +--echo # --> ROW "B N C B N C B T C" entries, format R. +--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> MIXED "B N C B N C B T C" entries, format R. +--echo # +SET @commands= 'B tNe N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nTe N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-trig N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-func N C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +--echo +--echo +--echo +--echo +--echo # +--echo #17) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M N R" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> MIXED "B N C B N C" entries, format R. +--echo # +SET @commands= 'B tN N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nT N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NT-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TN-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #17.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B M N R" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +--echo # --> MIXED "B N C B N C" entries, format R. +--echo # +SET @commands= 'B tNe N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B nTe N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B NeT-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-trig N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B TeN-func N R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #18) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B N C B M C" entries, format S. +--echo # --> ROW "B N C B N C B T C" entries, format R. +--echo # --> MIXED "B N C B N C B T C" entries, format S in first N and format R in the other. +--echo # + +SET @commands= 'B N tN C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N nT C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NT C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NT-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NT-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TN C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TN-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TN-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + + +--echo +--echo +--echo +--echo +--echo # +--echo #18.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B N C B M C" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +--echo # +SET @commands= 'B N tNe C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N nTe C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NeT-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NeT-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TeN-trig C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TeN-func C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #19) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B N C B M R" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +--echo # + +SET @commands= 'B N tN R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N nT R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NT R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NT-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NT-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TN R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TN-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TN-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo +--echo +--echo +--echo +--echo # +--echo #19.e) Generates in the binlog what follows if a N-Table is changed: +--echo # --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +--echo # --> STMT "B N C B M R" entries, format S. +--echo # --> ROW "B N C B N C" entries, format R. +--echo # --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +--echo # +SET @commands= 'B N tNe R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N nTe R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NeT-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N NeT-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TeN-trig R'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'B N TeN-func R'; +--source extra/rpl_tests/rpl_mixing_engines.inc --echo ################################################################################### ---echo # MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES +--echo # 2 - SAVEPOINT --echo ################################################################################### -connection master; +SET @commands= 'B T S1 T R1 C'; +--source extra/rpl_tests/rpl_mixing_engines.inc -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #1) "B T T C" generates in binlog the "B T T C" entries. ---echo # -BEGIN; -INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4"); -INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4"); -COMMIT; +SET @commands= 'B N T S1 T R1 C'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---source include/show_binlog_events.inc +SET @commands= 'B T N S1 T R1 C'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #1.e) "B T T C" with error in T generates in binlog the "B T T C" entries. ---echo # -INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2"); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -2", -2, "new text -2"); -INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3"); -COMMIT; +SET @commands= 'B T S1 N T R1 C'; +--source extra/rpl_tests/rpl_mixing_engines.inc -BEGIN; -INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5"); ---error ER_DUP_ENTRY -INSERT INTO tt_2 VALUES ("new text -4", -4, "new text -4"), ("new text -5", -5, "new text -5"); -COMMIT; +--echo ################################################################################### +--echo # 3 - CREATE TABLE...SELECT +--echo ################################################################################### +SET @commands= 'CSe-T->T CS-T->T drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---source include/show_binlog_events.inc +SET @commands= 'CSe-N->N CS-N->N drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #2) "B T T R" generates in binlog an "empty" entry. ---echo # -BEGIN; -INSERT INTO tt_1 VALUES ("new text 5", 5, "new text 5"); -INSERT INTO tt_2 VALUES ("new text 5", 5, "new text 5"); -ROLLBACK; +SET @commands= 'CSe-T->N CS-T->N drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---source include/show_binlog_events.inc +SET @commands= 'CSe-N->T CS-N->T drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #2.e) "B T T R" with error in T generates in binlog an "empty" entry. ---echo # -INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7"); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES ("new text -6", -6, "new text -6"), ("new text -7", -7, "new text -7"); -INSERT INTO tt_2 VALUES ("new text -8", -8, "new text -8"); -ROLLBACK; +SET @commands= 'CSe-N->T CS-N->T drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc -BEGIN; -INSERT INTO tt_2 VALUES ("new text -10", -10, "new text -10"); ---error ER_DUP_ENTRY -INSERT INTO tt_2 VALUES ("new text -9", -9, "new text -9"), ("new text -10", -10, "new text -10"); -ROLLBACK; +SET @commands= 'CSe-N->T CS-N->T drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---source include/show_binlog_events.inc +--echo ################################################################################### +--echo # 4 - ROLLBACK TEMPORARY TABLE +--echo ################################################################################### +SET @commands= 'B T CT R'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #3) "B T N C" generates in binlog the "B T N C" entries. ---echo # -BEGIN; -INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6"); -INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6"); -COMMIT; +SET @commands= 'B T S1 T CT R1 R'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---source include/show_binlog_events.inc +SET @commands= 'B T CT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #3.e) "B T N C" with error in either T or N generates in binlog the "B T N C" entries. ---echo # -INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12"); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES ("new text -11", -11, "new text -11"), ("new text -12", -12, "new text -12"); -INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13"); -COMMIT; +SET @commands= 'B tN CT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc -BEGIN; -INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14"); -INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16"); ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16"); -COMMIT; +SET @commands= 'B CT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #4) "B T N R" generates in binlog the "B T N R" entries. ---echo # -BEGIN; -INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7"); -INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7"); -ROLLBACK; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #4.e) "B T N R" with error in either T or N generates in binlog the "B T N R" entries. ---echo # -INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17"); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES ("new text -16", -16, "new text -16"), ("new text -17", -17, "new text -17"); -INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18"); -ROLLBACK; - -BEGIN; -INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19"); -INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21"); ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21"); -ROLLBACK; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #5) "T" generates in binlog the "B T C" entry. ---echo # -INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8"); - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #5.e) "T" with error in T generates in binlog an "empty" entry. ---echo # -INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"); ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -22", -22, "new text -22"); ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES ("new text -23", -23, "new text -23"), ("new text -1", -1, "new text -1"); - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #6) "N" generates in binlog the "N" entry. ---echo # -INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9"); - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #6.e) "N" with error in N generates in binlog an empty entry if the error ---echo # happens in the first tuple. Otherwise, generates the "N" entry and ---echo # the error is appended. ---echo # -INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1"); ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1"); ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1"); - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #7) "M" generates in binglog the "B M C" entries. ---echo # - -DELETE FROM nt_1; - -INSERT INTO nt_1 SELECT * FROM tt_1; - -DELETE FROM tt_1; - -INSERT INTO tt_1 SELECT * FROM nt_1; - -INSERT INTO tt_3 VALUES ("new text 000", 000, ''); - -INSERT INTO tt_3 VALUES("new text 100", 100, f1()); - -INSERT INTO nt_4 VALUES("new text 100", 100, f1()); - -INSERT INTO tt_3 VALUES("new text 200", 200, f2()); - -INSERT INTO nt_4 VALUES ("new text 300", 300, ''); - -INSERT INTO nt_4 VALUES ("new text 400", 400, f1()); - -INSERT INTO nt_4 VALUES ("new text 500", 500, f2()); - -CALL pc_i_tt_3(600, "Testing..."); - -UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; - -UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; - -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; - -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #7.e) "M" with error in M generates in binglog the "B M R" entries. ---echo # - -INSERT INTO nt_3 VALUES ("new text -26", -26, ''); -SELECT * FROM tt_3; ---error ER_DUP_ENTRY -INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, ''); -SELECT * FROM tt_3; - -INSERT INTO tt_4 VALUES ("new text -26", -26, ''); -SELECT * FROM nt_4; ---error ER_DUP_ENTRY -INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, ''); -SELECT * FROM nt_4; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #8) "B N N T C" generates in binglog the "N N B T C" entries. ---echo # -BEGIN; -INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10"); -INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10"); -INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10"); -COMMIT; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo ---echo # ---echo #8.e) "B N N T R" See 6.e and 9.e. ---echo # - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #9) "B N N T R" generates in binlog the "N N B T R" entries. ---echo # -BEGIN; -INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11"); -INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11"); -INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11"); -ROLLBACK; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #9.e) "B N N T R" with error in N generates in binlog the "N N B T R" entries. ---echo # -BEGIN; -INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25"); -INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25"); ---error ER_DUP_ENTRY -INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25"); -INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27"); -ROLLBACK; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #10) "B N N C" generates in binglog the "N N" entries. ---echo # -BEGIN; -INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12"); -INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12"); -COMMIT; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo ---echo # ---echo #10.e) "B N N C" See 6.e and 9.e. ---echo # - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #11) "B N N R" generates in binlog the "N N" entries. ---echo # -BEGIN; -INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13"); -INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13"); -ROLLBACK; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo ---echo # ---echo #11.e) "B N N R" See 6.e and 9.e. ---echo # - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #12) "B M T C" generates in the binlog the "B M T C" entries. ---echo # -DELETE FROM nt_1; -BEGIN; -INSERT INTO nt_1 SELECT * FROM tt_1; -INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14"); -COMMIT; - -DELETE FROM tt_1; -BEGIN; -INSERT INTO tt_1 SELECT * FROM nt_1; -INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15"); -COMMIT; - -BEGIN; -INSERT INTO tt_3 VALUES ("new text 700", 700, ''); -INSERT INTO tt_1 VALUES ("new text 800", 800, ''); -COMMIT; - -BEGIN; -INSERT INTO tt_3 VALUES("new text 900", 900, f1()); -INSERT INTO tt_1 VALUES ("new text 1000", 1000, ''); -COMMIT; - -BEGIN; -INSERT INTO tt_3 VALUES(1100, 1100, f2()); -INSERT INTO tt_1 VALUES ("new text 1200", 1200, ''); -COMMIT; - -BEGIN; -INSERT INTO nt_4 VALUES ("new text 1300", 1300, ''); -INSERT INTO tt_1 VALUES ("new text 1400", 1400, ''); -COMMIT; - -BEGIN; -INSERT INTO nt_4 VALUES("new text 1500", 1500, f1()); -INSERT INTO tt_1 VALUES ("new text 1600", 1600, ''); -COMMIT; - -BEGIN; -INSERT INTO nt_4 VALUES("new text 1700", 1700, f2()); -INSERT INTO tt_1 VALUES ("new text 1800", 1800, ''); -COMMIT; - -BEGIN; -CALL pc_i_tt_3(1900, "Testing..."); -INSERT INTO tt_1 VALUES ("new text 2000", 2000, ''); -COMMIT; - -BEGIN; -UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2100", 2100, ''); -COMMIT; - -BEGIN; -UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2200", 2200, ''); -COMMIT; - -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2300", 2300, ''); -COMMIT; - -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2400", 2400, ''); -COMMIT; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #12.e) "B M T C" with error in M generates in the binlog the "B M T C" entries. ---echo # - ---echo # There is a bug in the slave that needs to be fixed before enabling ---echo # this part of the test. A bug report will be filed referencing this ---echo # test case. - -BEGIN; -INSERT INTO nt_3 VALUES ("new text -28", -28, ''); ---error ER_DUP_ENTRY -INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, ''); -INSERT INTO tt_1 VALUES ("new text -27", -27, ''); -COMMIT; - -BEGIN; -INSERT INTO tt_4 VALUES ("new text -28", -28, ''); ---error ER_DUP_ENTRY -INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, ''); -INSERT INTO tt_1 VALUES ("new text -28", -28, ''); -COMMIT; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #13) "B M T R" generates in the binlog the "B M T R" entries ---echo # - -DELETE FROM nt_1; -BEGIN; -INSERT INTO nt_1 SELECT * FROM tt_1; -INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17"); -ROLLBACK; - -DELETE FROM tt_1; -BEGIN; -INSERT INTO tt_1 SELECT * FROM nt_1; -INSERT INTO tt_2 VALUES ("new text 18", 18, "new text 18"); -ROLLBACK; -INSERT INTO tt_1 SELECT * FROM nt_1; - -BEGIN; -INSERT INTO tt_3 VALUES ("new text 2500", 2500, ''); -INSERT INTO tt_1 VALUES ("new text 2600", 2600, ''); -ROLLBACK; - -BEGIN; -INSERT INTO tt_3 VALUES("new text 2700", 2700, f1()); -INSERT INTO tt_1 VALUES ("new text 2800", 2800, ''); -ROLLBACK; - -BEGIN; -INSERT INTO tt_3 VALUES(2900, 2900, f2()); -INSERT INTO tt_1 VALUES ("new text 3000", 3000, ''); -ROLLBACK; - -BEGIN; -INSERT INTO nt_4 VALUES ("new text 3100", 3100, ''); -INSERT INTO tt_1 VALUES ("new text 3200", 3200, ''); -ROLLBACK; - -BEGIN; -INSERT INTO nt_4 VALUES("new text 3300", 3300, f1()); -INSERT INTO tt_1 VALUES ("new text 3400", 3400, ''); -ROLLBACK; - -BEGIN; -INSERT INTO nt_4 VALUES("new text 3500", 3500, f2()); -INSERT INTO tt_1 VALUES ("new text 3600", 3600, ''); -ROLLBACK; - -BEGIN; -CALL pc_i_tt_3(3700, "Testing..."); -INSERT INTO tt_1 VALUES ("new text 3700", 3700, ''); -ROLLBACK; - -BEGIN; -UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 3800", 3800, ''); -ROLLBACK; - -BEGIN; -UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 3900", 3900, ''); -ROLLBACK; - -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 4000", 4000, ''); -ROLLBACK; - -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 4100", 4100, ''); -ROLLBACK; - ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); ---echo # ---echo #13.e) "B M T R" with error in M generates in the binlog the "B M T R" entries. ---echo # - -BEGIN; -INSERT INTO nt_3 VALUES ("new text -30", -30, ''); ---error ER_DUP_ENTRY -INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, ''); -INSERT INTO tt_1 VALUES ("new text -30", -30, ''); -ROLLBACK; - -BEGIN; -INSERT INTO tt_4 VALUES ("new text -30", -30, ''); ---error ER_DUP_ENTRY -INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, ''); -INSERT INTO tt_1 VALUES ("new text -31", -31, ''); -ROLLBACK; - ---source include/show_binlog_events.inc +SET @commands= 'B N CT T R'; +--source extra/rpl_tests/rpl_mixing_engines.inc +--echo ################################################################################### +--echo # CHECK CONSISTENCY +--echo ################################################################################### connection master; sync_slave_with_master; - ---exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-master.sql ---exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-slave.sql ---diff_files $MYSQLTEST_VARDIR/tmp/test-master.sql $MYSQLTEST_VARDIR/tmp/test-slave.sql - + +--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql +--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql +--diff_files $MYSQLTEST_VARDIR/tmp/test-nmt-master.sql $MYSQLTEST_VARDIR/tmp/test-nmt-slave.sql + --echo ################################################################################### --echo # CLEAN --echo ################################################################################### - -connection master; -DROP TABLE tt_1; -DROP TABLE tt_2; -DROP TABLE tt_3; -DROP TABLE tt_4; -DROP TABLE nt_1; -DROP TABLE nt_2; -DROP TABLE nt_3; -DROP TABLE nt_4; -DROP PROCEDURE pc_i_tt_3; -DROP FUNCTION f1; -DROP FUNCTION f2; - -sync_slave_with_master; +SET @commands= 'clean'; +--source extra/rpl_tests/rpl_mixing_engines.inc diff --git a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc index 50036e564a7..cf68ba53caf 100644 --- a/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc +++ b/mysql-test/extra/rpl_tests/rpl_show_relaylog_events.inc @@ -23,7 +23,7 @@ let $binary_log_limit_row= 3; -- echo [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* let $binary_log_file= ; -let $binary_log_limit_row= 3; +let $binary_log_limit_row= 4; let $binary_log_limit_offset= 1; -- source include/show_binlog_events.inc @@ -49,7 +49,7 @@ let $binary_log_limit_row= 3; -- echo [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* let $binary_log_file= ; -let $binary_log_limit_row= 3; +let $binary_log_limit_row= 4; let $binary_log_limit_offset= 1; -- source include/show_binlog_events.inc diff --git a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test similarity index 91% rename from mysql-test/suite/rpl/t/rpl_start_stop_slave.test rename to mysql-test/extra/rpl_tests/rpl_start_stop_slave.test index d9b87427321..4029a628e04 100644 --- a/mysql-test/suite/rpl/t/rpl_start_stop_slave.test +++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test @@ -1,10 +1,14 @@ -source include/master-slave.inc; -source include/have_innodb.inc; - # # Bug#6148 () # # Let the master do lots of insertions + +connection master; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + +connection slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + connection master; create table t1(n int); sync_slave_with_master; diff --git a/mysql-test/suite/rpl/t/rpl_stop_middle_group.test b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test similarity index 97% rename from mysql-test/suite/rpl/t/rpl_stop_middle_group.test rename to mysql-test/extra/rpl_tests/rpl_stop_middle_group.test index 2cd41b45cf9..96ae314bee5 100644 --- a/mysql-test/suite/rpl/t/rpl_stop_middle_group.test +++ b/mysql-test/extra/rpl_tests/rpl_stop_middle_group.test @@ -1,7 +1,3 @@ --- source include/have_debug.inc --- source include/master-slave.inc --- source include/have_innodb.inc - # Proving that stopping in the middle of applying a group of events # does not have immediate effect if a non-transaction table has been changed. # The slave sql thread has to try to finish applying first. @@ -11,6 +7,8 @@ connection master; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + create table tm (a int auto_increment primary key) engine=myisam; create table ti (a int auto_increment primary key) engine=innodb; diff --git a/mysql-test/include/commit.inc b/mysql-test/include/commit.inc index d91ba8291fd..4336d3be0ed 100644 --- a/mysql-test/include/commit.inc +++ b/mysql-test/include/commit.inc @@ -547,9 +547,9 @@ call p_verify_status_increment(0, 0, 0, 0); --echo # the binary log. --echo # select f1(); -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); commit; -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); --echo # 17. Read-only statement, a function changes non-trans-table. --echo # @@ -557,15 +557,19 @@ call p_verify_status_increment(0, 0, 1, 0); --echo # non-transactional changes saved in the transaction cache to --echo # the binary log. --echo # +--disable_warnings select f1() from t1; -call p_verify_status_increment(1, 0, 2, 0); +--enable_warnings +call p_verify_status_increment(2, 0, 2, 0); commit; -call p_verify_status_increment(1, 0, 2, 0); +call p_verify_status_increment(2, 0, 2, 0); --echo # 18. Read-write statement: UPDATE, change 0 (transactional) rows. --echo # select count(*) from t2; +--disable_warnings update t1 set a=2 where a=f1()+10; +--enable_warnings select count(*) from t2; call p_verify_status_increment(2, 0, 2, 0); commit; @@ -579,7 +583,7 @@ call p_verify_status_increment(2, 0, 2, 0); drop table t2; set sql_mode=no_engine_substitution; create temporary table t2 (a int); -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); set sql_mode=default; --echo # 19. A function changes temp-trans-table. --echo # @@ -636,9 +640,9 @@ call p_verify_status_increment(2, 0, 1, 0); --echo # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction --echo # drop temporary table t2; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); commit; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); --echo # 26. Verify that SET AUTOCOMMIT issues an implicit commit --echo # @@ -719,17 +723,17 @@ call p_verify_status_increment(4, 4, 4, 4); --echo # Sic: no table is created. create table if not exists t2 (a int) select 6 union select 7; --echo # Sic: first commits the statement, and then the transaction. -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 4, 4); create table t3 select a from t2; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 4, 4); alter table t3 add column (b int); call p_verify_status_increment(2, 0, 2, 0); alter table t3 rename t4; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); rename table t4 to t3; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); truncate table t3; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 2, 0); create view v1 as select * from t2; call p_verify_status_increment(1, 0, 1, 0); check table t1; diff --git a/mysql-test/r/commit_1innodb.result b/mysql-test/r/commit_1innodb.result index 51c4ac3002c..cf8c0e085c9 100644 --- a/mysql-test/r/commit_1innodb.result +++ b/mysql-test/r/commit_1innodb.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); set sql_mode=no_engine_substitution; set storage_engine = InnoDB; set autocommit=1; @@ -578,11 +579,11 @@ SUCCESS select f1(); f1() 2 -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS commit; -call p_verify_status_increment(0, 0, 1, 0); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS # 17. Read-only statement, a function changes non-trans-table. @@ -595,11 +596,11 @@ select f1() from t1; f1() 2 2 -call p_verify_status_increment(1, 0, 2, 0); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS commit; -call p_verify_status_increment(1, 0, 2, 0); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS # 18. Read-write statement: UPDATE, change 0 (transactional) rows. @@ -627,7 +628,7 @@ SUCCESS drop table t2; set sql_mode=no_engine_substitution; create temporary table t2 (a int); -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); SUCCESS set sql_mode=default; @@ -708,11 +709,11 @@ SUCCESS # 25. DDL: DROP TEMPORARY TABLE, does not start a transaction # drop temporary table t2; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); SUCCESS commit; -call p_verify_status_increment(0, 0, 0, 0); +call p_verify_status_increment(1, 0, 0, 0); SUCCESS # 26. Verify that SET AUTOCOMMIT issues an implicit commit @@ -829,11 +830,11 @@ create table if not exists t2 (a int) select 6 union select 7; Warnings: Note 1050 Table 't2' already exists # Sic: first commits the statement, and then the transaction. -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 4, 4); SUCCESS create table t3 select a from t2; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 4, 4); SUCCESS alter table t3 add column (b int); @@ -841,15 +842,15 @@ call p_verify_status_increment(2, 0, 2, 0); SUCCESS alter table t3 rename t4; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS rename table t4 to t3; -call p_verify_status_increment(2, 2, 2, 2); +call p_verify_status_increment(1, 0, 1, 0); SUCCESS truncate table t3; -call p_verify_status_increment(4, 4, 4, 4); +call p_verify_status_increment(2, 0, 2, 0); SUCCESS create view v1 as select * from t2; diff --git a/mysql-test/r/ctype_cp932_binlog_stm.result b/mysql-test/r/ctype_cp932_binlog_stm.result index bb971e5453b..f5ae318222d 100644 --- a/mysql-test/r/ctype_cp932_binlog_stm.result +++ b/mysql-test/r/ctype_cp932_binlog_stm.result @@ -9,11 +9,14 @@ EXECUTE stmt1 USING @var1; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1(f1 blob) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(0x8300) +master-bin.000001 # Query # # COMMIT SELECT HEX(f1) FROM t1; HEX(f1) 8300 DROP table t1; +call mtr.add_suppression('Error in Log_event::read_log_event()'); CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2))| @@ -29,22 +32,27 @@ HEX(s1) HEX(s2) d 466F6F2773206120426172 ED40ED41ED42 47.93 DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 371| +SHOW BINLOG EVENTS FROM 514| Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 371 Query 1 537 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, +master-bin.000001 514 Query 1 581 BEGIN +master-bin.000001 581 Query 1 788 use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Error in Log_event::read_log_event()' COLLATE 'latin1_swedish_ci')) +master-bin.000001 788 Query 1 856 COMMIT +master-bin.000001 856 Query 1 1019 use `test`; CREATE TABLE t4 (s1 CHAR(50) CHARACTER SET latin1, s2 CHAR(50) CHARACTER SET cp932, d DECIMAL(10,2)) -master-bin.000001 537 Query 1 786 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50), +master-bin.000001 1019 Query 1 1265 use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `bug18293`(IN ins1 CHAR(50), IN ins2 CHAR(50) CHARACTER SET cp932, IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 786 Query 1 1050 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) -master-bin.000001 1050 Query 1 1139 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1139 Query 1 1218 use `test`; DROP TABLE t4 +master-bin.000001 1265 Query 1 1333 BEGIN +master-bin.000001 1333 Query 1 1597 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172 COLLATE 'latin1_swedish_ci'), NAME_CONST('ins2',_cp932 0xED40ED41ED42 COLLATE 'cp932_japanese_ci'), NAME_CONST('ind',47.93)) +master-bin.000001 1597 Query 1 1666 COMMIT +master-bin.000001 1666 Query 1 1752 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1752 Query 1 1828 use `test`; DROP TABLE t4 End of 5.0 tests -SHOW BINLOG EVENTS FROM 366; +SHOW BINLOG EVENTS FROM 490; ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. CREATE TABLE t1 (a varchar(16)) character set cp932; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 4f22029814c..2513e94137f 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -604,7 +604,7 @@ a b 4 4 show master status /* there must be the UPDATE query event */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 207 +master-bin.000001 344 delete from t1; delete from t2; insert into t1 values (1,2),(3,4),(4,4); @@ -614,7 +614,7 @@ UPDATE t2,t1 SET t2.a=t2.b where t2.a=t1.a; ERROR 23000: Duplicate entry '4' for key 'PRIMARY' show master status /* there must be the UPDATE query event */; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000001 222 +master-bin.000001 359 drop table t1, t2; set @@session.binlog_format= @sav_binlog_format; drop table if exists t1, t2, t3; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index 295a2f41d40..822c176a542 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -37,24 +37,60 @@ SET TIMESTAMP=1000000000/*!*/; create table t2 (id int auto_increment not null primary key) /*!*/; SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("abirvalg") /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1000000000/*!*/; insert into t2 values () /*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -64,7 +100,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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/*!*/; @@ -74,8 +109,24 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -96,7 +147,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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/*!*/; @@ -106,8 +156,15 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -137,24 +194,60 @@ SET TIMESTAMP=1000000000/*!*/; create table t2 (id int auto_increment not null primary key) /*!*/; SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("abirvalg") /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1000000000/*!*/; insert into t2 values () /*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -164,7 +257,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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/*!*/; @@ -174,8 +266,24 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -196,7 +304,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -use test/*!*/; SET TIMESTAMP=1000000000/*!*/; 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/*!*/; @@ -206,8 +313,15 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +use test/*!*/; +SET TIMESTAMP=1000000000/*!*/; insert into t1 values ("Alas") /*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -359,31 +473,73 @@ SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a varchar(64) character set utf8) /*!*/; SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=7/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=DEFAULT/*!*/; -load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +BEGIN /*!*/; SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-#-#' INTO table t1 +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=7/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-a-0' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; SET @@session.collation_database=DEFAULT/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-b-0' INTO table t1 /*!*/; SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=1000000000/*!*/; load data LOCAL INFILE 'MYSQLTEST_VARDIR/tmp/SQL_LOAD_MB-c-0' INTO table t1 character set koi8r /*!*/; SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1000000000/*!*/; drop table t1 /*!*/; DELIMITER ; @@ -399,9 +555,9 @@ We expect this value to be 1 The bug being tested was that 'Query' lines were not preceded by '#' If the line is in the table, it had to have been preceded by a '#' -SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%'; -BUG#28293_expect_1 -1 +SELECT COUNT(*) AS `BUG#28293_expect_3` FROM patch WHERE a LIKE '%Query%'; +BUG#28293_expect_3 +3 DROP TABLE patch; FLUSH LOGS; CREATE TABLE t1(a INT); @@ -426,7 +582,7 @@ CREATE TABLE t1 (a INT, b CHAR(64)); flush logs; INSERT INTO t1 VALUES (1,USER()); flush logs; -mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql +mysqlbinlog var/log/master-bin.000018 > var/tmp/bug31611.sql mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql INSERT INTO t1 VALUES (1,USER()); ERROR 42000: INSERT command denied to user 'untrusted'@'localhost' for table 't1' @@ -452,7 +608,7 @@ an_int 1000 a_decimal 907.79 a_string Just a test DROP TABLE t1; ->> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql +>> mysqlbinlog var/log/master-bin.000020 > var/tmp/bug32580.sql >> mysql test < var/tmp/bug32580.sql SELECT * FROM t1; a_real 158.883 diff --git a/mysql-test/r/mysqlbinlog2.result b/mysql-test/r/mysqlbinlog2.result index dba9bdc9d70..e4515a1c88c 100644 --- a/mysql-test/r/mysqlbinlog2.result +++ b/mysql-test/r/mysqlbinlog2.result @@ -31,26 +31,56 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -61,8 +91,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=1/*!*/; -use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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/*!*/; @@ -72,24 +100,56 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -100,9 +160,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=4/*!*/; -use test/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -111,12 +169,36 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c") +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -139,17 +221,25 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; -SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; -insert into t1 values(null, "c") +SET TIMESTAMP=1579609942/*!*/; +COMMIT /*!*/; DELIMITER ; # End of log file @@ -161,9 +251,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=4/*!*/; -use test/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -172,7 +260,12 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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/*!*/; -insert into t1 values(null, "d") +BEGIN +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c") /*!*/; DELIMITER ; # End of log file @@ -184,8 +277,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=3/*!*/; -use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -195,16 +286,36 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -227,14 +338,26 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -258,30 +381,58 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -291,8 +442,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -303,8 +462,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=1/*!*/; -use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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/*!*/; @@ -314,28 +471,58 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -345,8 +532,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -357,9 +552,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=4/*!*/; -use test/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -368,16 +561,38 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c") +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -387,8 +602,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -411,28 +634,69 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; +SET TIMESTAMP=1579609943/*!*/; +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 +/*!*/; SET INSERT_ID=6/*!*/; DELIMITER ; # End of log file @@ -444,8 +708,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=3/*!*/; -use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -455,20 +717,38 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -478,8 +758,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -502,14 +790,26 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -532,26 +832,56 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -562,8 +892,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=1/*!*/; -use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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/*!*/; @@ -573,24 +901,56 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -600,9 +960,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET INSERT_ID=4/*!*/; -use test/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -611,12 +969,36 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c") +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -639,17 +1021,25 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; -SET INSERT_ID=3/*!*/; -SET TIMESTAMP=1579609944/*!*/; -insert into t1 values(null, "c") +SET TIMESTAMP=1579609942/*!*/; +COMMIT /*!*/; DELIMITER ; # End of log file @@ -660,9 +1050,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET INSERT_ID=4/*!*/; -use test/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -671,7 +1059,12 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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/*!*/; -insert into t1 values(null, "d") +BEGIN +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c") /*!*/; DELIMITER ; # End of log file @@ -683,8 +1076,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=3/*!*/; -use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -694,16 +1085,36 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -726,14 +1137,26 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -756,30 +1179,58 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -789,8 +1240,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -801,8 +1260,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=1/*!*/; -use test/*!*/; SET TIMESTAMP=1579609942/*!*/; 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/*!*/; @@ -812,28 +1269,58 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=1/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -843,8 +1330,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -854,9 +1349,7 @@ ROLLBACK /* added by mysqlbinlog */; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; -SET INSERT_ID=4/*!*/; -use test/*!*/; -SET TIMESTAMP=1579609946/*!*/; +SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -865,16 +1358,38 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; +insert into t1 values(null, "c") +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; +SET INSERT_ID=4/*!*/; +SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -884,8 +1399,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -908,29 +1431,69 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; +SET TIMESTAMP=1579609943/*!*/; +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 +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -941,8 +1504,6 @@ ROLLBACK /* added by mysqlbinlog */; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET INSERT_ID=3/*!*/; -use test/*!*/; SET TIMESTAMP=1579609944/*!*/; 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/*!*/; @@ -952,20 +1513,38 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=3/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; DELIMITER ; DELIMITER /*!*/; -SET INSERT_ID=6/*!*/; -use test/*!*/; SET TIMESTAMP=1579609943/*!*/; 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/*!*/; @@ -975,8 +1554,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET INSERT_ID=6/*!*/; +use test/*!*/; +SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -999,14 +1586,26 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; @@ -1029,30 +1628,66 @@ SET @@session.lc_time_names=0/*!*/; SET @@session.collation_database=DEFAULT/*!*/; create table t1 (a int auto_increment not null primary key, b char(3)) /*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=1/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "a") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609942/*!*/; +BEGIN +/*!*/; SET INSERT_ID=2/*!*/; SET TIMESTAMP=1579609942/*!*/; insert into t1 values(null, "b") /*!*/; +SET TIMESTAMP=1579609942/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609944/*!*/; +BEGIN +/*!*/; SET INSERT_ID=3/*!*/; SET TIMESTAMP=1579609944/*!*/; insert into t1 values(null, "c") /*!*/; +SET TIMESTAMP=1579609944/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=4/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "d") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609946/*!*/; +BEGIN +/*!*/; SET INSERT_ID=5/*!*/; SET TIMESTAMP=1579609946/*!*/; insert into t1 values(null, "e") /*!*/; +SET TIMESTAMP=1579609946/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=1579609943/*!*/; +BEGIN +/*!*/; SET INSERT_ID=6/*!*/; SET TIMESTAMP=1579609943/*!*/; insert into t1 values(null, "f") /*!*/; +SET TIMESTAMP=1579609943/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/r/mysqlbinlog_row_trans.result b/mysql-test/r/mysqlbinlog_row_trans.result index 9c3348a9e76..a925fd830bf 100644 --- a/mysql-test/r/mysqlbinlog_row_trans.result +++ b/mysql-test/r/mysqlbinlog_row_trans.result @@ -215,7 +215,7 @@ COMMIT/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -BEGIN +TRUNCATE TABLE t1 /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -223,21 +223,84 @@ SET TIMESTAMP=1000000000/*!*/; TRUNCATE TABLE t1 /*!*/; # at # -#010909 4:46:40 server id 1 end_log_pos # Xid = # -COMMIT/*!*/; +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F +### INSERT INTO test.t2 +### SET +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### INSERT INTO test.t2 +### SET +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### INSERT INTO test.t2 +### SET +### @1=3 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; BEGIN /*!*/; # at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F +### UPDATE test.t2 +### WHERE +### @1=1 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### SET +### @1=11 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### UPDATE test.t2 +### WHERE +### @1=2 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### SET +### @1=12 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### UPDATE test.t2 +### WHERE +### @1=3 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +### SET +### @1=13 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -TRUNCATE TABLE t1 +COMMIT /*!*/; # at # -#010909 4:46:40 server id 1 end_log_pos # Xid = # -COMMIT/*!*/; +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # +# at # +#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # +#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F +### DELETE FROM test.t2 +### WHERE +### @1=12 /* INT meta=0 nullable=1 is_null=0 */ +### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; @@ -293,71 +356,14 @@ BEGIN ### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ # at # -# at # -#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # -#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F -### INSERT INTO test.t2 -### SET -### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### INSERT INTO test.t2 -### SET -### @1=2 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### INSERT INTO test.t2 -### SET -### @1=3 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # -#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F -### UPDATE test.t2 -### WHERE -### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### SET -### @1=11 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### UPDATE test.t2 -### WHERE -### @1=2 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### SET -### @1=12 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### UPDATE test.t2 -### WHERE -### @1=3 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### SET -### @1=13 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # -#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F -### DELETE FROM test.t2 -### WHERE -### @1=12 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -# at # #010909 4:46:40 server id 1 end_log_pos # Xid = # COMMIT/*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -BEGIN -/*!*/; -# at # -#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -SET TIMESTAMP=1000000000/*!*/; TRUNCATE TABLE t1 /*!*/; # at # -#010909 4:46:40 server id 1 end_log_pos # Xid = # -COMMIT/*!*/; -# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; TRUNCATE TABLE t2 @@ -369,55 +375,6 @@ BEGIN /*!*/; # at # # at # -#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # -#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F -### INSERT INTO test.t1 -### SET -### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### INSERT INTO test.t1 -### SET -### @1=2 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### INSERT INTO test.t1 -### SET -### @1=3 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # -#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F -### UPDATE test.t1 -### WHERE -### @1=1 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### SET -### @1=11 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### UPDATE test.t1 -### WHERE -### @1=2 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### SET -### @1=12 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### UPDATE test.t1 -### WHERE -### @1=3 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -### SET -### @1=13 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -# at # -# at # -#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # -#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F -### DELETE FROM test.t1 -### WHERE -### @1=12 /* INT meta=0 nullable=1 is_null=0 */ -### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ -# at # -# at # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test.t2 @@ -433,6 +390,16 @@ BEGIN ### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # # at # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F @@ -458,6 +425,16 @@ BEGIN ### @1=13 /* INT meta=0 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ # at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +COMMIT +/*!*/; +# at # +#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 +SET TIMESTAMP=1000000000/*!*/; +BEGIN +/*!*/; +# at # # at # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F @@ -468,12 +445,7 @@ BEGIN # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; -ROLLBACK -/*!*/; -# at # -#010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 -SET TIMESTAMP=1000000000/*!*/; -BEGIN +COMMIT /*!*/; # at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 @@ -481,9 +453,6 @@ SET TIMESTAMP=1000000000/*!*/; TRUNCATE TABLE t1 /*!*/; # at # -#010909 4:46:40 server id 1 end_log_pos # Xid = # -COMMIT/*!*/; -# at # #010909 4:46:40 server id 1 end_log_pos # Query thread_id=# exec_time=# error_code=0 SET TIMESTAMP=1000000000/*!*/; TRUNCATE TABLE t2 diff --git a/mysql-test/r/user_var-binlog.result b/mysql-test/r/user_var-binlog.result index 05efea79fe7..513e1bcbc82 100644 --- a/mysql-test/r/user_var-binlog.result +++ b/mysql-test/r/user_var-binlog.result @@ -8,18 +8,20 @@ SET @var2=char(ascii('a')); insert into t1 values (@var1),(@var2); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`a b`=_latin1 0x68656C6C6F COLLATE latin1_swedish_ci master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@`a b`) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`var1`=_latin1 0x273B616161 COLLATE latin1_swedish_ci master-bin.000001 # User var # # @`var2`=_binary 0x61 COLLATE binary master-bin.000001 # Query # # use `test`; insert into t1 values (@var1),(@var2) +master-bin.000001 # Query # # COMMIT flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/; -use test/*!*/; SET TIMESTAMP=10000/*!*/; 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/*!*/; @@ -29,13 +31,27 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET @`a b`:=_latin1 0x68656C6C6F COLLATE `latin1_swedish_ci`/*!*/; +use test/*!*/; +SET TIMESTAMP=10000/*!*/; INSERT INTO t1 VALUES(@`a b`) /*!*/; +SET TIMESTAMP=10000/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=10000/*!*/; +BEGIN +/*!*/; SET @`var1`:=_latin1 0x273B616161 COLLATE `latin1_swedish_ci`/*!*/; SET @`var2`:=_binary 0x61 COLLATE `binary`/*!*/; SET TIMESTAMP=10000/*!*/; insert into t1 values (@var1),(@var2) /*!*/; +SET TIMESTAMP=10000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index 1cc9281f3fc..c6fd37d39ee 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -29,9 +29,13 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table tt1, t1 FLUSH STATUS; set binlog_format=mixed; @@ -65,9 +69,13 @@ show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # drop database if exists mysqltest1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table tt1, t1 FLUSH STATUS; set binlog_format=row; diff --git a/mysql-test/suite/binlog/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result index 72fda535b6f..b21576fd8ee 100644 --- a/mysql-test/suite/binlog/r/binlog_killed.result +++ b/mysql-test/suite/binlog/r/binlog_killed.result @@ -87,8 +87,10 @@ select @b /* must be 1 at the end of a stmt calling bug27563() */; must have the update query event more to FD show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`b`=0 master-bin.000001 # Query # # use `test`; update t4 set b=b + bug27563(b) +master-bin.000001 # Query # # COMMIT select (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) is not null; @@ -123,8 +125,10 @@ select @b /* must be 1 at the end of a stmt calling bug27563() */; must have the delete query event more to FD show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`b`=0 master-bin.000001 # Query # # use `test`; delete from t4 where b=bug27563(1) or b=bug27563(2) +master-bin.000001 # Query # # COMMIT select (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) is not null; diff --git a/mysql-test/suite/binlog/r/binlog_killed_simulate.result b/mysql-test/suite/binlog/r/binlog_killed_simulate.result index 634d3f62814..3b8552ef0e1 100644 --- a/mysql-test/suite/binlog/r/binlog_killed_simulate.result +++ b/mysql-test/suite/binlog/r/binlog_killed_simulate.result @@ -18,8 +18,10 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "kil ERROR 70100: Query execution was interrupted show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "killed" in the middle */ ;file_id=# +master-bin.000001 # Query # # COMMIT select (@a:=load_file("MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) is not null; diff --git a/mysql-test/suite/binlog/r/binlog_multi_engine.result b/mysql-test/suite/binlog/r/binlog_multi_engine.result index d7636b1cb77..eee83183575 100644 --- a/mysql-test/suite/binlog/r/binlog_multi_engine.result +++ b/mysql-test/suite/binlog/r/binlog_multi_engine.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM; CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE; CREATE TABLE t1n (e INT, f INT) ENGINE=NDB; @@ -6,10 +7,15 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +The last event before the COMMIT is use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c *** Please look in binlog_multi_engine.test if you have a diff here **** START TRANSACTION; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. UPDATE t1n, t1b SET e = 2, b = 3 WHERE f = c; COMMIT; TRUNCATE t1m; @@ -20,8 +26,12 @@ Log_name Pos Event_type Server_id End_log_pos Info mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f @@ -39,6 +49,7 @@ RESET MASTER; SET SESSION BINLOG_FORMAT=MIXED; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); +The last event before the COMMIT is use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; UPDATE t1m, t1n SET m = 2, e = 3 WHERE n = f; @@ -51,14 +62,15 @@ Log_name Pos Event_type Server_id End_log_pos Info mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Table_map # # table_id: # (test.t1n) mysqld-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) mysqld-bin.000001 # Write_rows # # table_id: # mysqld-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F mysqld-bin.000001 # Query # # COMMIT -mysqld-bin.000001 # Query # # use `test`; UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1m mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1b mysqld-bin.000001 # Query # # use `test`; TRUNCATE t1n diff --git a/mysql-test/suite/binlog/r/binlog_row_insert_select.result b/mysql-test/suite/binlog/r/binlog_row_insert_select.result index c7386b092e4..214a77dd36b 100644 --- a/mysql-test/suite/binlog/r/binlog_row_insert_select.result +++ b/mysql-test/suite/binlog/r/binlog_row_insert_select.result @@ -11,7 +11,7 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT select * from t1; a 1 diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result index 9ae5121f618..e0cb1b695be 100644 --- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); drop table if exists t1, t2; create table t1 (a int) engine=innodb; create table t2 (a int) engine=myisam; @@ -9,10 +10,12 @@ commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; delete from t2; @@ -26,11 +29,9 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT delete from t1; delete from t2; reset master; @@ -46,13 +47,15 @@ commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; savepoint my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint master-bin.000001 # Xid # # COMMIT /* XID */ delete from t1; @@ -75,13 +78,15 @@ a show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; savepoint my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.t2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # use `test`; rollback to savepoint my_savepoint master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -101,11 +106,9 @@ get_lock("a",10) show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT delete from t1; delete from t2; reset master; @@ -133,6 +136,10 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT insert into t1 values(11); commit; show binlog events from ; @@ -144,6 +151,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ @@ -272,6 +281,10 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table t1,t2 master-bin.000001 # Query # # use `test`; create table t0 (n int) master-bin.000001 # Query # # BEGIN @@ -372,16 +385,14 @@ master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2 master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; TRUNCATE table t2 -master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -390,9 +401,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE t2 master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F @@ -400,7 +409,11 @@ master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; TRUNCATE table t2 master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) @@ -420,19 +433,8 @@ select get_lock("a",10); get_lock("a",10) 1 flush logs; -select -(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) -is not null; -(@a:=load_file("MYSQLTEST_VARDIR/tmp/mix_innodb_myisam_binlog.output")) -is not null -1 -select -@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR -@a like "%#%error_code=0%ROLLBACK\r\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%", -@a not like "%#%error_code=%error_code=%"; -@a like "%#%error_code=0%ROLLBACK\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" OR -@a like "%#%error_code=0%ROLLBACK\r\n/*!*/;%ROLLBACK /* added by mysqlbinlog */;%" @a not like "%#%error_code=%error_code=%" -1 1 +This does not matter in ROW mode as the rolled back changes do not contain transactional changes as these +were previously flushed upon committing/rolling back each statement. drop table t1, t2; create temporary table tt (a int unique); create table ti (a int) engine=innodb; @@ -449,12 +451,6 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.ti) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.ti) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK select count(*) from ti /* zero */; count(*) 0 @@ -472,6 +468,8 @@ insert into ti values (2) /* to make the dup error in the following */; insert into tt select * from ti /* one affected and error */; ERROR 23000: Duplicate entry '2' for key 'a' rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info select count(*) from ti /* zero */; @@ -505,7 +503,7 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* only (!) with fixes for #23333 will show there is the query */; select count(*) from t1 /* must be 3 */; count(*) @@ -547,10 +545,9 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 1 */; count(*) @@ -564,11 +561,9 @@ ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 2 */; count(*) @@ -586,7 +581,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Update_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 2 */; count(*) @@ -601,10 +596,9 @@ ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t4) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 4 */; count(*) @@ -634,11 +628,10 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t3) master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 1 */; count(*) @@ -657,12 +650,9 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t2) master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Delete_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Delete_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 1 */; count(*) @@ -682,12 +672,9 @@ count(*) show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.t4) master-bin.000001 # Table_map # # table_id: # (test.t1) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; @@ -708,12 +695,6 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.ti) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.ti) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # ROLLBACK select count(*) from ti /* zero */; count(*) 0 @@ -731,6 +712,8 @@ insert into ti values (2) /* to make the dup error in the following */; insert into tt select * from ti /* one affected and error */; ERROR 23000: Duplicate entry '2' for key 'a' rollback; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info select count(*) from ti /* zero */; @@ -760,8 +743,10 @@ insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=3 master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2)) +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 3 */; count(*) 3 @@ -775,8 +760,10 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3) +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 5 */; count(*) 5 @@ -797,10 +784,6 @@ insert into t2 values (bug27417(1)); ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=1 -master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(1)) -master-bin.000001 # Query # # ROLLBACK select count(*) from t1 /* must be 1 */; count(*) 1 @@ -812,10 +795,6 @@ insert into t2 select bug27417(1) union select bug27417(2); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=2 -master-bin.000001 # Query # # use `test`; insert into t2 select bug27417(1) union select bug27417(2) -master-bin.000001 # Query # # ROLLBACK select count(*) from t1 /* must be 2 */; count(*) 2 @@ -826,8 +805,10 @@ update t3 set b=b+bug27417(1); ERROR 23000: Duplicate entry '4' for key 'b' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1) +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 2 */; count(*) 2 @@ -840,10 +821,6 @@ UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */; ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=6 -master-bin.000001 # Query # # use `test`; UPDATE t4,t3 SET t4.a=t3.a + bug27417(1) /* top level non-ta table */ -master-bin.000001 # Query # # ROLLBACK select count(*) from t1 /* must be 4 */; count(*) 4 @@ -871,10 +848,6 @@ delete from t2; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=9 -master-bin.000001 # Query # # use `test`; delete from t2 -master-bin.000001 # Query # # ROLLBACK select count(*) from t1 /* must be 1 */; count(*) 1 @@ -891,9 +864,6 @@ delete t2.* from t2,t5 where t2.a=t5.a + 1; ERROR 23000: Duplicate entry '1' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; delete t2.* from t2,t5 where t2.a=t5.a + 1 -master-bin.000001 # Query # # ROLLBACK select count(*) from t1 /* must be 1 */; count(*) 1 @@ -911,14 +881,6 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# -master-bin.000001 # Intvar # # INSERT_ID=10 -master-bin.000001 # User var # # @`b`=_latin1 0x3135 COLLATE latin1_swedish_ci -master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/rpl_loaddata.dat' into table t4 (a, @b) set b= @b + bug27417(2) ;file_id=# -master-bin.000001 # Query # # ROLLBACK drop trigger trg_del_t2; drop table t1,t2,t3,t4,t5; drop function bug27417; diff --git a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result index 7e542a3f3ee..2d2619983d6 100644 --- a/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result +++ b/mysql-test/suite/binlog/r/binlog_statement_insert_delayed.result @@ -5,12 +5,20 @@ insert delayed into t1 values (300); FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mtr`; INSERT INTO test_suppressions (pattern) VALUES ( NAME_CONST('pattern',_latin1'Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert delayed into t1 values (207) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=208 master-bin.000001 # Query # # use `test`; insert delayed into t1 values (null) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert delayed into t1 values (300) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; FLUSH TABLES insert delayed into t1 values (null),(null),(null),(null); Warnings: diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result index c0a87be191b..45ed3c2d108 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result +++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result @@ -592,8 +592,10 @@ show binlog events from 0; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 4 Format_desc 1 107 Server version, Binlog ver: 4 master-bin.000001 107 Query 1 228 use `test`; create table t1 (a bigint unsigned, b bigint(20) unsigned) -master-bin.000001 228 Query 1 352 use `test`; insert into t1 values (9999999999999999,14632475938453979136) -master-bin.000001 352 Query 1 428 use `test`; drop table t1 +master-bin.000001 228 Query 1 296 BEGIN +master-bin.000001 296 Query 1 420 use `test`; insert into t1 values (9999999999999999,14632475938453979136) +master-bin.000001 420 Query 1 489 COMMIT +master-bin.000001 489 Query 1 565 use `test`; drop table t1 reset master; CREATE DATABASE bug39182 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE bug39182; @@ -699,16 +701,24 @@ use test; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=127 master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # COMMIT drop table t1,t2,t3,tt1; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam; insert delayed into t1 values (207); @@ -718,16 +728,24 @@ FLUSH TABLES; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (id tinyint auto_increment primary key) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=127 master-bin.000001 # Query # # use `test`; insert into t1 values(null) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; create table t1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t2 select * from t1 master-bin.000001 # Query # # use `test`; create temporary table tt1 (a int) master-bin.000001 # Query # # use `test`; create table if not exists t3 like tt1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test') +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysql`; DELETE FROM user WHERE host='localhost' AND user='@#@' +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table t1,t2,t3,tt1 master-bin.000001 # Query # # use `test`; create table t1 (a int not null auto_increment, primary key (a)) engine=myisam master-bin.000001 # Query # # BEGIN diff --git a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result index b7edf7fedb8..b91d7b4c836 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ctype_ucs.result @@ -5,15 +5,15 @@ reset master; insert into t2 values (@v); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`v`=_ucs2 0x006100620063 COLLATE ucs2_general_ci master-bin.000001 # Query # # use `test`; insert into t2 values (@v) +master-bin.000001 # Query # # COMMIT flush logs; /*!40019 SET @@session.max_insert_delayed_threads=0*/; /*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/; DELIMITER /*!*/; ROLLBACK/*!*/; -SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; -use test/*!*/; SET TIMESTAMP=10000/*!*/; 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/*!*/; @@ -23,8 +23,16 @@ SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/ 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 +/*!*/; +SET @`v`:=_ucs2 0x006100620063 COLLATE `ucs2_general_ci`/*!*/; +use test/*!*/; +SET TIMESTAMP=10000/*!*/; insert into t2 values (@v) /*!*/; +SET TIMESTAMP=10000/*!*/; +COMMIT +/*!*/; DELIMITER ; # End of log file ROLLBACK /* added by mysqlbinlog */; diff --git a/mysql-test/suite/binlog/r/binlog_stm_insert_select.result b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result index a93a8edf4aa..72036d89b9e 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_insert_select.result +++ b/mysql-test/suite/binlog/r/binlog_stm_insert_select.result @@ -8,7 +8,9 @@ insert into t1 select * from t2; ERROR 23000: Duplicate entry '2' for key 'a' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 select * from t2 +master-bin.000001 # Query # # COMMIT select * from t1; a 1 diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result index c15374dc1c6..c28a266424e 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result +++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); drop table if exists t1, t2; create table t1 (a int) engine=innodb; create table t2 (a int) engine=myisam; @@ -5,6 +6,8 @@ reset master; begin; insert into t1 values(1); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. commit; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info @@ -18,6 +21,8 @@ reset master; begin; insert into t1 values(2); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -35,6 +40,8 @@ insert into t1 values(3); savepoint my_savepoint; insert into t1 values(4); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -56,6 +63,8 @@ insert into t1 values(5); savepoint my_savepoint; insert into t1 values(6); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. rollback to savepoint my_savepoint; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -84,6 +93,8 @@ get_lock("a",10) begin; insert into t1 values(8); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. select get_lock("a",10); get_lock("a",10) 1 @@ -98,24 +109,32 @@ delete from t2; reset master; insert into t1 values(9); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(9) master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # COMMIT delete from t1; delete from t2; reset master; insert into t1 values(10); begin; insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(10) master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # COMMIT insert into t1 values(11); commit; show binlog events from ; @@ -123,7 +142,9 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(10) master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t2 select * from t1 +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values(11) master-bin.000001 # Xid # # COMMIT /* XID */ @@ -246,17 +267,29 @@ master-bin.000001 # Query # # use `test`; alter table t2 engine=MyISAM master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (1) master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t2 values (20) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table t1,t2 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; create temporary table ti (a int) engine=innodb +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into ti values(1) master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; create temporary table t1 (a int) engine=myisam +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert t1 values (1) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t0 (n int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert t0 select * from t1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t0 select GET_LOCK("lock1",null) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; create table t2 (n int) engine=innodb master-bin.000001 # Query # # use `test`; DROP /*!40005 TEMPORARY */ TABLE IF EXISTS `t1`,`ti` do release_lock("lock1"); @@ -340,24 +373,42 @@ a b DROP TABLE t1,t2; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (1,1),(1,2) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE if exists t2 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (3,3) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a int, b int, primary key (a)) engine=innodb -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4) master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4,4) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; TRUNCATE table t2 -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5,5) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP TABLE t2 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (6,6) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t2 (a int, b int, primary key (a)) engine=innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (7,7) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (8,8) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (9,9) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; TRUNCATE table t2 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 values (10,10) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t2 values (100,100) master-bin.000001 # Query # # COMMIT @@ -371,6 +422,8 @@ get_lock("a",10) begin; insert into t1 values(8); insert into t2 select * from t1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. select get_lock("a",10); get_lock("a",10) 1 @@ -396,6 +449,8 @@ begin; insert into ti values (1); insert into ti values (2) ; insert into tt select * from ti; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -413,6 +468,8 @@ select count(*) from ti /* zero */; count(*) 0 insert into ti select * from tt; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. select * from ti /* that is what slave would miss - a bug */; a 1 @@ -439,6 +496,8 @@ select count(*) from ti /* zero */; count(*) 0 insert into ti select * from tt; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. select * from tt /* that is what otherwise slave missed - the bug */; a 1 @@ -462,8 +521,10 @@ insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=3 master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2)) +master-bin.000001 # Query # # COMMIT /* only (!) with fixes for #23333 will show there is the query */; select count(*) from t1 /* must be 3 */; count(*) @@ -478,8 +539,10 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3) +master-bin.000001 # Query # # COMMIT /* the query must be in regardless of #23333 */; select count(*) from t1 /* must be 5 */; count(*) @@ -532,8 +595,10 @@ update t3 set b=b+bug27417(1); ERROR 23000: Duplicate entry '4' for key 'b' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1) +master-bin.000001 # Query # # COMMIT /* the output must denote there is the query */; select count(*) from t1 /* must be 2 */; count(*) @@ -640,6 +705,8 @@ begin; insert into ti values (1); insert into ti values (2) ; insert into tt select * from ti; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. rollback; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back @@ -657,6 +724,8 @@ select count(*) from ti /* zero */; count(*) 0 insert into ti select * from tt; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. select * from ti /* that is what slave would miss - bug#28960 */; a 1 @@ -683,6 +752,8 @@ select count(*) from ti /* zero */; count(*) 0 insert into ti select * from tt; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. select * from tt /* that is what otherwise slave missed - the bug */; a 1 @@ -706,8 +777,10 @@ insert into t2 values (bug27417(2)); ERROR 23000: Duplicate entry '2' for key 'PRIMARY' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=3 master-bin.000001 # Query # # use `test`; insert into t2 values (bug27417(2)) +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 3 */; count(*) 3 @@ -721,8 +794,10 @@ count(*) 2 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; delete from t2 where a=bug27417(3) +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 5 */; count(*) 5 @@ -772,8 +847,10 @@ update t3 set b=b+bug27417(1); ERROR 23000: Duplicate entry '4' for key 'b' show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; update t3 set b=b+bug27417(1) +master-bin.000001 # Query # # COMMIT select count(*) from t1 /* must be 2 */; count(*) 2 diff --git a/mysql-test/suite/binlog/r/binlog_stm_ps.result b/mysql-test/suite/binlog/r/binlog_stm_ps.result index e294a8127c7..43e8af8a272 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_ps.result +++ b/mysql-test/suite/binlog/r/binlog_stm_ps.result @@ -15,8 +15,14 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`a`=98 master-bin.000001 # Query # # use `test`; insert into t1 values (@a),(98) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 values (99) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 select 100 limit 100 +master-bin.000001 # Query # # COMMIT drop table t1; diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result index f96073a2b92..d30efe2c8f6 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_row.result +++ b/mysql-test/suite/binlog/r/binlog_stm_row.result @@ -60,11 +60,21 @@ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t2 master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) master-bin.000001 # Query # # use `test`; CREATE TABLE t2 LIKE t1 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES(2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (4) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/binlog/t/binlog_killed.test b/mysql-test/suite/binlog/t/binlog_killed.test index d4aa91140cf..227308b0fdd 100644 --- a/mysql-test/suite/binlog/t/binlog_killed.test +++ b/mysql-test/suite/binlog/t/binlog_killed.test @@ -51,7 +51,7 @@ reap; let $rows= `select count(*) from t2 /* must be 2 or 0 */`; let $MYSQLD_DATADIR= `select @@datadir`; ---exec $MYSQL_BINLOG --force-if-open --start-position=135 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=175 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog")) diff --git a/mysql-test/suite/binlog/t/binlog_killed_simulate.test b/mysql-test/suite/binlog/t/binlog_killed_simulate.test index f9240291dba..9cfa9e3e88e 100644 --- a/mysql-test/suite/binlog/t/binlog_killed_simulate.test +++ b/mysql-test/suite/binlog/t/binlog_killed_simulate.test @@ -52,7 +52,7 @@ load data infile '../../std_data/rpl_loaddata.dat' into table t2 /* will be "kil source include/show_binlog_events.inc; ---exec $MYSQL_BINLOG --force-if-open --start-position=107 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog +--exec $MYSQL_BINLOG --force-if-open --start-position=210 --stop-position=387 $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval select (@a:=load_file("$MYSQLTEST_VARDIR/tmp/binlog_killed_bug27571.binlog")) diff --git a/mysql-test/suite/binlog/t/binlog_multi_engine.test b/mysql-test/suite/binlog/t/binlog_multi_engine.test index 2e80ba427e7..25ce9e162f1 100644 --- a/mysql-test/suite/binlog/t/binlog_multi_engine.test +++ b/mysql-test/suite/binlog/t/binlog_multi_engine.test @@ -7,6 +7,8 @@ source include/have_blackhole.inc; source include/have_ndb.inc; source include/have_log_bin.inc; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + CREATE TABLE t1m (m INT, n INT) ENGINE=MYISAM; CREATE TABLE t1b (b INT, c INT) ENGINE=BLACKHOLE; CREATE TABLE t1n (e INT, f INT) ENGINE=NDB; @@ -22,8 +24,10 @@ UPDATE t1m, t1b SET m = 2, b = 3 WHERE n = c; # Here and below we need to wait when some event appears in binlog # to avoid unsrted mixing local events and from NDB -let $wait_binlog_event= t1m, t1b; +let $wait_binlog_event= COMMIT; source include/wait_for_binlog_event.inc; +let $event= query_get_value(SHOW BINLOG EVENTS, Info, 9); +--echo The last event before the COMMIT is $event echo *** Please look in binlog_multi_engine.test if you have a diff here ****; START TRANSACTION; @@ -51,8 +55,10 @@ SET SESSION BINLOG_FORMAT=MIXED; INSERT INTO t1b VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t1m VALUES (1,1), (1,2), (2,1), (2,2); -let $wait_binlog_event= t1m; +let $wait_binlog_event= COMMIT; source include/wait_for_binlog_event.inc; +let $event= query_get_value(SHOW BINLOG EVENTS, Info, 6); +--echo The last event before the COMMIT is $event INSERT INTO t1n VALUES (1,1), (1,2), (2,1), (2,2); diff --git a/mysql-test/suite/ndb/r/ndb_binlog_format.result b/mysql-test/suite/ndb/r/ndb_binlog_format.result index 6e1fc12130f..62d491bc94a 100644 --- a/mysql-test/suite/ndb/r/ndb_binlog_format.result +++ b/mysql-test/suite/ndb/r/ndb_binlog_format.result @@ -1,3 +1,4 @@ +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); drop table if exists t1, t2, t3; CREATE TABLE t1 (m INT, n INT) ENGINE=MYISAM; CREATE TABLE t2 (b INT, c INT) ENGINE=BLACKHOLE; @@ -7,18 +8,26 @@ SET SESSION BINLOG_FORMAT=STATEMENT; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2); INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. START TRANSACTION; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2); UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. UPDATE t3, t2 SET e = 2, b = 3 WHERE f = c; COMMIT; show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1,1), (1,2), (2,1), (2,2) +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # COMMIT +mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t2 SET m = 2, b = 3 WHERE n = c +mysqld-bin.000001 # Query # # COMMIT mysqld-bin.000001 # Query # # BEGIN mysqld-bin.000001 # Query # # use `test`; INSERT INTO t3 VALUES (1,1), (1,2), (2,1), (2,2) mysqld-bin.000001 # Query # # use `test`; UPDATE t1, t3 SET m = 2, e = 3 WHERE n = f diff --git a/mysql-test/suite/ndb/t/ndb_binlog_format.test b/mysql-test/suite/ndb/t/ndb_binlog_format.test index acb34bb388c..994054f0676 100644 --- a/mysql-test/suite/ndb/t/ndb_binlog_format.test +++ b/mysql-test/suite/ndb/t/ndb_binlog_format.test @@ -6,6 +6,8 @@ -- source include/have_ndb.inc -- source include/have_log_bin.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + --disable_warnings drop table if exists t1, t2, t3; --enable_warnings diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result index 23736804784..5be69177550 100644 --- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result +++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result @@ -4,6 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); DROP DATABASE IF EXISTS db1; CREATE DATABASE db1; use db1; @@ -67,6 +69,8 @@ before call db1.p1() INSERT INTO db1.t2 VALUES ('before call db1.p2()'); BEGIN; CALL db1.p2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. ROLLBACK; INSERT INTO db1.t2 VALUES ('after call db1.p2()'); SELECT * FROM db1.t1; diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result index 954589267c5..6482d132521 100644 --- a/mysql-test/suite/rpl/r/rpl_blackhole.result +++ b/mysql-test/suite/rpl/r/rpl_blackhole.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1 (a INT, b INT, c INT); CREATE TABLE t2 (a INT, b INT, c INT); ALTER TABLE t1 ENGINE=BLACKHOLE; @@ -40,14 +41,6 @@ SELECT COUNT(*) FROM t1; COUNT(*) 0 >>> Something was written to binary log <<< -[on master] -INSERT INTO t2 SELECT * FROM t1; -[on slave] -# Expect 0 -SELECT COUNT(*) FROM t1; -COUNT(*) -0 ->>> Something was written to binary log <<< ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b); [on master] INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4); diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result index 83e5f66a9c4..ae4fab7325c 100644 --- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result +++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); ######################################################################## # Environment ######################################################################## @@ -20,12 +21,16 @@ INSERT INTO t VALUES (4,'black'), (2,'red'), (3,'yelow'), (1,'cyan'); SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'yellow 2' WHERE i = 3; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'magenta 2' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (5 + (2 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. COMMIT; ROLLBACK; Warnings: @@ -43,12 +48,16 @@ master-bin.000001 # Query # # ROLLBACK SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'gray 2' WHERE i = 3; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. SET AUTOCOMMIT = 1; BEGIN; UPDATE t SET f = 'dark blue 2' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (6 + (2 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. COMMIT; COMMIT; show binlog events from ; @@ -63,11 +72,15 @@ master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") master-bin.000001 # Xid # # COMMIT /* XID */ SET AUTOCOMMIT = 0; UPDATE t SET f = 'yellow 1' WHERE i = 3; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. SET AUTOCOMMIT = 0; UPDATE t SET f = 'magenta 1' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (5 + (1 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. COMMIT; ROLLBACK; Warnings: @@ -84,11 +97,15 @@ master-bin.000001 # Query # # use `test`; INSERT INTO n VALUES (now(),"brown") master-bin.000001 # Query # # ROLLBACK SET AUTOCOMMIT = 0; UPDATE t SET f = 'gray 1' WHERE i = 3; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. SET AUTOCOMMIT = 0; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'; ERROR HY000: Lock wait timeout exceeded; try restarting transaction INSERT INTO t VALUES (6 + (1 * 10),"brown"); INSERT INTO n VALUES (now(),"brown"); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. COMMIT; COMMIT; show binlog events from ; diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result index 21d9fc5a919..55a9e18894d 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result @@ -54,47 +54,7 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -123,47 +83,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -187,47 +107,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -251,47 +131,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -314,47 +154,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -452,47 +252,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -515,47 +275,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -767,47 +487,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1060 -Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1060 -Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1060 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; *** Try to insert in master **** @@ -909,47 +589,7 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result index 053dee9067b..2561a84e1d3 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result @@ -54,47 +54,7 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -123,47 +83,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -187,47 +107,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -251,47 +131,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -314,47 +154,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -452,47 +252,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -515,47 +275,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -767,47 +487,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1060 -Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1060 -Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1060 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; *** Try to insert in master **** @@ -909,47 +589,7 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result index 81c486cb43c..9fa381caff7 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result +++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result @@ -963,9 +963,7 @@ master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test_rpl`; INSERT INTO t1 VALUES(1, 't1, text 1') master-bin.000001 # Xid 1 # # -master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test_rpl`; TRUNCATE t1 -master-bin.000001 # Xid 1 # # master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test_rpl`; DELETE FROM t1 master-bin.000001 # Xid 1 # # diff --git a/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result index da24c86627c..8c6ce5d590a 100644 --- a/mysql-test/suite/rpl/r/rpl_insert_ignore.result +++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1 ( a int unsigned not null auto_increment primary key, b int unsigned, diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 7f346070290..cc7cfa144ee 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -122,7 +122,7 @@ FROM t2 ON DUPLICATE KEY UPDATE t1.field_3 = t2.field_c' Skip_Counter 0 -Exec_Master_Log_Pos 1279 +Exec_Master_Log_Pos 1964 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result index 35fac3bd076..be157046cd9 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata.result @@ -41,7 +41,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 1798 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -56,7 +56,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 1798 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File @@ -89,7 +89,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 1833 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -104,7 +104,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 1833 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File @@ -153,7 +153,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 0 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result index bbf4b9f97d4..814b83e39f8 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result @@ -13,7 +13,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 291 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -28,7 +28,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 291 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File @@ -55,7 +55,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 466 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -70,7 +70,7 @@ Replicate_Wild_Ignore_Table Last_Errno 1593 Last_Error Fatal error: Not enough memory Skip_Counter 0 -Exec_Master_Log_Pos 326 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result index 901f3352b44..ba3486f6cba 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result @@ -17,10 +17,12 @@ count(*) show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t2 (id int not null primary key auto_increment) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Append_block # # ;file_id=#;block_len=# master-bin.000001 # Append_block # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' into table t2 ;file_id=# +master-bin.000001 # Query # # COMMIT ==== Verify results on slave ==== [on slave] select count(*) from t2 /* 5 000 */; diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index e490468059d..d19b13e960c 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -59,7 +59,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 75 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -74,7 +74,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 75 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result index fb48172ed93..cda73c91c4e 100644 --- a/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_mix_insert_delayed.result @@ -20,6 +20,7 @@ COUNT(*) 5000 truncate table t1; insert delayed into t1 values(10, "my name"); +flush table t1; insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); flush table t1; select * from t1; diff --git a/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result similarity index 87% rename from mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result rename to mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result index 0e3f83d0aa5..693e582b57e 100644 --- a/mysql-test/suite/rpl/r/rpl_binlog_max_cache_size.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; @@ -13,13 +14,17 @@ CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; *** Single statement on transactional table *** Got one of the listed errors *** Single statement on non-transactional table *** -*** After WL#2687 the difference between STATEMENT/MIXED and ROW will not exist. *** -Got one of the listed errors -*** Single statement on both transactional and non-transactional tables. *** -*** After WL#2687 we will be able to change the order of the tables. *** Got one of the listed errors SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; START SLAVE SQL_THREAD; +*** Single statement on both transactional and non-transactional tables. *** +Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; +START SLAVE SQL_THREAD; +source include/diff_master_slave.inc; +######################################################################################## +# 2 - BEGIN - IMPLICIT COMMIT by DDL +######################################################################################## TRUNCATE TABLE t1; TRUNCATE TABLE t2; TRUNCATE TABLE t3; @@ -34,6 +39,8 @@ Got one of the listed errors BEGIN; Got one of the listed errors Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; source include/diff_master_slave.inc; ######################################################################################## # 3 - BEGIN - COMMIT @@ -110,12 +117,11 @@ BEGIN; Got one of the listed errors Got one of the listed errors Got one of the listed errors -Got one of the listed errors -Got one of the listed errors COMMIT; BEGIN; Got one of the listed errors COMMIT; +source include/diff_master_slave.inc; ######################################################################################## # CLEAN ######################################################################################## @@ -123,13 +129,10 @@ DROP TABLE t1; DROP TABLE t2; DROP TABLE t3; DROP TABLE IF EXISTS t4; +Warnings: +Note 1051 Unknown table 't4' DROP TABLE IF EXISTS t5; DROP TABLE IF EXISTS t6; -DROP PROCEDURE p1; -DROP TABLE t1; -DROP TABLE t2; -DROP TABLE t3; -DROP TABLE IF EXISTS t4; -DROP TABLE IF EXISTS t5; -DROP TABLE IF EXISTS t6; +Warnings: +Note 1051 Unknown table 't6' DROP PROCEDURE p1; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result new file mode 100644 index 00000000000..39d68c75ca0 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -0,0 +1,529 @@ +######################################################################### +# CONFIGURATION +######################################################################### +CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +INSERT INTO tt_1(ddl_case) VALUES(0); +INSERT INTO tt_2(ddl_case) VALUES(0); +######################################################################### +# CHECK IMPLICT COMMIT +######################################################################### +SET AUTOCOMMIT= 0; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (41); +LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.nt_1 preload_keys Error Table 'test.nt_1' doesn't exist +test.nt_1 preload_keys status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (41) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (40); +LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys Error Table 'test.t1' doesn't exist +test.t1 preload_keys status Operation failed +test.t2 preload_keys Error Table 'test.t2' doesn't exist +test.t2 preload_keys status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (40) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (39); +ANALYZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 analyze Error Table 'test.nt_1' doesn't exist +test.nt_1 analyze status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (39) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (38); +CHECK TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 check Error Table 'test.nt_1' doesn't exist +test.nt_1 check status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (38) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (37); +OPTIMIZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 optimize Error Table 'test.nt_1' doesn't exist +test.nt_1 optimize status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (37) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (36); +REPAIR TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 repair Error Table 'test.nt_1' doesn't exist +test.nt_1 repair status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (36) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (35); +LOCK TABLES tt_1 WRITE; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (35) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (34); +UNLOCK TABLES; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (34) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (33); +CREATE USER 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (33) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (32); +GRANT ALL ON *.* TO 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (32) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (31); +SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (31) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (30); +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (30) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (29); +RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (29) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (28); +DROP USER 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (28) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (27); +CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (27) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (26); +ALTER EVENT evt COMMENT 'evt'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (26) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (25); +DROP EVENT evt; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (25) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP EVENT evt +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (24); +CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (24) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (23); +DROP TRIGGER tr; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (23) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TRIGGER tr +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (22); +CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (22) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1 +RETURN "fc" +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (21); +ALTER FUNCTION fc COMMENT 'fc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (21) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (20); +DROP FUNCTION fc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (20) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP FUNCTION fc +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (19); +CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (19) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`() +UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (18); +ALTER PROCEDURE pc COMMENT 'pc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (18) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (17); +DROP PROCEDURE pc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (17) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (16); +CREATE VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (16) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (15); +ALTER VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (15) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (14); +DROP VIEW v; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (14) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP VIEW v +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (13); +CREATE INDEX ix ON tt_1(ddl_case); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (13) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE INDEX ix ON tt_1(ddl_case) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (12); +DROP INDEX ix ON tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (12) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP INDEX ix ON tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (11); +CREATE TEMPORARY TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (10); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (9); +ALTER TABLE tt_xx RENAME new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (8); +DROP TEMPORARY TABLE IF EXISTS new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */ +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (7); +CREATE TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (7) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (6); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (6) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (5); +RENAME TABLE tt_xx TO new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (5) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (4); +TRUNCATE TABLE new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (4) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (3); +DROP TABLE IF EXISTS tt_xx, new_tt_xx; +Warnings: +Note 1051 Unknown table 'tt_xx' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (3) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx, new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (2); +CREATE DATABASE db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (2) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # CREATE DATABASE db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (1); +DROP DATABASE IF EXISTS db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # DROP DATABASE IF EXISTS db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +################################################################################### +# CLEAN +################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result new file mode 100644 index 00000000000..1abd5fb2b38 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -0,0 +1,11260 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +######################################################################### +# CONFIGURATION +######################################################################### +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +SET @commands= 'configure'; +SET SQL_LOG_BIN=0; +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=0; +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +SET SQL_LOG_BIN=1; +INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1); +CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_tt_5_suc"; +END| +CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_nt_5_suc"; +END| +CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id; +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +SET @commands= ''; +######################################################################### +# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES +######################################################################### + + + + +# +#1) Generates in the binlog what follows: +# --> STMT "B T C" entries, format S. +# --> ROW "B T C" entries, format R. +# --> MIXED "B T C" entries, format S. +# +SET @commands= 'T'; +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (9, 1); +fc_i_tt_5_suc (9, 1) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (10, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#1.e) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 1), (7, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (13, 1), (10, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (14, 1, ''), (7, 1, fc_i_tt_5_suc (14, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#2) Generates in the binlog what follows: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (17, 1); +fc_i_nt_5_suc (17, 1) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(17,1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(17,1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (18, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#2.e) Generates in the binlog what follows if a N-table is changed: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#3) Generates in the binlog what follows: +# --> STMT "B M C" entry if only N-Table is changed, format S. +# --> STMT "B M C" entries, format S. +# --> ROW "B N T B T C" entries, format R. +# --> MIXED "B N T B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#3.e) Generates in the binlog what follows: +# --> STMT "B M C" entry if only N-Table is changed, format S. +# --> STMT "B M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 32, 1, COUNT(*) FROM nt_1 UNION SELECT 24, 1, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#4) Generates in the binlog what follows: +# --> STMT "B T T C" entries, format S. +# --> ROW "B T T C" entries, format R. +# --> MIXED "B T T C" entries, format S +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 4); +fc_i_tt_5_suc (39, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (43, 4); +fc_i_tt_5_suc (43, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(43,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(43,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (44, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (46, 2); +fc_i_tt_5_suc (46, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(46,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(46,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (47, 2); +fc_i_tt_5_suc (47, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (47, 4); +fc_i_tt_5_suc (47, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (48, 2); +fc_i_tt_5_suc (48, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (48, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(48,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(48,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (49, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (50, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (51, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (51, 4); +fc_i_tt_5_suc (51, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(51,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(51,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (52, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (52, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#4.e) Generates in the binlog what follows: +# --> STMT "B T C" entries, format S. +# --> ROW "B T C" entries, format R. +# --> MIXED "B T C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T eT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 4), (54, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (55, 4), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (56, 4, ''), (56, 2, fc_i_tt_5_suc (56, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B eT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 2), (57, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (59, 2), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (60, 2, ''), (59, 4, fc_i_tt_5_suc (60, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#5) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (61, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (61, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (62, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (62, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (63, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (63, 4); +fc_i_tt_5_suc (63, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (64, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (64, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (65, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (65, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (66, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (66, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (67, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (67, 4); +fc_i_tt_5_suc (67, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (68, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (68, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (69, 2); +fc_i_tt_5_suc (69, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (69, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (70, 2); +fc_i_tt_5_suc (70, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (70, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (71, 2); +fc_i_tt_5_suc (71, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (71, 4); +fc_i_tt_5_suc (71, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (72, 2); +fc_i_tt_5_suc (72, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (72, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (73, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (73, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (74, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (74, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (75, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (75, 4); +fc_i_tt_5_suc (75, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (76, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (76, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#5.e) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (77, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (77, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T eT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (78, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (78, 4), (78, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (79, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (79, 4), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (80, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (80, 4, ''), (80, 2, fc_i_tt_5_suc (80, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (81, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B eT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (82, 2), (60, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (82, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (83, 2), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (83, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (84, 2, ''), (60, 4, fc_i_tt_5_suc (84, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (84, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#6) Generates in the binlog what follows: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (87, 4); +fc_i_nt_5_suc (87, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(87,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(87,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (88, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (91, 4); +fc_i_nt_5_suc (91, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(91,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(91,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (92, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (93, 2); +fc_i_nt_5_suc (93, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(93,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(93,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (94, 2); +fc_i_nt_5_suc (94, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(94,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(94,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (95, 2); +fc_i_nt_5_suc (95, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (95, 4); +fc_i_nt_5_suc (95, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (96, 2); +fc_i_nt_5_suc (96, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(96,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (96, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(96,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (97, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (98, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (99, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (99, 4); +fc_i_nt_5_suc (99, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(99,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(99,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (100, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (100, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#6.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N eN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N eN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#7) Generates in the binlog what follows: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (111, 4); +fc_i_nt_5_suc (111, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(111,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(111,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (112, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (115, 4); +fc_i_nt_5_suc (115, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(115,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(115,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (116, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (117, 2); +fc_i_nt_5_suc (117, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(117,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(117,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (118, 2); +fc_i_nt_5_suc (118, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(118,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(118,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (119, 2); +fc_i_nt_5_suc (119, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (119, 4); +fc_i_nt_5_suc (119, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (120, 2); +fc_i_nt_5_suc (120, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(120,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (120, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(120,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (121, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (122, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (123, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (123, 4); +fc_i_nt_5_suc (123, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(123,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(123,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (124, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (124, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#7.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N eN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N eN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#8) Generates in the binlog what follows: +# --> STMT "B T N C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format R in N and S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (135, 4); +fc_i_nt_5_suc (135, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (136, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (139, 4); +fc_i_nt_5_suc (139, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (140, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (141, 2); +fc_i_tt_5_suc (141, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (142, 2); +fc_i_tt_5_suc (142, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (143, 2); +fc_i_tt_5_suc (143, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (143, 4); +fc_i_nt_5_suc (143, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (144, 2); +fc_i_tt_5_suc (144, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (144, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (145, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (146, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (147, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (147, 4); +fc_i_nt_5_suc (147, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (148, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (148, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#8.e) Generates in the binlog what follows if T-* fails: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# Otherwise, what follows if N-* fails and a N-Table is changed: +# --> STMT "B T N C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format R in N and S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (150, 2), (136, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Te N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T eN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Ne C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Ne C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#9) Generates in the binlog what follows: +# --> STMT "B T N R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (155, 4); +fc_i_nt_5_suc (155, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (156, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (159, 4); +fc_i_nt_5_suc (159, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (160, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (161, 2); +fc_i_tt_5_suc (161, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (162, 2); +fc_i_tt_5_suc (162, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (163, 2); +fc_i_tt_5_suc (163, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (163, 4); +fc_i_nt_5_suc (163, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (164, 2); +fc_i_tt_5_suc (164, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (164, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (165, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (166, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (167, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (167, 4); +fc_i_nt_5_suc (167, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (168, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (168, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#9.e) Generates in the binlog what follows if T* fails: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# Otherwise, what follows if N* fails and a N-Table is changed: +# --> STMT "B T N R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (170, 2), (152, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Te N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (171, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T eN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Ne R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T Ne R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#10) Generates in the binlog: +# --> STMT "B N C B T C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (175, 4); +fc_i_tt_5_suc (175, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(175,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(175,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (176, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (179, 4); +fc_i_tt_5_suc (179, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(179,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(179,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (180, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (181, 2); +fc_i_nt_5_suc (181, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(181,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(181,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (182, 2); +fc_i_nt_5_suc (182, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(182,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(182,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (183, 2); +fc_i_nt_5_suc (183, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(183,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (183, 4); +fc_i_tt_5_suc (183, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(183,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(183,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(183,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (184, 2); +fc_i_nt_5_suc (184, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(184,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (184, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(184,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (185, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (186, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (187, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (187, 4); +fc_i_tt_5_suc (187, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(187,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(187,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (188, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (188, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#11) Generates in the binlog what follows: +# --> STMT "B N C" entries, format S. +# --> ROW "B N C" entries, format R. +# --> MIXED "B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (189, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (190, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (191, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (192, 4); +fc_i_tt_5_suc (192, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (193, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (194, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (195, 4); +fc_i_tt_5_suc (195, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (196, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (197, 2); +fc_i_nt_5_suc (197, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(197,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (197, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(197,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (198, 2); +fc_i_nt_5_suc (198, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(198,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (198, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(198,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (199, 2); +fc_i_nt_5_suc (199, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(199,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (199, 4); +fc_i_tt_5_suc (199, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(199,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (200, 2); +fc_i_nt_5_suc (200, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(200,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (200, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(200,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (201, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (201, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (202, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (202, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (203, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (203, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (204, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (204, 4); +fc_i_tt_5_suc (204, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#12) Generates in the binlog what follows: +# --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +# --> STMT "B M T C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B tN T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#12.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +# --> STMT "B M T C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 214, 2, COUNT(*) FROM nt_1 UNION SELECT 213, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (215, 2), (208, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (216, 2, ''), (212, 2, fc_i_tt_5_suc (216, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (217, 2), (211, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (218, 2, ''), (212, 2, fc_i_nt_5_suc (218, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#13) "B M T R" generates in the binlog: +# --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +# --> STMT "B M T R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (219, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 220, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (220, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B nT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (221, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (222, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (223, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (224, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (225, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (226, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#13.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +# --> STMT "B M T R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (227, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 228, 2, COUNT(*) FROM nt_1 UNION SELECT 218, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (228, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (229, 2), (222, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (229, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (230, 2, ''), (226, 2, fc_i_tt_5_suc (230, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (230, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (231, 2), (211, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (231, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (232, 2, ''), (212, 2, fc_i_nt_5_suc (232, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (232, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#14) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T tN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T nT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2) +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#14.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M C" entries, format S. +# --> ROW "B N C B T C" entry, format R. +# --> MIXED "B N C B T C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tNe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T tNe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 242, 4, COUNT(*) FROM nt_1 UNION SELECT 242, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nTe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T nTe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (243, 4), (236, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (244, 4, ''), (240, 2, fc_i_tt_5_suc (244, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (245, 4), (239, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (246, 4, ''), (240, 4, fc_i_nt_5_suc (246, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#15) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T tN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (248, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 248, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T nT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (249, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (250, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (251, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (252, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (253, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (254, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#15.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tNe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T tNe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (256, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 256, 4, COUNT(*) FROM nt_1 UNION SELECT 256, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nTe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T nTe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (257, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (257, 4), (250, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (258, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (258, 4, ''), (254, 2, fc_i_tt_5_suc (258, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (259, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (259, 4), (239, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (260, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (260, 4, ''), (240, 4, fc_i_nt_5_suc (260, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#16) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#16.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 270, 2, COUNT(*) FROM nt_1 UNION SELECT 262, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#17) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#17.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 284, 2, COUNT(*) FROM nt_1 UNION SELECT 262, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#18) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B N C B N C B T C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N nT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#18.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tNe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tNe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 298, 4, COUNT(*) FROM nt_1 UNION SELECT 290, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nTe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nTe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (299, 4), (292, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (300, 4, ''), (296, 2, fc_i_tt_5_suc (300, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (301, 4), (295, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (302, 4, ''), (296, 4, fc_i_nt_5_suc (302, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#19) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#19.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tNe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tNe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 312, 4, COUNT(*) FROM nt_1 UNION SELECT 290, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nTe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nTe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (313, 4), (306, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (314, 4, ''), (310, 2, fc_i_tt_5_suc (314, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (315, 4), (295, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (316, 4, ''), (296, 4, fc_i_nt_5_suc (316, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-func R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 2 - SAVEPOINT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 3 - CREATE TABLE...SELECT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_321 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_321, nt_xx_321; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T CS-T->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T CS-T->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_322 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_322, nt_xx_322; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N CS-N->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N CS-N->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_323 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_323, nt_xx_323; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N CS-T->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N CS-T->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_324 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_324, nt_xx_324; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_325 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_325, nt_xx_325; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_326 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_326, nt_xx_326; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 4 - ROLLBACK TEMPORARY TABLE +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +################################################################################### +# CLEAN +################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_mixed_row_innodb.result b/mysql-test/suite/rpl/r/rpl_mixed_row_innodb.result new file mode 100644 index 00000000000..a4894631087 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mixed_row_innodb.result @@ -0,0 +1,84 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +CREATE TABLE t4 ( +id INT(5) unsigned NOT NULL auto_increment, +name varchar(15) NOT NULL default '', +number varchar(35) NOT NULL default 'default', +PRIMARY KEY (id), +UNIQUE KEY unique_rec (name,number) +) ENGINE=InnoDB; +LOAD DATA +INFILE '../../std_data/loaddata_pair.dat' +REPLACE INTO TABLE t4 +(name,number); +SELECT * FROM t4; +id name number +1 XXX 12345 +2 XXY 12345 +SELECT * FROM t4; +id name number +1 XXX 12345 +2 XXY 12345 +LOAD DATA +INFILE '../../std_data/loaddata_pair.dat' +REPLACE INTO TABLE t4 +(name,number); +SELECT * FROM t4; +id name number +4 XXX 12345 +5 XXY 12345 +SELECT * FROM t4; +id name number +4 XXX 12345 +5 XXY 12345 +FLUSH LOGS; +FLUSH LOGS; +DROP DATABASE IF EXISTS mysqltest1; +CREATE DATABASE mysqltest1; +CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT); +CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB"; +SET AUTOCOMMIT = 0; +-------- switch to slave -------- +ALTER TABLE mysqltest1.t1 ENGINE = MyISAM; +SHOW CREATE TABLE mysqltest1.t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `f1` bigint(20) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +-------- switch to master -------- +INSERT INTO mysqltest1.t1 SET f1= 1; +DROP TEMPORARY TABLE mysqltest1.tmp; +ROLLBACK; +SHOW CREATE TABLE mysqltest1.tmp; +ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist +SELECT COUNT(*) FROM mysqltest1.t1; +COUNT(*) +0 +INSERT INTO mysqltest1.t1 SET f1= 2; +CREATE TEMPORARY TABLE mysqltest1.tmp2(a INT); +ROLLBACK; +SHOW CREATE TABLE mysqltest1.tmp2; +Table Create Table +tmp2 CREATE TEMPORARY TABLE `tmp2` ( + `a` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SELECT COUNT(*) FROM mysqltest1.t1; +COUNT(*) +0 +-------- switch to slave -------- +SHOW CREATE TABLE mysqltest1.tmp; +ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist +SHOW CREATE TABLE mysqltest1.tmp2; +ERROR 42S02: Table 'mysqltest1.tmp2' doesn't exist +SELECT COUNT(*) FROM mysqltest1.t1; +COUNT(*) +0 +FLUSH LOGS; +-------- switch to master -------- +FLUSH LOGS; +DROP DATABASE mysqltest1; +End of 5.1 tests diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result index 71677d4cf12..76db52c05b1 100644 --- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result +++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result @@ -12,7 +12,9 @@ SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG) +master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F @@ -25,7 +27,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 595 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -40,7 +42,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 595 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File @@ -63,7 +65,9 @@ SHOW BINLOG EVENTS; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Query 1 # use `test`; CREATE TABLE t1 (a INT, b LONG) +slave-bin.000001 # Query 1 # BEGIN slave-bin.000001 # Query 1 # use `test`; INSERT INTO t1 VALUES (1,1), (2,2) +slave-bin.000001 # Query 1 # COMMIT slave-bin.000001 # Query 1 # BEGIN slave-bin.000001 # Table_map 1 # table_id: # (test.t1) slave-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F diff --git a/mysql-test/suite/rpl/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result index 6b1404b4f68..e765ca6c872 100644 --- a/mysql-test/suite/rpl/r/rpl_read_only.result +++ b/mysql-test/suite/rpl/r/rpl_read_only.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); create user test; create table t1(a int) engine=InnoDB; create table t2(a int) engine=MyISAM; diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result index b3b1480a740..ba269344492 100644 --- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result +++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result @@ -155,9 +155,12 @@ Log_name File_size master-bin.000003 # master-bin.000004 # master-bin.000005 # +master-bin.000006 # +master-bin.000007 # +master-bin.000008 # show master status; File Position Binlog_Do_DB Binlog_Ignore_DB -master-bin.000005 # +master-bin.000008 # select * from t4; a testing temporary tables part 2 @@ -167,11 +170,11 @@ Master_Host 127.0.0.1 Master_User root Master_Port MASTER_PORT Connect_Retry 60 -Master_Log_File master-bin.000005 +Master_Log_File master-bin.000008 Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # -Relay_Master_Log_File master-bin.000005 +Relay_Master_Log_File master-bin.000008 Slave_IO_Running Yes Slave_SQL_Running Yes Replicate_Do_DB diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-master.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt deleted file mode 100644 index 627becdbfb5..00000000000 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs-slave.opt +++ /dev/null @@ -1 +0,0 @@ ---innodb diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result new file mode 100644 index 00000000000..693e582b57e --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result @@ -0,0 +1,138 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; +CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; +CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; +######################################################################################## +# 1 - SINGLE STATEMENT +######################################################################################## +*** Single statement on transactional table *** +Got one of the listed errors +*** Single statement on non-transactional table *** +Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; +*** Single statement on both transactional and non-transactional tables. *** +Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 2; +START SLAVE SQL_THREAD; +source include/diff_master_slave.inc; +######################################################################################## +# 2 - BEGIN - IMPLICIT COMMIT by DDL +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +BEGIN; +Got one of the listed errors +Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; +source include/diff_master_slave.inc; +######################################################################################## +# 3 - BEGIN - COMMIT +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +COMMIT; +source include/diff_master_slave.inc; +######################################################################################## +# 4 - BEGIN - ROLLBACK +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +source include/diff_master_slave.inc; +######################################################################################## +# 5 - PROCEDURE +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +CREATE PROCEDURE p1(pd VARCHAR(30000)) +BEGIN +INSERT INTO t1 (a, data) VALUES (1, pd); +INSERT INTO t1 (a, data) VALUES (2, pd); +INSERT INTO t1 (a, data) VALUES (3, pd); +INSERT INTO t1 (a, data) VALUES (4, pd); +INSERT INTO t1 (a, data) VALUES (5, 's'); +END// +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +BEGIN; +Got one of the listed errors +COMMIT; +TRUNCATE TABLE t1; +BEGIN; +Got one of the listed errors +ROLLBACK; +source include/diff_master_slave.inc; +######################################################################################## +# 6 - XID +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +ROLLBACK TO sv; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +COMMIT; +source include/diff_master_slave.inc; +######################################################################################## +# 7 - NON-TRANS TABLE +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +COMMIT; +BEGIN; +Got one of the listed errors +COMMIT; +source include/diff_master_slave.inc; +######################################################################################## +# CLEAN +######################################################################################## +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE IF EXISTS t4; +Warnings: +Note 1051 Unknown table 't4' +DROP TABLE IF EXISTS t5; +DROP TABLE IF EXISTS t6; +Warnings: +Note 1051 Unknown table 't6' +DROP PROCEDURE p1; diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result index acee168baf2..f3cbcb5204c 100644 --- a/mysql-test/suite/rpl/r/rpl_row_create_table.result +++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result @@ -153,7 +153,7 @@ Log_name Pos Event_type Server_id End_log_pos Info # 207 Query # 275 BEGIN # 275 Table_map # 317 table_id: # (test.t7) # 317 Write_rows # 373 table_id: # flags: STMT_END_F -# 373 Query # 444 ROLLBACK +# 373 Query # 442 COMMIT SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -176,7 +176,7 @@ Log_name Pos Event_type Server_id End_log_pos Info # 107 Query # 175 BEGIN # 175 Table_map # 217 table_id: # (test.t7) # 217 Write_rows # 273 table_id: # flags: STMT_END_F -# 273 Query # 344 ROLLBACK +# 273 Query # 342 COMMIT SELECT * FROM t7 ORDER BY a,b; a b 1 2 @@ -327,7 +327,7 @@ Log_name Pos Event_type Server_id End_log_pos Info # 1330 Query # 1398 BEGIN # 1398 Table_map # 1439 table_id: # (test.t1) # 1439 Write_rows # 1483 table_id: # flags: STMT_END_F -# 1483 Query # 1554 ROLLBACK +# 1483 Query # 1552 COMMIT SHOW TABLES; Tables_in_test t1 @@ -431,12 +431,6 @@ SELECT * FROM t2 ORDER BY a; a SHOW BINLOG EVENTS FROM 107; Log_name Pos Event_type Server_id End_log_pos Info -# 107 Query # 175 BEGIN -# 175 Table_map # 216 table_id: # (test.t2) -# 216 Write_rows # 260 table_id: # flags: STMT_END_F -# 260 Table_map # 301 table_id: # (test.t2) -# 301 Write_rows # 340 table_id: # flags: STMT_END_F -# 340 Query # 411 ROLLBACK SELECT * FROM t2 ORDER BY a; a DROP TABLE t1,t2; diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result index 384573c0461..e999f9c28f0 100644 --- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result @@ -12,16 +12,16 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 898 ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 898 ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 -master-bin.000001 # Query 1 # use `test`; flush tables +master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 # Query # # use `test`; flush tables select * from t3; a stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result new file mode 100644 index 00000000000..bc53057e5a1 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result @@ -0,0 +1,570 @@ +######################################################################### +# CONFIGURATION +######################################################################### +CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +INSERT INTO tt_1(ddl_case) VALUES(0); +INSERT INTO tt_2(ddl_case) VALUES(0); +######################################################################### +# CHECK IMPLICT COMMIT +######################################################################### +SET AUTOCOMMIT= 0; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (41); +LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.nt_1 preload_keys Error Table 'test.nt_1' doesn't exist +test.nt_1 preload_keys status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (40); +LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys Error Table 'test.t1' doesn't exist +test.t1 preload_keys status Operation failed +test.t2 preload_keys Error Table 'test.t2' doesn't exist +test.t2 preload_keys status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (39); +ANALYZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 analyze Error Table 'test.nt_1' doesn't exist +test.nt_1 analyze status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (38); +CHECK TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 check Error Table 'test.nt_1' doesn't exist +test.nt_1 check status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (37); +OPTIMIZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 optimize Error Table 'test.nt_1' doesn't exist +test.nt_1 optimize status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (36); +REPAIR TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 repair Error Table 'test.nt_1' doesn't exist +test.nt_1 repair status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (35); +LOCK TABLES tt_1 WRITE; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (34); +UNLOCK TABLES; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (33); +CREATE USER 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (32); +GRANT ALL ON *.* TO 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (31); +SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (30); +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (29); +RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (28); +DROP USER 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (27); +CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (26); +ALTER EVENT evt COMMENT 'evt'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (25); +DROP EVENT evt; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP EVENT evt +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (24); +CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (23); +DROP TRIGGER tr; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (test.tt_2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TRIGGER tr +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (22); +CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1 +RETURN "fc" +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (21); +ALTER FUNCTION fc COMMENT 'fc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (20); +DROP FUNCTION fc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP FUNCTION fc +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (19); +CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`() +UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (18); +ALTER PROCEDURE pc COMMENT 'pc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (17); +DROP PROCEDURE pc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (16); +CREATE VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (15); +ALTER VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (14); +DROP VIEW v; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP VIEW v +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (13); +CREATE INDEX ix ON tt_1(ddl_case); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE INDEX ix ON tt_1(ddl_case) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (12); +DROP INDEX ix ON tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP INDEX ix ON tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (11); +CREATE TEMPORARY TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (10); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (9); +ALTER TABLE tt_xx RENAME new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (8); +DROP TEMPORARY TABLE IF EXISTS new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (7); +CREATE TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (6); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (5); +RENAME TABLE tt_xx TO new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (4); +TRUNCATE TABLE new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (3); +DROP TABLE IF EXISTS tt_xx, new_tt_xx; +Warnings: +Note 1051 Unknown table 'tt_xx' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx, new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (2); +CREATE DATABASE db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # CREATE DATABASE db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (1); +DROP DATABASE IF EXISTS db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # DROP DATABASE IF EXISTS db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +################################################################################### +# CLEAN +################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result index c9cb2268da7..1f3cd734451 100644 --- a/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_row_insert_delayed.result @@ -20,6 +20,7 @@ COUNT(*) 5000 truncate table t1; insert delayed into t1 values(10, "my name"); +flush table t1; insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); flush table t1; select * from t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result index 789db064eb5..488ebb92a02 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log.result +++ b/mysql-test/suite/rpl/r/rpl_row_log.result @@ -37,9 +37,12 @@ show binlog events from 107 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM master-bin.000001 # Query 1 # BEGIN -show binlog events from 107 limit 2,1; +show binlog events from 107 limit 1,4; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Query 1 # COMMIT flush logs; create table t3 (a int)ENGINE=MyISAM; select * from t1 order by 1 asc; @@ -251,7 +254,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000002 -Read_Master_Log_Pos 517 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000002 @@ -266,7 +269,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 517 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result index fbd9f685ba9..7a1615c0c7f 100644 --- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result @@ -37,9 +37,12 @@ show binlog events from 107 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=InnoDB master-bin.000001 # Query 1 # BEGIN -show binlog events from 107 limit 2,1; +show binlog events from 107 limit 1,4; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Write_rows 1 # table_id: # flags: STMT_END_F +master-bin.000001 # Xid 1 # COMMIT /* XID */ flush logs; create table t3 (a int)ENGINE=InnoDB; select * from t1 order by 1 asc; @@ -251,7 +254,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000002 -Read_Master_Log_Pos 475 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000002 @@ -266,7 +269,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 475 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result new file mode 100644 index 00000000000..47559b921dc --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result @@ -0,0 +1,12784 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +######################################################################### +# CONFIGURATION +######################################################################### +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +SET @commands= 'configure'; +SET SQL_LOG_BIN=0; +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +SET SQL_LOG_BIN=1; +SET SQL_LOG_BIN=0; +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +SET SQL_LOG_BIN=1; +INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1); +CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +END| +CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_tt_5_suc"; +END| +CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_nt_5_suc"; +END| +CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id; +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +SET @commands= ''; +######################################################################### +# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES +######################################################################### + + + + +# +#1) Generates in the binlog what follows: +# --> STMT "B T C" entries, format S. +# --> ROW "B T C" entries, format R. +# --> MIXED "B T C" entries, format S. +# +SET @commands= 'T'; +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (9, 1); +fc_i_tt_5_suc (9, 1) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (10, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#1.e) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 1), (7, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (13, 1), (10, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (14, 1, ''), (7, 1, fc_i_tt_5_suc (14, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#2) Generates in the binlog what follows: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (17, 1); +fc_i_nt_5_suc (17, 1) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (18, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#2.e) Generates in the binlog what follows if a N-table is changed: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#3) Generates in the binlog what follows: +# --> STMT "B M C" entry if only N-Table is changed, format S. +# --> STMT "B M C" entries, format S. +# --> ROW "B N T B T C" entries, format R. +# --> MIXED "B N T B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#3.e) Generates in the binlog what follows: +# --> STMT "B M C" entry if only N-Table is changed, format S. +# --> STMT "B M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 32, 1, COUNT(*) FROM nt_1 UNION SELECT 24, 1, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#4) Generates in the binlog what follows: +# --> STMT "B T T C" entries, format S. +# --> ROW "B T T C" entries, format R. +# --> MIXED "B T T C" entries, format S +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 4); +fc_i_tt_5_suc (39, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (43, 4); +fc_i_tt_5_suc (43, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (44, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (46, 2); +fc_i_tt_5_suc (46, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (47, 2); +fc_i_tt_5_suc (47, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (47, 4); +fc_i_tt_5_suc (47, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (48, 2); +fc_i_tt_5_suc (48, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (48, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (49, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (50, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (51, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (51, 4); +fc_i_tt_5_suc (51, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (52, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (52, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#4.e) Generates in the binlog what follows: +# --> STMT "B T C" entries, format S. +# --> ROW "B T C" entries, format R. +# --> MIXED "B T C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T eT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 4), (54, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (55, 4), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (56, 4, ''), (56, 2, fc_i_tt_5_suc (56, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B eT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 2), (57, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (59, 2), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (60, 2, ''), (59, 4, fc_i_tt_5_suc (60, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#5) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (61, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (61, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (62, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (62, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (63, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (63, 4); +fc_i_tt_5_suc (63, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (64, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (64, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (65, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (65, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (66, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (66, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (67, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (67, 4); +fc_i_tt_5_suc (67, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (68, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (68, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (69, 2); +fc_i_tt_5_suc (69, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (69, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (70, 2); +fc_i_tt_5_suc (70, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (70, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (71, 2); +fc_i_tt_5_suc (71, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (71, 4); +fc_i_tt_5_suc (71, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (72, 2); +fc_i_tt_5_suc (72, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (72, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (73, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (73, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (74, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (74, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (75, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (75, 4); +fc_i_tt_5_suc (75, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (76, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (76, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#5.e) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (77, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (77, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T eT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (78, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (78, 4), (78, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (79, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (79, 4), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (80, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (80, 4, ''), (80, 2, fc_i_tt_5_suc (80, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (81, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B eT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (82, 2), (60, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (82, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (83, 2), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (83, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (84, 2, ''), (60, 4, fc_i_tt_5_suc (84, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (84, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#6) Generates in the binlog what follows: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (87, 4); +fc_i_nt_5_suc (87, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (88, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (91, 4); +fc_i_nt_5_suc (91, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (92, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (93, 2); +fc_i_nt_5_suc (93, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (94, 2); +fc_i_nt_5_suc (94, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (95, 2); +fc_i_nt_5_suc (95, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (95, 4); +fc_i_nt_5_suc (95, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (96, 2); +fc_i_nt_5_suc (96, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (96, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (97, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (98, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (99, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (99, 4); +fc_i_nt_5_suc (99, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (100, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (100, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#6.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N eN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N eN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#7) Generates in the binlog what follows: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (111, 4); +fc_i_nt_5_suc (111, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (112, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (115, 4); +fc_i_nt_5_suc (115, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (116, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (117, 2); +fc_i_nt_5_suc (117, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (118, 2); +fc_i_nt_5_suc (118, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (119, 2); +fc_i_nt_5_suc (119, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (119, 4); +fc_i_nt_5_suc (119, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (120, 2); +fc_i_nt_5_suc (120, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (120, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (121, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (122, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (123, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (123, 4); +fc_i_nt_5_suc (123, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (124, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (124, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#7.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N eN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N eN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#8) Generates in the binlog what follows: +# --> STMT "B T N C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format R in N and S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (135, 4); +fc_i_nt_5_suc (135, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (136, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (139, 4); +fc_i_nt_5_suc (139, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (140, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (141, 2); +fc_i_tt_5_suc (141, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (142, 2); +fc_i_tt_5_suc (142, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (143, 2); +fc_i_tt_5_suc (143, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (143, 4); +fc_i_nt_5_suc (143, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (144, 2); +fc_i_tt_5_suc (144, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (144, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (145, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (146, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (147, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (147, 4); +fc_i_nt_5_suc (147, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (148, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (148, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#8.e) Generates in the binlog what follows if T-* fails: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# Otherwise, what follows if N-* fails and a N-Table is changed: +# --> STMT "B T N C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format R in N and S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (150, 2), (136, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Te N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T eN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Ne C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Ne C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#9) Generates in the binlog what follows: +# --> STMT "B T N R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (155, 4); +fc_i_nt_5_suc (155, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (156, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (159, 4); +fc_i_nt_5_suc (159, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (160, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (161, 2); +fc_i_tt_5_suc (161, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (162, 2); +fc_i_tt_5_suc (162, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (163, 2); +fc_i_tt_5_suc (163, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (163, 4); +fc_i_nt_5_suc (163, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (164, 2); +fc_i_tt_5_suc (164, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (164, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (165, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (166, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (167, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (167, 4); +fc_i_nt_5_suc (167, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (168, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (168, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#9.e) Generates in the binlog what follows if T* fails: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# Otherwise, what follows if N* fails and a N-Table is changed: +# --> STMT "B T N R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (170, 2), (152, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Te N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (171, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T eN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Ne R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T Ne R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#10) Generates in the binlog: +# --> STMT "B N C B T C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (175, 4); +fc_i_tt_5_suc (175, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (176, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (179, 4); +fc_i_tt_5_suc (179, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (180, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (181, 2); +fc_i_nt_5_suc (181, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (182, 2); +fc_i_nt_5_suc (182, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (183, 2); +fc_i_nt_5_suc (183, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (183, 4); +fc_i_tt_5_suc (183, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (184, 2); +fc_i_nt_5_suc (184, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (184, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (185, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (186, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (187, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (187, 4); +fc_i_tt_5_suc (187, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (188, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (188, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#11) Generates in the binlog what follows: +# --> STMT "B N C" entries, format S. +# --> ROW "B N C" entries, format R. +# --> MIXED "B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (189, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (190, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (191, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (192, 4); +fc_i_tt_5_suc (192, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (193, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (194, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (195, 4); +fc_i_tt_5_suc (195, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (196, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (197, 2); +fc_i_nt_5_suc (197, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (197, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (198, 2); +fc_i_nt_5_suc (198, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (198, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (199, 2); +fc_i_nt_5_suc (199, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (199, 4); +fc_i_tt_5_suc (199, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (200, 2); +fc_i_nt_5_suc (200, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (200, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (201, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (201, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (202, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (202, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (203, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (203, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (204, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (204, 4); +fc_i_tt_5_suc (204, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#12) Generates in the binlog what follows: +# --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +# --> STMT "B M T C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B tN T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#12.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +# --> STMT "B M T C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 214, 2, COUNT(*) FROM nt_1 UNION SELECT 213, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (215, 2), (208, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (216, 2, ''), (212, 2, fc_i_tt_5_suc (216, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (217, 2), (211, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (218, 2, ''), (212, 2, fc_i_nt_5_suc (218, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#13) "B M T R" generates in the binlog: +# --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +# --> STMT "B M T R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (219, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 220, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (220, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B nT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (221, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (222, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (223, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (224, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (225, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (226, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#13.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +# --> STMT "B M T R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (227, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 228, 2, COUNT(*) FROM nt_1 UNION SELECT 218, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (228, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (229, 2), (222, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (229, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (230, 2, ''), (226, 2, fc_i_tt_5_suc (230, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (230, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (231, 2), (211, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (231, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (232, 2, ''), (212, 2, fc_i_nt_5_suc (232, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (232, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#14) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T tN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T nT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#14.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M C" entries, format S. +# --> ROW "B N C B T C" entry, format R. +# --> MIXED "B N C B T C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tNe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T tNe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 242, 4, COUNT(*) FROM nt_1 UNION SELECT 242, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nTe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T nTe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (243, 4), (236, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (244, 4, ''), (240, 2, fc_i_tt_5_suc (244, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (245, 4), (239, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (246, 4, ''), (240, 4, fc_i_nt_5_suc (246, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#15) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T tN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (248, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 248, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T nT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (249, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (250, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (251, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (252, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (253, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (254, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#15.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tNe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T tNe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (256, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 256, 4, COUNT(*) FROM nt_1 UNION SELECT 256, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nTe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T nTe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (257, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (257, 4), (250, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (258, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (258, 4, ''), (254, 2, fc_i_tt_5_suc (258, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (259, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (259, 4), (239, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (260, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (260, 4, ''), (240, 4, fc_i_nt_5_suc (260, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#16) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#16.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 270, 2, COUNT(*) FROM nt_1 UNION SELECT 262, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#17) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#17.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 284, 2, COUNT(*) FROM nt_1 UNION SELECT 262, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#18) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B N C B N C B T C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N nT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#18.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tNe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tNe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 298, 4, COUNT(*) FROM nt_1 UNION SELECT 290, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nTe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nTe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (299, 4), (292, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (300, 4, ''), (296, 2, fc_i_tt_5_suc (300, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (301, 4), (295, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (302, 4, ''), (296, 4, fc_i_nt_5_suc (302, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#19) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#19.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tNe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tNe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 312, 4, COUNT(*) FROM nt_1 UNION SELECT 290, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nTe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nTe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (313, 4), (306, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (314, 4, ''), (310, 2, fc_i_tt_5_suc (314, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (315, 4), (295, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (316, 4, ''), (296, 4, fc_i_nt_5_suc (316, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-func R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 2 - SAVEPOINT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 3 - CREATE TABLE...SELECT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_321 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_321` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_321) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_321, nt_xx_321; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T CS-T->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_321` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_321) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T CS-T->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_322 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_322` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_322) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_322, nt_xx_322; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N CS-N->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_322` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_322) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N CS-N->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_323 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_323, nt_xx_323; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N CS-T->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N CS-T->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_324 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_324, nt_xx_324; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_325 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_325, nt_xx_325; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_326 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_326, nt_xx_326; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 4 - ROLLBACK TEMPORARY TABLE +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +################################################################################### +# CLEAN +################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result index 461ab14a93a..5834c95b319 100644 --- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result +++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result @@ -74,11 +74,12 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from limit 1, 3; +show binlog events from limit 1, 4; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.t1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* show binlog events in 'slave-bin.000001' from ; Log_name Pos Event_type Server_id End_log_pos Info @@ -142,11 +143,12 @@ slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from limit 1, 3; +show binlog events from limit 1, 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +slave-bin.000001 # Query # # COMMIT [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* show relaylog events in 'slave-relay-bin.000003' from ; Log_name Pos Event_type Server_id End_log_pos Info diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result index 5a37344cac6..963b4d471dd 100644 --- a/mysql-test/suite/rpl/r/rpl_slave_skip.result +++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result @@ -104,8 +104,10 @@ SET @foo = 12; INSERT INTO t1 VALUES(@foo, 2*@foo); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # User var # # @`foo`=12 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo) +master-bin.000001 # Query # # COMMIT START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=106; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; @@ -116,7 +118,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000001 -Read_Master_Log_Pos 249 +Read_Master_Log_Pos 386 Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000001 @@ -131,7 +133,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 249 +Exec_Master_Log_Pos 386 Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result index e2946bb487a..150d3caa822 100644 --- a/mysql-test/suite/rpl/r/rpl_sp.result +++ b/mysql-test/suite/rpl/r/rpl_sp.result @@ -118,6 +118,7 @@ ERROR 23000: Duplicate entry '20' for key 'a' show warnings; Level Code Message Error 1062 Duplicate entry '20' for key 'a' +Warning 1196 Some non-transactional changed tables couldn't be rolled back select * from t2; a 20 @@ -270,6 +271,7 @@ end| do fn1(100); Warnings: Error 1062 Duplicate entry '100' for key 'a' +Warning 1196 Some non-transactional changed tables couldn't be rolled back select fn1(20); ERROR 23000: Duplicate entry '20' for key 'a' select * from t2; @@ -421,9 +423,15 @@ set b = 8; insert into t1 values (b); insert into t1 values (unix_timestamp()); end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values ( NAME_CONST('b',8)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (unix_timestamp()) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() select * from mysqltest1.t1 master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo2 contains sql @@ -442,13 +450,25 @@ begin insert into t2 values(3); insert into t1 values (5); end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (15) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; alter procedure foo4 sql security invoker +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo4`() @@ -456,7 +476,9 @@ master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost begin insert into t2 values(20),(20); end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(20),(20) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo4 master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo master-bin.000001 # Query # # use `mysqltest1`; drop procedure foo2 @@ -467,17 +489,27 @@ begin insert into t1 values (x); return x+2; end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete t1,t2 from t1,t2 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t2 values(fn1(21)) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`() RETURNS int(11) NO SQL begin return unix_timestamp(); end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values(fn1()) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) NO SQL begin @@ -488,7 +520,9 @@ master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost begin return 0; end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete from t2 +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; alter table t2 add unique (a) master-bin.000001 # Query # # use `mysqltest1`; drop function fn1 master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` FUNCTION `fn1`(x int) RETURNS int(11) @@ -496,14 +530,26 @@ begin insert into t2 values(x),(x); return 10; end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(100) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; SELECT `mysqltest1`.`fn1`(20) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; delete from t1 +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; drop trigger trg +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest1`; insert into t1 values (1) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() READS SQL DATA select * from t1 @@ -524,7 +570,9 @@ return var; end master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select 1 as a master-bin.000001 # Query # # use `test`; create table t1 (a int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into t1 (a) values (f1()) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop view v1 master-bin.000001 # Query # # use `test`; drop function f1 master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1 @@ -532,7 +580,9 @@ master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS t1 master-bin.000001 # Query # # use `test`; CREATE TABLE t1(col VARCHAR(10)) master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10)) INSERT INTO t1 VALUES(arg) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; DROP PROCEDURE p1 master-bin.000001 # Query # # use `test`; DROP PROCEDURE IF EXISTS p1 master-bin.000001 # Query # # use `test`; DROP FUNCTION IF EXISTS f1 @@ -550,13 +600,17 @@ master-bin.000001 # Query # # create database mysqltest2 master-bin.000001 # Query # # use `mysqltest2`; create table t ( t integer ) master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`() begin end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest2`; insert into t values ( 1 ) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `mysqltest2`; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) begin insert into t values (1); return 0; end +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`() +master-bin.000001 # Query # # COMMIT set @@global.log_bin_trust_routine_creators= @old_log_bin_trust_routine_creators; Warnings: Warning 1287 The syntax '@@log_bin_trust_routine_creators' is deprecated and will be removed in MySQL 6.0. Please use '@@log_bin_trust_function_creators' instead @@ -645,15 +699,33 @@ insert into t1 values (unix_timestamp()); end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values ( NAME_CONST('b',8)) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values (unix_timestamp()) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete from t1 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo2`() select * from mysqltest1.t1 /*!*/; @@ -692,27 +764,63 @@ insert into t1 values (5); end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t2 values(3) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values (15) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t2 values(3) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; alter procedure foo4 sql security invoker /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t2 values(3) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values (5) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete from t2 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; alter table t2 add unique (a) /*!*/; SET TIMESTAMP=t/*!*/; @@ -726,9 +834,15 @@ insert into t2 values(20),(20); end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t2 values(20),(20) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; drop procedure foo4 /*!*/; SET TIMESTAMP=t/*!*/; @@ -749,15 +863,33 @@ return x+2; end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete t1,t2 from t1,t2 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; SELECT `mysqltest1`.`fn1`(20) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t2 values(fn1(21)) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; drop function fn1 /*!*/; SET TIMESTAMP=t/*!*/; @@ -768,12 +900,24 @@ return unix_timestamp(); end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete from t1 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values(fn1()) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; CREATE DEFINER=`zedjzlcsjhd`@`127.0.0.1` FUNCTION `fn2`() RETURNS int(11) NO SQL begin @@ -788,9 +932,15 @@ return 0; end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete from t2 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; alter table t2 add unique (a) /*!*/; SET TIMESTAMP=t/*!*/; @@ -804,30 +954,66 @@ return 10; end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; SELECT `mysqltest1`.`fn1`(100) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; SELECT `mysqltest1`.`fn1`(20) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete from t1 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` trigger trg before insert on t1 for each row set new.a= 10 /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values (1) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; delete from t1 /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; drop trigger trg /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 values (1) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` PROCEDURE `foo`() READS SQL DATA select * from t1 @@ -867,9 +1053,15 @@ SET TIMESTAMP=t/*!*/; create table t1 (a int) /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t1 (a) values (f1()) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; drop view v1 /*!*/; SET TIMESTAMP=t/*!*/; @@ -889,9 +1081,15 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(arg VARCHAR(10)) INSERT INTO t1 VALUES(arg) /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; INSERT INTO t1 VALUES( NAME_CONST('arg',_latin1'test' COLLATE 'latin1_swedish_ci')) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; DROP PROCEDURE p1 /*!*/; SET TIMESTAMP=t/*!*/; @@ -938,20 +1136,32 @@ CREATE DEFINER=`root`@`localhost` PROCEDURE `mysqltest`.`test`() begin end /*!*/; SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; +SET TIMESTAMP=t/*!*/; insert into t values ( 1 ) /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11) begin insert into t values (1); return 0; end /*!*/; +SET TIMESTAMP=t/*!*/; +BEGIN +/*!*/; use mysqltest/*!*/; SET TIMESTAMP=t/*!*/; SELECT `mysqltest2`.`f1`() /*!*/; SET TIMESTAMP=t/*!*/; +COMMIT +/*!*/; +SET TIMESTAMP=t/*!*/; drop database mysqltest /*!*/; SET TIMESTAMP=t/*!*/; diff --git a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result index 2f6e98d5eec..9d17615573c 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result +++ b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result @@ -44,32 +44,60 @@ END// CALL p1(); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=2 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=3 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=4 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=5 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=6 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=7 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=8 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=9 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=10 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = 1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=2 master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = 2 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 2 +master-bin.000001 # Query # # COMMIT # Result on master SELECT * FROM t1; id @@ -100,14 +128,24 @@ DROP TRIGGER tr1; CALL p2(); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=11 master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (NULL) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=3 master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = f1(3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=12 master-bin.000001 # Query # # use `test`; DELETE FROM t1 WHERE id = f1(4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 3 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; DELETE FROM t2 WHERE id = 4 +master-bin.000001 # Query # # COMMIT # Result on master SELECT * FROM t1; id diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result new file mode 100644 index 00000000000..3d571f5b6fa --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result @@ -0,0 +1,158 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; +CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam; +CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb; +######################################################################################## +# 1 - SINGLE STATEMENT +######################################################################################## +*** Single statement on transactional table *** +Got one of the listed errors +*** Single statement on non-transactional table *** +Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; +*** Single statement on both transactional and non-transactional tables. *** +Got one of the listed errors +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; +source include/diff_master_slave.inc; +######################################################################################## +# 2 - BEGIN - IMPLICIT COMMIT by DDL +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +BEGIN; +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +BEGIN; +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +source include/diff_master_slave.inc; +######################################################################################## +# 3 - BEGIN - COMMIT +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +COMMIT; +source include/diff_master_slave.inc; +######################################################################################## +# 4 - BEGIN - ROLLBACK +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +source include/diff_master_slave.inc; +######################################################################################## +# 5 - PROCEDURE +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +CREATE PROCEDURE p1(pd VARCHAR(30000)) +BEGIN +INSERT INTO t1 (a, data) VALUES (1, pd); +INSERT INTO t1 (a, data) VALUES (2, pd); +INSERT INTO t1 (a, data) VALUES (3, pd); +INSERT INTO t1 (a, data) VALUES (4, pd); +INSERT INTO t1 (a, data) VALUES (5, 's'); +END// +TRUNCATE TABLE t1; +TRUNCATE TABLE t1; +BEGIN; +Got one of the listed errors +COMMIT; +TRUNCATE TABLE t1; +BEGIN; +Got one of the listed errors +ROLLBACK; +source include/diff_master_slave.inc; +######################################################################################## +# 6 - XID +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +ROLLBACK TO sv; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +COMMIT; +source include/diff_master_slave.inc; +######################################################################################## +# 7 - NON-TRANS TABLE +######################################################################################## +TRUNCATE TABLE t1; +TRUNCATE TABLE t2; +TRUNCATE TABLE t3; +BEGIN; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Got one of the listed errors +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +COMMIT; +BEGIN; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Got one of the listed errors +Got one of the listed errors +COMMIT; +SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; +START SLAVE SQL_THREAD; +source include/diff_master_slave.inc; +######################################################################################## +# CLEAN +######################################################################################## +DROP TABLE t1; +DROP TABLE t2; +DROP TABLE t3; +DROP TABLE IF EXISTS t4; +DROP TABLE IF EXISTS t5; +DROP TABLE IF EXISTS t6; +Warnings: +Note 1051 Unknown table 't6' +DROP PROCEDURE p1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result index 1f6c86768b5..e999f9c28f0 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result +++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result @@ -12,16 +12,16 @@ create table t4 (a int); insert into t4 select * from t3; rename table t1 to t5, t2 to t1; flush no_write_to_binlog tables; -SHOW BINLOG EVENTS FROM 657 ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 select * from t3; a flush tables; -SHOW BINLOG EVENTS FROM 657 ; +show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query 1 # use `test`; rename table t1 to t5, t2 to t1 -master-bin.000001 # Query 1 # use `test`; flush tables +master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1 +master-bin.000001 # Query # # use `test`; flush tables select * from t3; a stop slave; diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result new file mode 100644 index 00000000000..7365f4591e5 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result @@ -0,0 +1,528 @@ +######################################################################### +# CONFIGURATION +######################################################################### +CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +INSERT INTO tt_1(ddl_case) VALUES(0); +INSERT INTO tt_2(ddl_case) VALUES(0); +######################################################################### +# CHECK IMPLICT COMMIT +######################################################################### +SET AUTOCOMMIT= 0; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (41); +LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.nt_1 preload_keys Error Table 'test.nt_1' doesn't exist +test.nt_1 preload_keys status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (41) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (40); +LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.t1 preload_keys Error Table 'test.t1' doesn't exist +test.t1 preload_keys status Operation failed +test.t2 preload_keys Error Table 'test.t2' doesn't exist +test.t2 preload_keys status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (40) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (39); +ANALYZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 analyze Error Table 'test.nt_1' doesn't exist +test.nt_1 analyze status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (39) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (38); +CHECK TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 check Error Table 'test.nt_1' doesn't exist +test.nt_1 check status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (38) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (37); +OPTIMIZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 optimize Error Table 'test.nt_1' doesn't exist +test.nt_1 optimize status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (37) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (36); +REPAIR TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 repair Error Table 'test.nt_1' doesn't exist +test.nt_1 repair status Operation failed +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (36) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (35); +LOCK TABLES tt_1 WRITE; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (35) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (34); +UNLOCK TABLES; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (34) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (33); +CREATE USER 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (33) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (32); +GRANT ALL ON *.* TO 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (32) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (31); +SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (31) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (30); +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (30) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (29); +RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (29) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (28); +DROP USER 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (28) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (27); +CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (27) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (26); +ALTER EVENT evt COMMENT 'evt'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (26) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (25); +DROP EVENT evt; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (25) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP EVENT evt +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (24); +CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (24) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (23); +DROP TRIGGER tr; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (23) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TRIGGER tr +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (22); +CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (22) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1 +RETURN "fc" +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (21); +ALTER FUNCTION fc COMMENT 'fc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (21) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (20); +DROP FUNCTION fc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (20) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP FUNCTION fc +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (19); +CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (19) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`() +UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (18); +ALTER PROCEDURE pc COMMENT 'pc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (18) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (17); +DROP PROCEDURE pc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (17) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (16); +CREATE VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (16) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (15); +ALTER VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (15) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (14); +DROP VIEW v; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (14) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP VIEW v +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (13); +CREATE INDEX ix ON tt_1(ddl_case); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (13) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE INDEX ix ON tt_1(ddl_case) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (12); +DROP INDEX ix ON tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (12) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP INDEX ix ON tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (11); +CREATE TEMPORARY TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (11) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (10); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (10) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (9); +ALTER TABLE tt_xx RENAME new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (9) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx RENAME new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (8); +DROP TEMPORARY TABLE IF EXISTS new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (8) +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS new_tt_xx +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (7); +CREATE TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (7) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (6); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (6) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (5); +RENAME TABLE tt_xx TO new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (5) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (4); +TRUNCATE TABLE new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (4) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (3); +DROP TABLE IF EXISTS tt_xx, new_tt_xx; +Warnings: +Note 1051 Unknown table 'tt_xx' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (3) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx, new_tt_xx +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (2); +CREATE DATABASE db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (2) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # CREATE DATABASE db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (1); +DROP DATABASE IF EXISTS db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(ddl_case) VALUES (1) +master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # DROP DATABASE IF EXISTS db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +################################################################################### +# CLEAN +################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result similarity index 97% rename from mysql-test/suite/rpl/r/rpl_innodb.result rename to mysql-test/suite/rpl/r/rpl_stm_innodb.result index bf6c3cb8c86..457ad3340b4 100644 --- a/mysql-test/suite/rpl/r/rpl_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_stm_innodb.result @@ -29,12 +29,12 @@ REPLACE INTO TABLE t4 (name,number); SELECT * FROM t4; id name number -3 XXX 12345 -4 XXY 12345 +4 XXX 12345 +5 XXY 12345 SELECT * FROM t4; id name number -3 XXX 12345 -4 XXY 12345 +4 XXX 12345 +5 XXY 12345 FLUSH LOGS; FLUSH LOGS; DROP DATABASE IF EXISTS mysqltest1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result index 3ed132dad61..1bef1c89ec7 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result +++ b/mysql-test/suite/rpl/r/rpl_stm_insert_delayed.result @@ -20,6 +20,7 @@ COUNT(*) 5000 truncate table t1; insert delayed into t1 values(10, "my name"); +flush table t1; insert delayed into t1 values(10, "is Bond"), (20, "James Bond"); ERROR 23000: Duplicate entry '10' for key 'PRIMARY' flush table t1; @@ -52,7 +53,7 @@ INSERT DELAYED IGNORE INTO t1 VALUES(1); flush table t1; show binlog events in 'master-bin.000002' LIMIT 2,2; Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +x x x x x BEGIN x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a @@ -60,7 +61,7 @@ a On slave show binlog events in 'slave-bin.000002' LIMIT 2,2; Log_name Pos Event_type Server_id End_log_pos Info -x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) +x x x x x BEGIN x x x x x use `test`; INSERT DELAYED IGNORE INTO t1 VALUES(1) select * from t1; a diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result index 97dfbb618e2..7e6a23631ae 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_log.result +++ b/mysql-test/suite/rpl/r/rpl_stm_log.result @@ -20,22 +20,29 @@ show binlog events; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Intvar 1 # INSERT_ID=1 master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) +master-bin.000001 # Query 1 # COMMIT master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 master-bin.000001 # Execute_load_query 1 # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=1 +master-bin.000001 # Query 1 # COMMIT show binlog events from 107 limit 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM show binlog events from 107 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM -master-bin.000001 # Intvar 1 # INSERT_ID=1 -show binlog events from 107 limit 2,1; +master-bin.000001 # Query 1 # BEGIN +show binlog events from 107 limit 1,4; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # BEGIN +master-bin.000001 # Intvar 1 # INSERT_ID=1 master-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) +master-bin.000001 # Query 1 # COMMIT flush logs; create table t3 (a int)ENGINE=MyISAM; select * from t1 order by 1 asc; @@ -188,19 +195,25 @@ insert into t2 values (1); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; insert into t1 values (NULL) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table t1 master-bin.000001 # Query # # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +master-bin.000001 # Query # # BEGIN master-bin.000001 # Begin_load_query # # ;file_id=#;block_len=# master-bin.000001 # Execute_load_query # # use `test`; load data infile '../../std_data/words.dat' into table t1 ignore 1 lines ;file_id=# +master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=4 show binlog events in 'master-bin.000002'; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM +master-bin.000002 # Query 1 # BEGIN master-bin.000002 # Query 1 # use `test`; insert into t2 values (1) +master-bin.000002 # Query 1 # COMMIT show binary logs; Log_name File_size master-bin.000001 # @@ -213,19 +226,25 @@ show binlog events in 'slave-bin.000001' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=MyISAM +slave-bin.000001 # Query 1 # BEGIN slave-bin.000001 # Intvar 1 # INSERT_ID=1 slave-bin.000001 # Query 1 # use `test`; insert into t1 values (NULL) +slave-bin.000001 # Query 1 # COMMIT slave-bin.000001 # Query 1 # use `test`; drop table t1 slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=MyISAM +slave-bin.000001 # Query 1 # BEGIN slave-bin.000001 # Begin_load_query 1 # ;file_id=1;block_len=581 slave-bin.000001 # Execute_load_query 1 # use `test`; load data INFILE '../../tmp/SQL_LOAD-2-1-1.data' INTO table t1 ignore 1 lines ;file_id=1 +slave-bin.000001 # Query 1 # COMMIT slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=MyISAM slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4 show binlog events in 'slave-bin.000002' from 4; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=MyISAM +slave-bin.000002 # Query 1 # BEGIN slave-bin.000002 # Query 1 # use `test`; insert into t2 values (1) +slave-bin.000002 # Query 1 # COMMIT SHOW SLAVE STATUS; Slave_IO_State # Master_Host 127.0.0.1 @@ -233,7 +252,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000002 -Read_Master_Log_Pos 393 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000002 @@ -248,7 +267,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 393 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File @@ -285,11 +304,15 @@ insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()); show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; create table t1(a int auto_increment primary key, b int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # INSERT_ID=1 master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Intvar # # LAST_INSERT_ID=1 master-bin.000001 # Intvar # # INSERT_ID=5 master-bin.000001 # Query # # use `test`; insert into t1 values (NULL, last_insert_id()), (NULL, last_insert_id()) +master-bin.000001 # Query # # COMMIT select * from t1; a b 1 1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result index 512a72c3040..761ad7f42d4 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result @@ -15,78 +15,140 @@ INSERT INTO t1 VALUES (6); show binlog events in 'master-bin.000001' from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +master-bin.000001 # Query # # COMMIT [MASTER] ********* SOW BINLOG EVENTS ********* show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +master-bin.000001 # Query # # COMMIT [MASTER] ********* SOW BINLOG EVENTS ... LIMIT rows ********* show binlog events from limit 3; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) [MASTER] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from limit 1, 3; +show binlog events from limit 1, 4; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) -master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* show binlog events in 'slave-bin.000001' from ; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +slave-bin.000001 # Query # # COMMIT [SLAVE] ********* SOW BINLOG EVENTS ********* show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +slave-bin.000001 # Query # # COMMIT [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT rows ********* show binlog events from limit 3; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) [SLAVE] ********* SOW BINLOG EVENTS ... LIMIT offset,rows ********* -show binlog events from limit 1, 3; +show binlog events from limit 1, 4; Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) -slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* show relaylog events in 'slave-relay-bin.000003' from ; Log_name Pos Event_type Server_id End_log_pos Info slave-relay-bin.000003 # Rotate # # master-bin.000001;pos=4 slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-relay-bin.000003 # Query # # BEGIN slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (4) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (5) +slave-relay-bin.000003 # Query # # COMMIT +slave-relay-bin.000003 # Query # # BEGIN slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (6) +slave-relay-bin.000003 # Query # # COMMIT [SLAVE] ********* SOW RELAYLOG EVENTS ********* show relaylog events from ; Log_name Pos Event_type Server_id End_log_pos Info @@ -102,7 +164,7 @@ show relaylog events in 'slave-relay-bin.000003' from limit 1, 3 Log_name Pos Event_type Server_id End_log_pos Info slave-relay-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION slave-relay-bin.000003 # Query # # use `test`; CREATE TABLE t1 (a INT) -slave-relay-bin.000003 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-relay-bin.000003 # Query # # BEGIN FLUSH LOGS; FLUSH LOGS; DROP TABLE t1; @@ -114,12 +176,24 @@ master-bin.000002 # Query # # use `test`; DROP TABLE t1 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Rotate # # master-bin.000002;pos=4 [SLAVE] ********* SOW BINLOG EVENTS IN ... ********* show binlog events in 'slave-bin.000002' from ; @@ -129,12 +203,24 @@ slave-bin.000002 # Query # # use `test`; DROP TABLE t1 show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (5) +slave-bin.000001 # Query # # COMMIT +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (6) +slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Rotate # # slave-bin.000002;pos=4 [SLAVE] ********* SOW RELAYLOG EVENTS IN ... ********* show relaylog events in 'slave-relay-bin.000005' from ; diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index 03223166f44..ebe6d3e82b9 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -4,867 +4,10401 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -################################################################################### -# CONFIGURATION -################################################################################### +######################################################################### +# CONFIGURATION +######################################################################### +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +SET @commands= 'configure'; SET SQL_LOG_BIN=0; -CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=0; -CREATE TABLE nt_1 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_3 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE nt_4 (a text, b int PRIMARY KEY, c text) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_3 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; -CREATE TABLE tt_4 (a text, b int PRIMARY KEY, c text) ENGINE = Innodb; +CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE nt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM; +CREATE TABLE tt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_4 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_5 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; +CREATE TABLE tt_6 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = Innodb; SET SQL_LOG_BIN=1; -CREATE FUNCTION f1 () RETURNS VARCHAR(64) +INSERT INTO nt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO nt_6(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_1(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_2(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_3(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_4(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_5(trans_id, stmt_id) VALUES(1,1); +INSERT INTO tt_6(trans_id, stmt_id) VALUES(1,1); +CREATE PROCEDURE pc_i_tt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) BEGIN -RETURN "Testing..."; +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); END| -CREATE FUNCTION f2 () RETURNS VARCHAR(64) +CREATE PROCEDURE pc_i_nt_5_suc (IN p_trans_id INTEGER, IN p_stmt_id INTEGER) BEGIN -RETURN f1(); +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); END| -CREATE PROCEDURE pc_i_tt_3 (IN x INT, IN y VARCHAR(64)) +CREATE FUNCTION fc_i_tt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) BEGIN -INSERT INTO tt_3 VALUES (y,x,x); +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO tt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_tt_5_suc"; END| -CREATE TRIGGER tr_i_tt_3_to_nt_3 BEFORE INSERT ON tt_3 FOR EACH ROW +CREATE FUNCTION fc_i_nt_5_suc (p_trans_id INTEGER, p_stmt_id INTEGER) RETURNS VARCHAR(64) BEGIN -INSERT INTO nt_3 VALUES (NEW.a, NEW.b, NEW.c); +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_5 WHERE trans_id= p_trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, p_stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id); +INSERT INTO nt_5(trans_id, stmt_id) VALUES (p_trans_id, in_stmt_id + 1); +RETURN "fc_i_nt_5_suc"; END| -CREATE TRIGGER tr_i_nt_4_to_tt_4 BEFORE INSERT ON nt_4 FOR EACH ROW +CREATE TRIGGER tr_i_tt_3_to_nt_3 AFTER INSERT ON tt_3 FOR EACH ROW BEGIN -INSERT INTO tt_4 VALUES (NEW.a, NEW.b, NEW.c); +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_3 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_3(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); END| -################################################################################### -# MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES -################################################################################### +CREATE TRIGGER tr_i_nt_4_to_tt_4 AFTER INSERT ON nt_4 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_4 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_4(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_tt_5_to_tt_6 AFTER INSERT ON tt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM tt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id, 1), 1) INTO in_stmt_id; +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO tt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +CREATE TRIGGER tr_i_nt_5_to_nt_6 AFTER INSERT ON nt_5 FOR EACH ROW +BEGIN +DECLARE in_stmt_id INTEGER; +SELECT max(stmt_id) INTO in_stmt_id FROM nt_6 WHERE trans_id= NEW.trans_id; +SELECT COALESCE(greatest(in_stmt_id + 1, NEW.stmt_id), 1) INTO in_stmt_id; +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id); +INSERT INTO nt_6(trans_id, stmt_id) VALUES (NEW.trans_id, in_stmt_id + 1); +END| +SET @commands= ''; +######################################################################### +# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES +######################################################################### + + + + # -#1) "B T T C" generates in binlog the "B T T C" entries. +#1) Generates in the binlog what follows: +# --> STMT "B T C" entries, format S. +# --> ROW "B T C" entries, format R. +# --> MIXED "B T C" entries, format S. # -BEGIN; -INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4"); -INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4"); -COMMIT; -show binlog events from ; +SET @commands= 'T'; +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 4", 4, "new text 4") -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 4", 4, "new text 4") +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1) master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#1.e) "B T T C" with error in T generates in binlog the "B T T C" entries. -# -INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2"); -BEGIN; -INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -2", -2, "new text -2"); -ERROR 23000: Duplicate entry '-2' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3"); -COMMIT; -BEGIN; -INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5"); -INSERT INTO tt_2 VALUES ("new text -4", -4, "new text -4"), ("new text -5", -5, "new text -5"); -ERROR 23000: Duplicate entry '-5' for key 'PRIMARY' -COMMIT; -show binlog events from ; +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -2", -2, "new text -2") +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (8, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (9, 1); +fc_i_tt_5_suc (9, 1) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(9,1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (10, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text -3", -3, "new text -3") +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1)) master-bin.000001 # Xid # # COMMIT /* XID */ master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text -5", -5, "new text -5") +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',10), NAME_CONST('in_stmt_id',1) + 1) master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- + # -#2) "B T T R" generates in binlog an "empty" entry. +#1.e) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. # +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (7, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (12, 1), (7, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (13, 1), (10, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (14, 1, ''), (7, 1, fc_i_tt_5_suc (14, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#2) Generates in the binlog what follows: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (16, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (17, 1); +fc_i_nt_5_suc (17, 1) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(17,1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(17,1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (18, 1); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',18), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#2.e) Generates in the binlog what follows if a N-table is changed: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (15, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (20, 1), (15, 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (21, 1), (18, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (22, 1, ''), (20, 1, fc_i_nt_5_suc (22, 1)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#3) Generates in the binlog what follows: +# --> STMT "B M C" entry if only N-Table is changed, format S. +# --> STMT "B M C" entries, format S. +# --> ROW "B N T B T C" entries, format R. +# --> MIXED "B N T B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 23, 1, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 24, 1, COUNT(*) FROM nt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#3.e) Generates in the binlog what follows: +# --> STMT "B M C" entry if only N-Table is changed, format S. +# --> STMT "B M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 31, 1, COUNT(*) FROM tt_1 UNION SELECT 23, 1, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 32, 1, COUNT(*) FROM nt_1 UNION SELECT 24, 1, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (33, 1), (26, 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (34, 1, ''), (30, 2, fc_i_tt_5_suc (34, 1)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (35, 1), (29, 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (36, 1, ''), (30, 1, fc_i_nt_5_suc (36, 1)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#4) Generates in the binlog what follows: +# --> STMT "B T T C" entries, format S. +# --> ROW "B T T C" entries, format R. +# --> MIXED "B T T C" entries, format S +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_1 VALUES ("new text 5", 5, "new text 5"); -INSERT INTO tt_2 VALUES ("new text 5", 5, "new text 5"); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (37, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (38, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (38, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (39, 4); +fc_i_tt_5_suc (39, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (39, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(39,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (40, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (40, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',40), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (41, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (41, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (42, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (43, 4); +fc_i_tt_5_suc (43, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(43,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (43, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(43,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (44, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (44, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',44), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (45, 2); +fc_i_tt_5_suc (45, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(45,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (45, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (46, 2); +fc_i_tt_5_suc (46, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(46,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(46,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (46, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (47, 2); +fc_i_tt_5_suc (47, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (47, 4); +fc_i_tt_5_suc (47, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(47,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (48, 2); +fc_i_tt_5_suc (48, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (48, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(48,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(48,2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',48), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (49, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',49), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (49, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (50, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',50), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (50, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (51, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (51, 4); +fc_i_tt_5_suc (51, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(51,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',51), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(51,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (52, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (52, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',52), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#4.e) Generates in the binlog what follows: +# --> STMT "B T C" entries, format S. +# --> ROW "B T C" entries, format R. +# --> MIXED "B T C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (53, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T eT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 4), (54, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (54, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (55, 4), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (55, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (56, 4, ''), (56, 2, fc_i_tt_5_suc (56, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (56, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (57, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B eT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 2), (57, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (58, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (59, 2), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (59, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (60, 2, ''), (59, 4, fc_i_tt_5_suc (60, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#5) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (61, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (61, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T R << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#2.e) "B T T R" with error in T generates in binlog an "empty" entry. -# -INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7"); +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_1 VALUES ("new text -6", -6, "new text -6"), ("new text -7", -7, "new text -7"); -ERROR 23000: Duplicate entry '-7' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text -8", -8, "new text -8"); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (62, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (62, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_2 VALUES ("new text -10", -10, "new text -10"); -INSERT INTO tt_2 VALUES ("new text -9", -9, "new text -9"), ("new text -10", -10, "new text -10"); -ERROR 23000: Duplicate entry '-10' for key 'PRIMARY' +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (63, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (63, 4); +fc_i_tt_5_suc (63, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; -show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (64, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (64, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (65, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (65, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (66, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (66, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (67, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (67, 4); +fc_i_tt_5_suc (67, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (68, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (68, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (69, 2); +fc_i_tt_5_suc (69, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (69, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (70, 2); +fc_i_tt_5_suc (70, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (70, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (71, 2); +fc_i_tt_5_suc (71, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (71, 4); +fc_i_tt_5_suc (71, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (72, 2); +fc_i_tt_5_suc (72, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (72, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (73, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (73, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (74, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (74, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (75, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (75, 4); +fc_i_tt_5_suc (75, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (76, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (76, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#5.e) Generates in the binlog what follows: +# --> STMT empty. +# --> ROW empty. +# --> MIXED empty. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (77, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (77, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T eT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (78, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (78, 4), (78, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (79, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (79, 4), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (80, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (80, 4, ''), (80, 2, fc_i_tt_5_suc (80, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Te-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T Te-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (60, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (81, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B eT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (82, 2), (60, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (82, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (83, 2), (52, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (83, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) VALUES (84, 2, ''), (60, 4, fc_i_tt_5_suc (84, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (84, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B Te-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#6) Generates in the binlog what follows: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -7", -7, "new text -7") -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#3) "B T N C" generates in binlog the "B T N C" entries. -# -BEGIN; -INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6"); -INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6"); -COMMIT; -show binlog events from ; +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 6", 6, "new text 6") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 6", 6, "new text 6") -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#3.e) "B T N C" with error in either T or N generates in binlog the "B T N C" entries. -# -INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12"); -BEGIN; -INSERT INTO tt_1 VALUES ("new text -11", -11, "new text -11"), ("new text -12", -12, "new text -12"); -ERROR 23000: Duplicate entry '-12' for key 'PRIMARY' -INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13"); +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; -BEGIN; -INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14"); -INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16"); -INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16"); -ERROR 23000: Duplicate entry '-16' for key 'PRIMARY' -COMMIT; -show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -12", -12, "new text -12") -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -13", -13, "new text -13") +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 2) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -14", -14, "new text -14") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -16", -16, "new text -16") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -15", -15, "new text -15"), ("new text -16", -16, "new text -16") -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (85, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N C << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#4) "B T N R" generates in binlog the "B T N R" entries. -# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7"); -INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7"); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (86, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (86, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (87, 4); +fc_i_nt_5_suc (87, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(87,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (87, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(87,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (88, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (88, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',88), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (89, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (89, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (90, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (91, 4); +fc_i_nt_5_suc (91, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(91,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (91, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(91,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (92, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (92, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',92), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (93, 2); +fc_i_nt_5_suc (93, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(93,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(93,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (93, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (94, 2); +fc_i_nt_5_suc (94, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(94,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(94,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (94, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (95, 2); +fc_i_nt_5_suc (95, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (95, 4); +fc_i_nt_5_suc (95, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(95,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (96, 2); +fc_i_nt_5_suc (96, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(96,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (96, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(96,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',96), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (97, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',97), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (97, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (98, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',98), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (98, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (99, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (99, 4); +fc_i_nt_5_suc (99, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(99,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',99), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(99,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (100, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (100, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',100), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#6.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N eN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (101, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N eN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (102, 4), (102, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (103, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (103, 4), (100, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (104, 4, ''), (104, 2, fc_i_nt_5_suc (104, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (104, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (105, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 2), (105, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (106, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (107, 2), (104, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (107, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (108, 2, ''), (107, 4, fc_i_nt_5_suc (108, 2)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (108, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#7) Generates in the binlog what follows: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 7", 7, "new text 7") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 7", 7, "new text 7") -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (109, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N R << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#4.e) "B T N R" with error in either T or N generates in binlog the "B T N R" entries. -# -INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17"); +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_1 VALUES ("new text -16", -16, "new text -16"), ("new text -17", -17, "new text -17"); -ERROR 23000: Duplicate entry '-17' for key 'PRIMARY' -INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18"); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (110, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (110, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19"); -INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21"); -INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21"); -ERROR 23000: Duplicate entry '-21' for key 'PRIMARY' +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (111, 4); +fc_i_nt_5_suc (111, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(111,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-func R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -17", -17, "new text -17") -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -18", -18, "new text -18") +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (111, 2) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -19", -19, "new text -19") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -21", -21, "new text -21") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -20", -20, "new text -20"), ("new text -21", -21, "new text -21") -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(111,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-func R << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#5) "T" generates in binlog the "B T C" entry. -# -INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8"); -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 8", 8, "new text 8") -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#5.e) "T" with error in T generates in binlog an "empty" entry. -# -INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"); -INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1"), ("new text -22", -22, "new text -22"); -ERROR 23000: Duplicate entry '-1' for key 'PRIMARY' -INSERT INTO tt_1 VALUES ("new text -23", -23, "new text -23"), ("new text -1", -1, "new text -1"); -ERROR 23000: Duplicate entry '-1' for key 'PRIMARY' -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -1", -1, "new text -1") -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#6) "N" generates in binlog the "N" entry. -# -INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9"); -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 9", 9, "new text 9") - - - - -# -#6.e) "N" with error in N generates in binlog an empty entry if the error -# happens in the first tuple. Otherwise, generates the "N" entry and -# the error is appended. -# -INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1"); -INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1"); -ERROR 23000: Duplicate entry '-1' for key 'PRIMARY' -INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1"); -ERROR 23000: Duplicate entry '-1' for key 'PRIMARY' -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -1", -1, "new text -1") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -24", -24, "new text -24"), ("new text -1", -1, "new text -1") - - - - -# -#7) "M" generates in binglog the "B M C" entries. -# -DELETE FROM nt_1; -INSERT INTO nt_1 SELECT * FROM tt_1; -DELETE FROM tt_1; -INSERT INTO tt_1 SELECT * FROM nt_1; -INSERT INTO tt_3 VALUES ("new text 000", 000, ''); -INSERT INTO tt_3 VALUES("new text 100", 100, f1()); -INSERT INTO nt_4 VALUES("new text 100", 100, f1()); -INSERT INTO tt_3 VALUES("new text 200", 200, f2()); -INSERT INTO nt_4 VALUES ("new text 300", 300, ''); -INSERT INTO nt_4 VALUES ("new text 400", 400, f1()); -INSERT INTO nt_4 VALUES ("new text 500", 500, f2()); -CALL pc_i_tt_3(600, "Testing..."); -UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DELETE FROM nt_1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 SELECT * FROM tt_1 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DELETE FROM tt_1 -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 SELECT * FROM nt_1 -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ("new text 000", 000, '') -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES("new text 100", 100, f1()) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES("new text 100", 100, f1()) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES("new text 200", 200, f2()) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text 300", 300, '') -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text 400", 400, f1()) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text 500", 500, f2()) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ( NAME_CONST('y',_latin1'Testing...' COLLATE 'latin1_swedish_ci'), NAME_CONST('x',600), NAME_CONST('x',600)) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 1", nt_4.a= "new text 1", tt_3.a= "new text 1", tt_4.a= "new text 1" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 2", tt_4.a= "new text 2", nt_3.a= "new text 2", nt_4.a = "new text 2" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 3", nt_3.a= "new text 3", nt_4.a= "new text 3", tt_4.a = "new text 3" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 4", nt_3.a= "new text 4", nt_4.a= "new text 4", tt_4.a = "new text 4" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#7.e) "M" with error in M generates in binglog the "B M R" entries. -# -INSERT INTO nt_3 VALUES ("new text -26", -26, ''); -SELECT * FROM tt_3; -a b c -new text 000 0 -new text 4 100 Testing... -new text 200 200 Testing... -Testing... 600 600 -INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, ''); -ERROR 23000: Duplicate entry '-26' for key 'PRIMARY' -SELECT * FROM tt_3; -a b c -new text 000 0 -new text 4 100 Testing... -new text 200 200 Testing... -Testing... 600 600 -INSERT INTO tt_4 VALUES ("new text -26", -26, ''); -SELECT * FROM nt_4; -a b c -new text 4 100 Testing... -new text 300 300 -new text 400 400 Testing... -new text 500 500 Testing... -INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, ''); -ERROR 23000: Duplicate entry '-26' for key 'PRIMARY' -SELECT * FROM nt_4; -a b c -new text 4 100 Testing... -new text 300 300 -new text 400 400 Testing... -new text 500 500 Testing... -new text -25 -25 -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_3 VALUES ("new text -26", -26, '') -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ("new text -25", -25, ''), ("new text -26", -26, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_4 VALUES ("new text -26", -26, '') -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text -25", -25, ''), ("new text -26", -26, '') -master-bin.000001 # Query # # ROLLBACK - - - - -# -#8) "B N N T C" generates in binglog the "N N B T C" entries. -# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10"); -INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10"); -INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10"); -COMMIT; -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 10", 10, "new text 10") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text 10", 10, "new text 10") +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2); +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 10", 10, "new text 10") -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#8.e) "B N N T R" See 6.e and 9.e. -# - - - - -# -#9) "B N N T R" generates in binlog the "N N B T R" entries. -# -BEGIN; -INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11"); -INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11"); -INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11"); +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (112, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 11", 11, "new text 11") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text 11", 11, "new text 11") +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 11", 11, "new text 11") -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (112, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',112), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N N-proc R << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#9.e) "B N N T R" with error in N generates in binlog the "N N B T R" entries. -# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25"); -INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25"); -INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25"); -ERROR 23000: Duplicate entry '-25' for key 'PRIMARY' -INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27"); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text -25", -25, "new text -25") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text -25", -25, "new text -25") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text -26", -26, "new text -26"), ("new text -25", -25, "new text -25") +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -27", -27, "new text -27") -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (113, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (113, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N R << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#10) "B N N C" generates in binglog the "N N" entries. -# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12"); -INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12"); -COMMIT; -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 12", 12, "new text 12") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text 12", 12, "new text 12") - - - - -# -#10.e) "B N N C" See 6.e and 9.e. -# - - - - -# -#11) "B N N R" generates in binlog the "N N" entries. -# -BEGIN; -INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13"); -INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13"); +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 13", 13, "new text 13") -master-bin.000001 # Query # # use `test`; INSERT INTO nt_2 VALUES ("new text 13", 13, "new text 13") - - - - -# -#11.e) "B N N R" See 6.e and 9.e. -# - - - - -# -#12) "B M T C" generates in the binlog the "B M T C" entries. -# -DELETE FROM nt_1; -BEGIN; -INSERT INTO nt_1 SELECT * FROM tt_1; -INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14"); -COMMIT; -DELETE FROM tt_1; -BEGIN; -INSERT INTO tt_1 SELECT * FROM nt_1; -INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15"); -COMMIT; -BEGIN; -INSERT INTO tt_3 VALUES ("new text 700", 700, ''); -INSERT INTO tt_1 VALUES ("new text 800", 800, ''); -COMMIT; -BEGIN; -INSERT INTO tt_3 VALUES("new text 900", 900, f1()); -INSERT INTO tt_1 VALUES ("new text 1000", 1000, ''); -COMMIT; -BEGIN; -INSERT INTO tt_3 VALUES(1100, 1100, f2()); -INSERT INTO tt_1 VALUES ("new text 1200", 1200, ''); -COMMIT; -BEGIN; -INSERT INTO nt_4 VALUES ("new text 1300", 1300, ''); -INSERT INTO tt_1 VALUES ("new text 1400", 1400, ''); -COMMIT; -BEGIN; -INSERT INTO nt_4 VALUES("new text 1500", 1500, f1()); -INSERT INTO tt_1 VALUES ("new text 1600", 1600, ''); -COMMIT; -BEGIN; -INSERT INTO nt_4 VALUES("new text 1700", 1700, f2()); -INSERT INTO tt_1 VALUES ("new text 1800", 1800, ''); -COMMIT; -BEGIN; -CALL pc_i_tt_3(1900, "Testing..."); -INSERT INTO tt_1 VALUES ("new text 2000", 2000, ''); -COMMIT; -BEGIN; -UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2100", 2100, ''); -COMMIT; -BEGIN; -UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2200", 2200, ''); -COMMIT; -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2300", 2300, ''); -COMMIT; -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 2400", 2400, ''); -COMMIT; -show binlog events from ; +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DELETE FROM nt_1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 SELECT * FROM tt_1 master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 14", 14, "new text 14") -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 2) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DELETE FROM tt_1 -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (114, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2); +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 SELECT * FROM nt_1 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 15", 15, "new text 15") -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (115, 4); +fc_i_nt_5_suc (115, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ("new text 700", 700, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 800", 800, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(115,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES("new text 900", 900, f1()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 1000", 1000, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (115, 2) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES(1100, 1100, f2()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 1200", 1200, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(115,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2); +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text 1300", 1300, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 1400", 1400, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (116, 4); +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES("new text 1500", 1500, f1()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 1600", 1600, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES("new text 1700", 1700, f2()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 1800", 1800, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ( NAME_CONST('y',_latin1'Testing...' COLLATE 'latin1_swedish_ci'), NAME_CONST('x',1900), NAME_CONST('x',1900)) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2000", 2000, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (116, 2) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 5", nt_4.a= "new text 5", tt_3.a= "new text 5", tt_4.a= "new text 5" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2100", 2100, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 6", tt_4.a= "new text 6", nt_3.a= "new text 6", nt_4.a = "new text 6" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2200", 2200, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',116), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (117, 2); +fc_i_nt_5_suc (117, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 7", nt_3.a= "new text 7", nt_4.a= "new text 7", tt_4.a = "new text 7" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2300", 2300, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(117,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4); +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 8", nt_3.a= "new text 8", nt_4.a= "new text 8", tt_4.a = "new text 8" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2400", 2400, '') -master-bin.000001 # Xid # # COMMIT /* XID */ +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(117,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (117, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (118, 2); +fc_i_nt_5_suc (118, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(118,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(118,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (118, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (119, 2); +fc_i_nt_5_suc (119, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (119, 4); +fc_i_nt_5_suc (119, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(119,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (120, 2); +fc_i_nt_5_suc (120, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(120,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (120, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(120,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',120), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (121, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',121), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (121, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (122, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',122), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (122, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (123, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (123, 4); +fc_i_nt_5_suc (123, 4) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(123,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',123), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(123,4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (124, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (124, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',124), NAME_CONST('in_stmt_id',4) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + # -#12.e) "B M T C" with error in M generates in the binlog the "B M T C" entries. +#7.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B N C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N eN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (125, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N eN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (126, 4), (126, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (127, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (127, 4), (124, 5) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N Ne-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (128, 4, ''), (128, 2, fc_i_nt_5_suc (128, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N Ne-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (128, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (129, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 2), (129, 4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (130, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (131, 2), (128, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (131, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> Ne-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Ne-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) VALUES (132, 2, ''), (131, 4, fc_i_nt_5_suc (132, 2)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (132, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Ne-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#8) Generates in the binlog what follows: +# --> STMT "B T N C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format R in N and S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (133, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (133, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (134, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (134, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (135, 4); +fc_i_nt_5_suc (135, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (135, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(135,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (136, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',136), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (137, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (137, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (138, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (138, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (139, 4); +fc_i_nt_5_suc (139, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (139, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(139,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (140, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (140, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',140), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (141, 2); +fc_i_tt_5_suc (141, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(141,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (141, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (142, 2); +fc_i_tt_5_suc (142, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(142,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (142, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (143, 2); +fc_i_tt_5_suc (143, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (143, 4); +fc_i_nt_5_suc (143, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(143,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(143,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (144, 2); +fc_i_tt_5_suc (144, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (144, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(144,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',144), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (145, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',145), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (145, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (146, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',146), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (146, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (147, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (147, 4); +fc_i_nt_5_suc (147, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',147), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(147,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (148, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (148, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',148), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#8.e) Generates in the binlog what follows if T-* fails: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# Otherwise, what follows if N-* fails and a N-Table is changed: +# --> STMT "B T N C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format R in N and S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (136, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (149, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (150, 2), (136, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Te N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (150, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (151, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T eN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Ne C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (152, 4), (150, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T Ne C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#9) Generates in the binlog what follows: +# --> STMT "B T N R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (153, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (153, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (154, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (154, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (155, 4); +fc_i_nt_5_suc (155, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (155, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(155,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (156, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (156, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',156), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (157, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (157, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (158, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (158, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (159, 4); +fc_i_nt_5_suc (159, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (159, 2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(159,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (160, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-trig N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (160, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',160), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-trig N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (161, 2); +fc_i_tt_5_suc (161, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(161,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(161,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (161, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (162, 2); +fc_i_tt_5_suc (162, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(162,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(162,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (162, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (163, 2); +fc_i_tt_5_suc (163, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (163, 4); +fc_i_nt_5_suc (163, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(163,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(163,2) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(163,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (164, 2); +fc_i_tt_5_suc (164, 2) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (164, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(164,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-func N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(164,2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',164), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-func N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (165, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',165), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (165, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (166, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',166), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (166, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (167, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (167, 4); +fc_i_nt_5_suc (167, 4) +fc_i_nt_5_suc +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',167), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(167,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (168, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (168, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T-proc N-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',168), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T-proc N-proc R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#9.e) Generates in the binlog what follows if T* fails: +# --> STMT "B N C" entry, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# Otherwise, what follows if N* fails and a N-Table is changed: +# --> STMT "B T N R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (152, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B eT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (169, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B eT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Te << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (170, 2), (152, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Te << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B Te N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B Te N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (171, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> eN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (170, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> eN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T eN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T eN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> Ne << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> Ne << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T Ne R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (172, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (172, 4), (170, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T Ne R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#10) Generates in the binlog: +# --> STMT "B N C B T C" entries, format S. +# --> ROW "B N C B T C" entries, format R. +# --> MIXED "B N C B T C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (173, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (173, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (174, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (174, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (175, 4); +fc_i_tt_5_suc (175, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(175,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (175, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(175,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (176, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (176, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',176), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (177, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (177, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (178, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (178, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (179, 4); +fc_i_tt_5_suc (179, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(179,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (179, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(179,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (180, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (180, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',180), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (181, 2); +fc_i_nt_5_suc (181, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(181,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(181,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (181, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (182, 2); +fc_i_nt_5_suc (182, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(182,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(182,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (182, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (183, 2); +fc_i_nt_5_suc (183, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(183,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (183, 4); +fc_i_tt_5_suc (183, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(183,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(183,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(183,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (184, 2); +fc_i_nt_5_suc (184, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(184,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (184, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(184,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',184), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (185, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',185), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (185, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (186, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',186), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (186, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (187, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (187, 4); +fc_i_tt_5_suc (187, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(187,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',187), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(187,4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (188, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (188, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',188), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#11) Generates in the binlog what follows: +# --> STMT "B N C" entries, format S. +# --> ROW "B N C" entries, format R. +# --> MIXED "B N C" entries, format S. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (189, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (189, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (189, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (189, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (190, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',190), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',190), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (190, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',190), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',190), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (191, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (191, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (191, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (191, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (192, 4); +fc_i_tt_5_suc (192, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(192,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (192, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(192,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (193, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (193, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (193, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (193, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (194, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (194, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (194, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (194, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (195, 4); +fc_i_tt_5_suc (195, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(195,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (195, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(195,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (196, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',196), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',196), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-trig T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES (196, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',196), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',196), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-trig T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (197, 2); +fc_i_nt_5_suc (197, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(197,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (197, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (197, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(197,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (197, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (198, 2); +fc_i_nt_5_suc (198, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(198,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (198, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (198, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(198,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (198, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (199, 2); +fc_i_nt_5_suc (199, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(199,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (199, 4); +fc_i_tt_5_suc (199, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(199,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(199,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(199,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_nt_5_suc (200, 2); +fc_i_nt_5_suc (200, 2) +fc_i_nt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(200,2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (200, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',200), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',200), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-func T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_nt_5_suc`(200,2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',200), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',200), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-func T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (201, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (201, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (201, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',201), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (201, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (202, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_tt_5_suc (202, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-proc R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',202), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-proc R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (203, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id) VALUES (203, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (203, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',203), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id) VALUES (203, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N-proc << -b-b-b-b-b-b-b-b-b-b-b- +CALL pc_i_nt_5_suc (204, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N-proc << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T-func << -b-b-b-b-b-b-b-b-b-b-b- +SELECT fc_i_tt_5_suc (204, 4); +fc_i_tt_5_suc (204, 4) +fc_i_tt_5_suc +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(204,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N-proc T-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1)) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id) VALUES ( NAME_CONST('p_trans_id',204), NAME_CONST('in_stmt_id',1) + 1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; SELECT `test`.`fc_i_tt_5_suc`(204,4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N-proc T-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#12) Generates in the binlog what follows: +# --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +# --> STMT "B M T C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 205, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (205, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B tN T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 206, 2, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (206, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 207 --> 2", tt_3.info= "new text 207 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (207, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (208, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (208, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (209, 2, fc_i_tt_5_suc(209, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (209, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 210 --> 2", nt_4.info= "new text 210 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (210, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (211, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (211, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (212, 2, fc_i_nt_5_suc(212, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (212, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#12.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B T C" entries if in M only N-Table is changed, format S. +# --> STMT "B M T C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. # -# There is a bug in the slave that needs to be fixed before enabling -# this part of the test. A bug report will be filed referencing this -# test case. +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO nt_3 VALUES ("new text -28", -28, ''); -INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, ''); -ERROR 23000: Duplicate entry '-28' for key 'PRIMARY' -INSERT INTO tt_1 VALUES ("new text -27", -27, ''); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 213, 2, COUNT(*) FROM tt_1 UNION SELECT 205, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (213, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO tt_4 VALUES ("new text -28", -28, ''); -INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, ''); -ERROR 23000: Duplicate entry '-28' for key 'PRIMARY' -INSERT INTO tt_1 VALUES ("new text -28", -28, ''); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 214, 2, COUNT(*) FROM nt_1 UNION SELECT 213, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- COMMIT; -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_3 VALUES ("new text -28", -28, '') master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ("new text -27", -27, ''), ("new text -28", -28, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -27", -27, '') +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_4 VALUES ("new text -28", -28, '') -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text -27", -27, ''), ("new text -28", -28, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -28", -28, '') -master-bin.000001 # Xid # # COMMIT /* XID */ - - - - -# -#13) "B M T R" generates in the binlog the "B M T R" entries -# -DELETE FROM nt_1; -BEGIN; -INSERT INTO nt_1 SELECT * FROM tt_1; -INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17"); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -DELETE FROM tt_1; -BEGIN; -INSERT INTO tt_1 SELECT * FROM nt_1; -INSERT INTO tt_2 VALUES ("new text 18", 18, "new text 18"); -ROLLBACK; -INSERT INTO tt_1 SELECT * FROM nt_1; -BEGIN; -INSERT INTO tt_3 VALUES ("new text 2500", 2500, ''); -INSERT INTO tt_1 VALUES ("new text 2600", 2600, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO tt_3 VALUES("new text 2700", 2700, f1()); -INSERT INTO tt_1 VALUES ("new text 2800", 2800, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO tt_3 VALUES(2900, 2900, f2()); -INSERT INTO tt_1 VALUES ("new text 3000", 3000, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO nt_4 VALUES ("new text 3100", 3100, ''); -INSERT INTO tt_1 VALUES ("new text 3200", 3200, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO nt_4 VALUES("new text 3300", 3300, f1()); -INSERT INTO tt_1 VALUES ("new text 3400", 3400, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO nt_4 VALUES("new text 3500", 3500, f2()); -INSERT INTO tt_1 VALUES ("new text 3600", 3600, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -CALL pc_i_tt_3(3700, "Testing..."); -INSERT INTO tt_1 VALUES ("new text 3700", 3700, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 3800", 3800, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 3900", 3900, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 4000", 4000, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100; -INSERT INTO tt_1 VALUES ("new text 4100", 4100, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe T C << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DELETE FROM nt_1 -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 SELECT * FROM tt_1 master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 17", 17, "new text 17") -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; DELETE FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (214, 4) master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 SELECT * FROM nt_1 -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ("new text 2500", 2500, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2600", 2600, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES("new text 2700", 2700, f1()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 2800", 2800, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES(2900, 2900, f2()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3000", 3000, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text 3100", 3100, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3200", 3200, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES("new text 3300", 3300, f1()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3400", 3400, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES("new text 3500", 3500, f2()) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3600", 3600, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ( NAME_CONST('y',_latin1'Testing...' COLLATE 'latin1_swedish_ci'), NAME_CONST('x',3700), NAME_CONST('x',3700)) -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3700", 3700, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE nt_3, nt_4, tt_3, tt_4 SET nt_3.a= "new text 9", nt_4.a= "new text 9", tt_3.a= "new text 9", tt_4.a= "new text 9" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3800", 3800, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, tt_4, nt_3, nt_4 SET tt_3.a= "new text 10", tt_4.a= "new text 10", nt_3.a= "new text 10", nt_4.a = "new text 10" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 3900", 3900, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 11", nt_3.a= "new text 11", nt_4.a= "new text 11", tt_4.a = "new text 11" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 4000", 4000, '') -master-bin.000001 # Query # # ROLLBACK -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; UPDATE tt_3, nt_3, nt_4, tt_4 SET tt_3.a= "new text 12", nt_3.a= "new text 12", nt_4.a= "new text 12", tt_4.a = "new text 12" where nt_3.b = nt_4.b and nt_4.b = tt_3.b and tt_3.b = tt_4.b and tt_4.b = 100 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text 4100", 4100, '') -master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe T C << -e-e-e-e-e-e-e-e-e-e-e- - - - -# -#13.e) "B M T R" with error in M generates in the binlog the "B M T R" entries. -# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; -INSERT INTO nt_3 VALUES ("new text -30", -30, ''); -INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, ''); -ERROR 23000: Duplicate entry '-30' for key 'PRIMARY' -INSERT INTO tt_1 VALUES ("new text -30", -30, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -BEGIN; -INSERT INTO tt_4 VALUES ("new text -30", -30, ''); -INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, ''); -ERROR 23000: Duplicate entry '-30' for key 'PRIMARY' -INSERT INTO tt_1 VALUES ("new text -31", -31, ''); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; INSERT INTO nt_3 VALUES ("new text -30", -30, '') +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (215, 2), (208, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_3 VALUES ("new text -29", -29, ''), ("new text -30", -30, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -30", -30, '') -master-bin.000001 # Query # # ROLLBACK +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (215, 2), (208, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_4 VALUES ("new text -30", -30, '') -master-bin.000001 # Query # # use `test`; INSERT INTO nt_4 VALUES ("new text -29", -29, ''), ("new text -30", -30, '') -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1 VALUES ("new text -31", -31, '') +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (215, 2), (208, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (215, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (216, 2, ''), (212, 2, fc_i_tt_5_suc (216, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (216, 2, ''), (212, 2, fc_i_tt_5_suc (216, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (216, 2, ''), (212, 2, fc_i_tt_5_suc (216, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (216, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (217, 2), (211, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (217, 2), (211, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (217, 2), (211, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (217, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (218, 2, ''), (212, 2, fc_i_nt_5_suc (218, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (218, 2, ''), (212, 2, fc_i_nt_5_suc (218, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (218, 2, ''), (212, 2, fc_i_nt_5_suc (218, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (218, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func T C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#13) "B M T R" generates in the binlog: +# --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +# --> STMT "B M T R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (219, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (219, 4) master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 219, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (219, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B tN T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 220, 2, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (220, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B nT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (221, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (221, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 221 --> 2", tt_3.info= "new text 221 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (221, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (222, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (222, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (222, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (222, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (223, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (223, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (223, 2, fc_i_tt_5_suc(223, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (223, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (224, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (224, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 224 --> 2", nt_4.info= "new text 224 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (224, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TN T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (225, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (225, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (225, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (225, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (226, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (226, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (226, 2, fc_i_nt_5_suc(226, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (226, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#13.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B T R" entries if in M only N-Table is changed, format S. +# --> STMT "B M T R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (227, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (227, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 227, 2, COUNT(*) FROM tt_1 UNION SELECT 219, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (227, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 228, 2, COUNT(*) FROM nt_1 UNION SELECT 218, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (228, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (229, 2), (222, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (229, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (229, 2), (222, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (229, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (229, 2), (222, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (229, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (230, 2, ''), (226, 2, fc_i_tt_5_suc (230, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (230, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (230, 2, ''), (226, 2, fc_i_tt_5_suc (230, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (230, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (230, 2, ''), (226, 2, fc_i_tt_5_suc (230, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (230, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (231, 2), (211, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (231, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (231, 2), (211, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (231, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (231, 2), (211, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (231, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (232, 2, ''), (212, 2, fc_i_nt_5_suc (232, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (232, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (232, 2, ''), (212, 2, fc_i_nt_5_suc (232, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (232, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (232, 2, ''), (212, 2, fc_i_nt_5_suc (232, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (232, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func T R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#14) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M C" entries, format S. +# --> ROW "B N C B T T C" entries, format R. +# --> MIXED "B N C B T T C" entries, format R in N/T and format S in T. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (233, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T tN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (234, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 234, 4, COUNT(*) FROM nt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T nT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2) +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (235, 2) +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 235 --> 4", tt_3.info= "new text 235 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (236, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (236, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (237, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (237, 4, fc_i_tt_5_suc(237, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2) +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (238, 2) +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 238 --> 4", nt_4.info= "new text 238 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (239, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (239, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (240, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (240, 4, fc_i_nt_5_suc(240, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#14.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M C" entries, format S. +# --> ROW "B N C B T C" entry, format R. +# --> MIXED "B N C B T C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tNe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (241, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 241, 4, COUNT(*) FROM tt_1 UNION SELECT 233, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T tNe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 242, 4, COUNT(*) FROM nt_1 UNION SELECT 242, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nTe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (242, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T nTe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (243, 4), (236, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (243, 4), (236, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (243, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (243, 4), (236, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (244, 4, ''), (240, 2, fc_i_tt_5_suc (244, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (244, 4, ''), (240, 2, fc_i_tt_5_suc (244, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (244, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (244, 4, ''), (240, 2, fc_i_tt_5_suc (244, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (245, 4), (239, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (245, 4), (239, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (245, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (245, 4), (239, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (246, 4, ''), (240, 4, fc_i_nt_5_suc (246, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (246, 4, ''), (240, 4, fc_i_nt_5_suc (246, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (246, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (246, 4, ''), (240, 4, fc_i_nt_5_suc (246, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#15) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (247, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T tN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (248, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 248, 4, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T nT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (249, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (249, 2) +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (249, 2) +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 249 --> 4", tt_3.info= "new text 249 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (250, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (250, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (250, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (250, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (251, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (251, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (251, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (251, 4, fc_i_tt_5_suc(251, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T NT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (252, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (252, 2) +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (252, 2) +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 252 --> 4", nt_4.info= "new text 252 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (253, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (253, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (253, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (253, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (254, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (254, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (254, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (254, 4, fc_i_nt_5_suc(254, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T TN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#15.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B T M R" entries, format S. +# --> ROW "B N C" entry, format R. +# --> MIXED "B N C" entry, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T tNe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (255, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 255, 4, COUNT(*) FROM tt_1 UNION SELECT 247, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T tNe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (256, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 256, 4, COUNT(*) FROM nt_1 UNION SELECT 256, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T nTe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B T nTe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (257, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (257, 4), (250, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (257, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (257, 4), (250, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (257, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (257, 4), (250, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (258, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (258, 4, ''), (254, 2, fc_i_tt_5_suc (258, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (258, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (258, 4, ''), (254, 2, fc_i_tt_5_suc (258, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T NeT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (258, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (258, 4, ''), (254, 2, fc_i_tt_5_suc (258, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T NeT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (259, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (259, 4), (239, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (259, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (259, 4), (239, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (259, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (259, 4), (239, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (260, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (260, 4, ''), (240, 4, fc_i_nt_5_suc (260, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (260, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (260, 4, ''), (240, 4, fc_i_nt_5_suc (260, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T TeN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (260, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (260, 4, ''), (240, 4, fc_i_nt_5_suc (260, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T TeN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#16) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 261, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (261, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 262, 2, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (262, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B nT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 263 --> 2", tt_3.info= "new text 263 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (263, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (264, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (264, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (265, 2, fc_i_tt_5_suc(265, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (265, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 266 --> 2", nt_4.info= "new text 266 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (266, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (267, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (267, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (268, 2, fc_i_nt_5_suc(268, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (268, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#16.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C B T C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 269, 2, COUNT(*) FROM tt_1 UNION SELECT 268, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (269, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 270, 2, COUNT(*) FROM nt_1 UNION SELECT 262, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (270, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (271, 2), (264, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (271, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (272, 2, ''), (268, 2, fc_i_tt_5_suc (272, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (272, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (273, 2), (267, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (273, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (274, 2, ''), (268, 2, fc_i_nt_5_suc (274, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (274, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#17) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 275, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (275, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 276, 2, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (276, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B nT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 277 --> 2", tt_3.info= "new text 277 --> 2" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (277, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NT N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (278, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (278, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NT-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (279, 2, fc_i_tt_5_suc(279, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (279, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NT-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 280 --> 2", nt_4.info= "new text 280 --> 2" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (280, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TN N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (281, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (281, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TN-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (282, 2, fc_i_nt_5_suc(282, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (282, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TN-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#17.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B M C B N C" entries if in M only N-Table is changed, format S. +# --> STMT "B M N R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B M C B N C" entries if in M only N-Table is changed, format S. +# --> MIXED "B N C B N C" entries, format R. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tNe N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 283, 2, COUNT(*) FROM tt_1 UNION SELECT 282, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (283, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B tNe N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 284, 2, COUNT(*) FROM nt_1 UNION SELECT 262, 2, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B nTe N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (284, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B nTe N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (285, 2), (278, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (285, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B NeT-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (286, 2, ''), (282, 2, fc_i_tt_5_suc (286, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (286, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B NeT-func N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-trig N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (287, 2), (267, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (287, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-trig N R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B TeN-func N R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (288, 2, ''), (268, 2, fc_i_nt_5_suc (288, 2)) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (288, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B TeN-func N R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#18) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M C" entries, format S. +# --> ROW "B N C B N C B T C" entries, format R. +# --> MIXED "B N C B N C B T C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (289, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 289, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (290, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 290, 4, COUNT(*) FROM nt_1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N nT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (291, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 291 --> 4", tt_3.info= "new text 291 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (292, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (292, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (293, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (293, 4, fc_i_tt_5_suc(293, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (294, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 294 --> 4", nt_4.info= "new text 294 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (295, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (295, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (296, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (296, 4, fc_i_nt_5_suc(296, 4)) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#18.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M C" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tNe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (297, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 297, 4, COUNT(*) FROM tt_1 UNION SELECT 297, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tNe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 298, 4, COUNT(*) FROM nt_1 UNION SELECT 290, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nTe C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (298, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nTe C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (299, 4), (292, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (299, 4), (292, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (299, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (299, 4), (292, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (300, 4, ''), (296, 2, fc_i_tt_5_suc (300, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (300, 4, ''), (296, 2, fc_i_tt_5_suc (300, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (300, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (300, 4, ''), (296, 2, fc_i_tt_5_suc (300, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-func C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (301, 4), (295, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (301, 4), (295, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-trig C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (301, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (301, 4), (295, 4) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-trig C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (302, 4, ''), (296, 4, fc_i_nt_5_suc (302, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (302, 4, ''), (296, 4, fc_i_nt_5_suc (302, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-func C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (302, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (302, 4, ''), (296, 4, fc_i_nt_5_suc (302, 4)) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-func C << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#19) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (303, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 303, 4, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nT << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (304, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 304, 4, COUNT(*) FROM nt_1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N nT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (305, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE nt_3, tt_3 SET nt_3.info= "new text 305 --> 4", tt_3.info= "new text 305 --> 4" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (306, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (306, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (307, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (307, 4, fc_i_tt_5_suc(307, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N NT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- +UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (308, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; UPDATE tt_4, nt_4 SET tt_4.info= "new text 308 --> 4", nt_4.info= "new text 308 --> 4" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (309, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (309, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (310, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (310, 4, fc_i_nt_5_suc(310, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N TN-func R << -e-e-e-e-e-e-e-e-e-e-e- + + + + + +# +#19.e) Generates in the binlog what follows if a N-Table is changed: +# --> STMT "B N C B M C" entries if in M only N-Table is changed, format S. +# --> STMT "B N C B M R" entries, format S. +# --> ROW "B N C B N C" entries, format R. +# --> MIXED "B N C B N C" entries, format S in first N and format R in the other. +# +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tNe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tNe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N tNe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (311, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 311, 4, COUNT(*) FROM tt_1 UNION SELECT 311, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N tNe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> nTe << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id, info) SELECT 312, 4, COUNT(*) FROM nt_1 UNION SELECT 290, 4, COUNT(*) FROM nt_1; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> nTe << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N nTe R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (312, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> B N nTe R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_4(trans_id, stmt_id) VALUES (313, 4), (306, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (313, 4), (306, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (313, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_4(trans_id, stmt_id) VALUES (313, 4), (306, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> NeT-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (314, 4, ''), (310, 2, fc_i_tt_5_suc (314, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> NeT-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (314, 4, ''), (310, 2, fc_i_tt_5_suc (314, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N NeT-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (314, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (314, 4, ''), (310, 2, fc_i_tt_5_suc (314, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N NeT-func R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-trig << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_3(trans_id, stmt_id) VALUES (315, 4), (295, 4); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-trig << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (315, 4), (295, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-trig R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (315, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_3(trans_id, stmt_id) VALUES (315, 4), (295, 4) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-trig R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> TeN-func << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (316, 4, ''), (296, 4, fc_i_nt_5_suc (316, 4)); +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> TeN-func << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (316, 4, ''), (296, 4, fc_i_nt_5_suc (316, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N TeN-func R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (316, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (316, 4, ''), (296, 4, fc_i_nt_5_suc (316, 4)) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N TeN-func R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 2 - SAVEPOINT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (317, 2) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N T S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (318, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 4) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (318, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B N T S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T N S1 T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (319, 4) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (319, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T N S1 T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 N T R1 C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (320, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (320, 7) +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 N T R1 C << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 3 - CREATE TABLE...SELECT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_321 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_321, nt_xx_321; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T CS-T->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T CS-T->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_322 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_322, nt_xx_322; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N CS-N->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N CS-N->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_323 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_323, nt_xx_323; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N CS-T->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N CS-T->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_324 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_324, nt_xx_324; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_325 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_325, nt_xx_325; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_326 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_326, nt_xx_326; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +-e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 4 - ROLLBACK TEMPORARY TABLE +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- +SAVEPOINT s1; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK TO s1; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> R1 << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2) +master-bin.000001 # Query # # use `test`; SAVEPOINT s1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2); +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2) +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5) +master-bin.000001 # Query # # ROLLBACK +-e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### ################################################################################### # CLEAN ################################################################################### -DROP TABLE tt_1; -DROP TABLE tt_2; -DROP TABLE tt_3; -DROP TABLE tt_4; -DROP TABLE nt_1; -DROP TABLE nt_2; -DROP TABLE nt_3; -DROP TABLE nt_4; -DROP PROCEDURE pc_i_tt_3; -DROP FUNCTION f1; -DROP FUNCTION f2; diff --git a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result index 625c686f383..0bd57d4b78a 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result +++ b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result @@ -24,9 +24,19 @@ Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # drop database if exists mysqltest master-bin.000001 # Query # # create database mysqltest master-bin.000001 # Query # # use `test`; create table mysqltest.t1 ( n int) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(1) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(3) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(4) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into mysqltest.t1 values(5) +master-bin.000001 # Query # # COMMIT drop database mysqltest; diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result similarity index 63% rename from mysql-test/suite/rpl/r/rpl_start_stop_slave.result rename to mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result index e2b1935c268..5897735c74e 100644 --- a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result +++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result @@ -4,6 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); create table t1(n int); stop slave; start slave; @@ -22,6 +24,8 @@ insert into t1i values (5); begin; insert into t1i values (4); insert into t2m values (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. insert into t1i values (5); commit; zero diff --git a/mysql-test/suite/rpl/r/rpl_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result similarity index 77% rename from mysql-test/suite/rpl/r/rpl_stop_middle_group.result rename to mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result index 0bf0384bf85..8d37686688a 100644 --- a/mysql-test/suite/rpl/r/rpl_stop_middle_group.result +++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result @@ -4,12 +4,15 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); create table tm (a int auto_increment primary key) engine=myisam; create table ti (a int auto_increment primary key) engine=innodb; set @@global.debug="+d,stop_slave_middle_group"; begin; insert into ti set a=null; insert into tm set a=null; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. commit; SELECT "NO" AS Last_SQL_Error, @check as `true`; Last_SQL_Error true @@ -29,6 +32,8 @@ set @@global.debug="+d,incomplete_group_in_relay_log"; begin; insert into ti set a=null; insert into tm set a=null; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. commit; SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true @@ -46,6 +51,8 @@ include/start_slave.inc set @@global.debug="+d,stop_slave_middle_group"; set @@global.debug="+d,incomplete_group_in_relay_log"; update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. SELECT "Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`; Last_SQL_Error true Fatal error: ... The slave SQL is stopped, leaving the current group of events unfinished with a non-transaction table changed. If the group consists solely of Row-based events, you can try restarting the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details). 1 diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result index 6af9be0da3b..a5d779778f6 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_until.result +++ b/mysql-test/suite/rpl/r/rpl_stm_until.result @@ -113,7 +113,7 @@ Last_SQL_Errno 0 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; +start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=891; select * from t2; n 1 @@ -144,7 +144,7 @@ Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition Relay Until_Log_File slave-relay-bin.000004 -Until_Log_Pos 746 +Until_Log_Pos 891 Master_SSL_Allowed No Master_SSL_CA_File Master_SSL_CA_Path diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result index 3a31a206b1e..3de1eb46a4c 100644 --- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result +++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result @@ -67,5 +67,7 @@ slave-bin.000001 # Table_map # # table_id: # (test.t1) slave-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `t2_tmp` /* generated by server */ +slave-bin.000001 # Query # # BEGIN slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (2) +slave-bin.000001 # Query # # COMMIT slave-bin.000001 # Query # # use `test`; DROP TABLE t3, t1 diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test index ec56e6a4f38..583268d0f65 100644 --- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test +++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test @@ -2,6 +2,12 @@ source include/master-slave.inc; source include/have_innodb.inc; source include/have_binlog_format_statement.inc; +connection slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + +connection master; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + disable_warnings; DROP DATABASE IF EXISTS db1; enable_warnings; diff --git a/mysql-test/suite/rpl/t/rpl_blackhole.test b/mysql-test/suite/rpl/t/rpl_blackhole.test index 6bf66422d62..17475e2b420 100644 --- a/mysql-test/suite/rpl/t/rpl_blackhole.test +++ b/mysql-test/suite/rpl/t/rpl_blackhole.test @@ -18,6 +18,8 @@ source include/master-slave.inc; source include/have_blackhole.inc; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + # We start with no primary key CREATE TABLE t1 (a INT, b INT, c INT); CREATE TABLE t2 (a INT, b INT, c INT); @@ -45,9 +47,23 @@ source extra/rpl_tests/rpl_blackhole.test; let $statement = INSERT INTO t1 SELECT * FROM t2; source extra/rpl_tests/rpl_blackhole.test; +# +# The MASTER has MyISAM as the engine for both tables. The SLAVE has Blackhole +# on t1 (transactional engine) and MyISAM on t2 (non-transactional engine). +# +# In MIXED mode, the command "INSERT INTO t2 SELECT * FROM t1" is logged as +# statement on the master. On the slave, it is tagged as unsafe because the +# statement mixes both transactional and non-transactional engines and as such +# its changes are logged as rows. However, due to the nature of the blackhole +# engine, no rows are returned and thus any chain replication would make the +# next master on the chain diverge. +# +# Fo this reason, we have disabled the statement. +# # Test INSERT-SELECT from Blackhole, no primary key -let $statement = INSERT INTO t2 SELECT * FROM t1; -source extra/rpl_tests/rpl_blackhole.test; +# let $statement = INSERT INTO t2 SELECT * FROM t1; +# source extra/rpl_tests/rpl_blackhole.test; +# connection master; ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b); diff --git a/mysql-test/suite/rpl/t/rpl_concurrency_error.test b/mysql-test/suite/rpl/t/rpl_concurrency_error.test index da2951afb1a..46a0adc560f 100644 --- a/mysql-test/suite/rpl/t/rpl_concurrency_error.test +++ b/mysql-test/suite/rpl/t/rpl_concurrency_error.test @@ -21,6 +21,8 @@ --source include/have_innodb.inc --source include/have_binlog_format_statement.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + --echo ######################################################################## --echo # Environment --echo ######################################################################## diff --git a/mysql-test/suite/rpl/t/rpl_insert_ignore.test b/mysql-test/suite/rpl/t/rpl_insert_ignore.test index 2709430f85d..733e359f7d7 100644 --- a/mysql-test/suite/rpl/t/rpl_insert_ignore.test +++ b/mysql-test/suite/rpl/t/rpl_insert_ignore.test @@ -4,6 +4,9 @@ -- source include/not_ndb_default.inc -- source include/have_innodb.inc -- source include/master-slave.inc + +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + let $engine_type=innodb; let $engine_type2=myisam; -- source extra/rpl_tests/rpl_insert_ignore.test diff --git a/mysql-test/suite/rpl/t/rpl_invoked_features.test b/mysql-test/suite/rpl/t/rpl_invoked_features.test index 4601846d7fc..076685a7c3a 100644 --- a/mysql-test/suite/rpl/t/rpl_invoked_features.test +++ b/mysql-test/suite/rpl/t/rpl_invoked_features.test @@ -170,25 +170,19 @@ INSERT INTO t1 VALUES (103,103,''); # Do some actions for transactional tables --echo +--disable_warnings CREATE TABLE t13 SELECT * FROM v11; INSERT INTO t11 VALUES (3,3,''); UPDATE t11 SET c='2' WHERE a = 1; ---disable_warnings INSERT INTO t11 VALUES(4,4,f1(4)); ---enable_warnings INSERT INTO t11 VALUES (100,100,''); ---disable_warnings CALL p11(5, UUID()); ---enable_warnings INSERT INTO t11 VALUES (101,101,''); ---disable_warnings INSERT INTO t11 VALUES(6,6,f1(6)); ---enable_warnings INSERT INTO t11 VALUES (102,102,''); ---disable_warnings INSERT INTO t11 VALUES(7,7,f2(7)); ---enable_warnings INSERT INTO t11 VALUES (103,103,''); +--enable_warnings # Scheduler is on --echo @@ -272,7 +266,9 @@ SELECT a,b FROM v11 ORDER BY a; UPDATE t1 SET c=''; UPDATE t2 SET c=''; UPDATE t3 SET c=''; +--disable_warnings UPDATE t11 SET c=''; +--enable_warnings UPDATE t12 SET c=''; UPDATE t13 SET c=''; diff --git a/mysql-test/suite/rpl/t/rpl_loaddata.test b/mysql-test/suite/rpl/t/rpl_loaddata.test index 6f9ee4ef80a..c47b84144ff 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata.test @@ -3,5 +3,7 @@ # Added to skip if ndb is default # ######################################################## -- source include/not_ndb_default.inc +-- source include/have_binlog_format_mixed_or_statement.inc + let $engine_type=MyISAM; -- source extra/rpl_tests/rpl_loaddata.test diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test index b7d9995c834..d1baaacb672 100644 --- a/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test +++ b/mysql-test/suite/rpl/t/rpl_loaddata_fatal.test @@ -8,7 +8,7 @@ connection master; CREATE TABLE t1 (a INT, b INT); INSERT INTO t1 VALUES (1,10); sync_slave_with_master; -source include/show_slave_status.inc; +source include/show_slave_status2.inc; # Now we feed it a load data infile, which should make it stop with a # fatal error. @@ -17,7 +17,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1; connection slave; wait_for_slave_to_stop; -source include/show_slave_status.inc; +source include/show_slave_status2.inc; connection slave; SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 5e8390f97ed..9c9fdecf2b5 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -22,7 +22,7 @@ source include/wait_for_slave_sql_to_start.inc; source include/wait_for_slave_io_to_stop.inc; source include/stop_slave.inc; -source include/show_slave_status.inc; +source include/show_slave_status2.inc; connection master; source include/show_master_status.inc; create table if not exists t1 (n int); diff --git a/mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt similarity index 100% rename from mysql-test/suite/rpl/t/rpl_binlog_max_cache_size-master.opt rename to mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size-master.opt diff --git a/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test new file mode 100644 index 00000000000..1d407f87dfa --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mixed_binlog_max_cache_size.test @@ -0,0 +1,7 @@ +--source include/have_innodb.inc +--source include/master-slave.inc +--source include/not_embedded.inc +--source include/not_windows.inc +--source include/have_binlog_format_mixed.inc + +--source extra/rpl_tests/rpl_binlog_max_cache_size.test diff --git a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test new file mode 100644 index 00000000000..c12427ba350 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test @@ -0,0 +1,9 @@ +################################################################################ +# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test +################################################################################ +--source include/have_binlog_format_mixed.inc +#Re-enable this after fixing BUG#46572 +#--source include/master-slave.inc +--source include/have_innodb.inc + +--source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test new file mode 100644 index 00000000000..8bb5b61210b --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mixed_mixing_engines.test @@ -0,0 +1,10 @@ +################################################################################### +# This test cases evaluates the mixture of non-transactional and transcational +# tables. For further details, please, read WL#2687 and WL#5072. +################################################################################### +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc +--source include/have_innodb.inc + +let $engine_type=Innodb; +--source extra/rpl_tests/rpl_mixing_engines.test diff --git a/mysql-test/suite/rpl/t/rpl_mixed_row_innodb.test b/mysql-test/suite/rpl/t/rpl_mixed_row_innodb.test new file mode 100644 index 00000000000..3f7ee971347 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mixed_row_innodb.test @@ -0,0 +1,8 @@ +# File for specialities regarding replication from or to InnoDB +# tables. + +source include/master-slave.inc; +source include/have_innodb.inc; +source include/have_binlog_format_mixed_or_row.inc; + +source extra/rpl_tests/rpl_innodb.test; diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test index 1c489894c0f..6a9a30fcb0e 100644 --- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test +++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test @@ -17,7 +17,7 @@ SHOW BINLOG EVENTS; sync_slave_with_master; --echo **** On Slave **** --replace_result $MASTER_MYPORT MASTER_PORT ---replace_column 1 # 8 # 9 # 23 # 33 # 34 # 35 # +--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 34 # 35 # --query_vertical SHOW SLAVE STATUS --replace_result $VERSION VERSION --replace_column 2 # 5 # diff --git a/mysql-test/suite/rpl/t/rpl_read_only.test b/mysql-test/suite/rpl/t/rpl_read_only.test index 62864b62a28..cfc340ab9fe 100644 --- a/mysql-test/suite/rpl/t/rpl_read_only.test +++ b/mysql-test/suite/rpl/t/rpl_read_only.test @@ -2,6 +2,8 @@ -- source include/master-slave.inc -- source include/have_innodb.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + # Create a test and replicate it to slave connection master; create user test; @@ -40,12 +42,16 @@ set global read_only=0; connection master1; BEGIN; insert into t1 values(1002); +--disable_warnings insert into t2 values(2002); +--enable_warnings connection master2; BEGIN; insert into t1 values(1003); +--disable_warnings insert into t2 values(2003); +--enable_warnings connection master; set global read_only=1; diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test index 5904585a050..4a1e21f33bf 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test @@ -1,4 +1,5 @@ --source include/have_binlog_format_row.inc +--source include/have_innodb.inc let $SERVER_VERSION=`select version()`; diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt new file mode 100644 index 00000000000..45631525481 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size-master.opt @@ -0,0 +1 @@ +--binlog_cache_size=4096 --max_binlog_cache_size=7680 diff --git a/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test new file mode 100644 index 00000000000..5133c8b1b5e --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_binlog_max_cache_size.test @@ -0,0 +1,7 @@ +--source include/have_innodb.inc +--source include/master-slave.inc +--source include/not_embedded.inc +--source include/not_windows.inc +--source include/have_binlog_format_row.inc + +--source extra/rpl_tests/rpl_binlog_max_cache_size.test diff --git a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test new file mode 100644 index 00000000000..25764f1acc9 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test @@ -0,0 +1,9 @@ +################################################################################ +# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test +################################################################################ +--source include/have_binlog_format_row.inc +#Re-enable this after fixing BUG#46572 +#--source include/master-slave.inc +--source include/have_innodb.inc + +--source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test new file mode 100644 index 00000000000..8af1ae51bb9 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_row_mixing_engines.test @@ -0,0 +1,11 @@ +################################################################################### +# This test cases evaluates the mixture of non-transactional and transcational +# tables. For further details, please, read WL#2687 and WL#5072. +################################################################################### +--source include/have_binlog_format_row.inc +--source include/master-slave.inc +--source include/have_innodb.inc + +let $engine_type=Innodb; +--source extra/rpl_tests/rpl_mixing_engines.test + diff --git a/mysql-test/suite/rpl/t/rpl_row_until.test b/mysql-test/suite/rpl/t/rpl_row_until.test index fe859218ed3..52e38fa3e57 100644 --- a/mysql-test/suite/rpl/t/rpl_row_until.test +++ b/mysql-test/suite/rpl/t/rpl_row_until.test @@ -11,31 +11,32 @@ let $VERSION=`select version()`; connection master; CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); INSERT INTO t1 VALUES (1),(2),(3),(4); -DROP TABLE t1; # Save master log postion for query DROP TABLE t1 -save_master_pos; -let $master_pos_drop_t1= query_get_value(SHOW BINLOG EVENTS, Pos, 7); +let $master_pos_drop_t1= query_get_value(SHOW MASTER STATUS, Position, 1); +DROP TABLE t1; +#show binlog events; -CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); # Save master log postion for query CREATE TABLE t2 -save_master_pos; -let $master_pos_create_t2= query_get_value(SHOW BINLOG EVENTS, Pos, 8); +let $master_pos_create_t2= query_get_value(SHOW MASTER STATUS, Position, 1); +CREATE TABLE t2(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY); +#show binlog events; INSERT INTO t2 VALUES (1),(2); -save_master_pos; # Save master log postion for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_insert1_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 12); +let $master_pos_insert1_t2= query_get_value(SHOW MASTER STATUS, Position, 1); sync_slave_with_master; +#show binlog events; # Save relay log postion for query INSERT INTO t2 VALUES (1),(2); -let $relay_pos_insert1_t2= query_get_value(show slave status, Relay_Log_Pos, 1); +let $relay_pos_insert1_t2= query_get_value(SHOW SLAVE STATUS, Relay_Log_Pos, 1); connection master; INSERT INTO t2 VALUES (3),(4); DROP TABLE t2; -# Save master log postion for query INSERT INTO t2 VALUES (1),(2); -let $master_pos_drop_t2= query_get_value(SHOW BINLOG EVENTS, End_log_pos, 17); +# Save master log postion for query DROP TABLE t2; +let $master_pos_drop_t2= query_get_value(SHOW MASTER STATUS, Position, 1); sync_slave_with_master; +#show binlog events; --source include/stop_slave.inc # Reset slave. @@ -45,6 +46,7 @@ eval CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='1 --enable_query_log # Try to replicate all queries until drop of t1 + connection slave; echo START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1; --disable_query_log diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt new file mode 100644 index 00000000000..45631525481 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size-master.opt @@ -0,0 +1 @@ +--binlog_cache_size=4096 --max_binlog_cache_size=7680 diff --git a/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test new file mode 100644 index 00000000000..7e43b7a9e7d --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_binlog_max_cache_size.test @@ -0,0 +1,7 @@ +--source include/have_innodb.inc +--source include/master-slave.inc +--source include/not_embedded.inc +--source include/not_windows.inc +--source include/have_binlog_format_statement.inc + +--source extra/rpl_tests/rpl_binlog_max_cache_size.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test index f3993f80b90..791132cef5a 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test +++ b/mysql-test/suite/rpl/t/rpl_stm_flsh_tbls.test @@ -1,7 +1,7 @@ # depends on the binlog output --source include/have_binlog_format_mixed_or_statement.inc -let $rename_event_pos= 657; +let $rename_event_pos= 931; -- source extra/rpl_tests/rpl_flsh_tbls.test # End of 4.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test new file mode 100644 index 00000000000..be1906f39d3 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test @@ -0,0 +1,9 @@ +################################################################################ +# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test +################################################################################ +--source include/have_binlog_format_statement.inc +#Re-enable this after fixing BUG#46572 +#--source include/master-slave.inc +--source include/have_innodb.inc + +--source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_innodb.test b/mysql-test/suite/rpl/t/rpl_stm_innodb.test new file mode 100644 index 00000000000..cbdc402d407 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_innodb.test @@ -0,0 +1,8 @@ +# File for specialities regarding replication from or to InnoDB +# tables. + +source include/master-slave.inc; +source include/have_innodb.inc; +source include/have_binlog_format_statement.inc; + +source extra/rpl_tests/rpl_innodb.test; diff --git a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test index 0097fde874a..39a9522bf6c 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test +++ b/mysql-test/suite/rpl/t/rpl_stm_mixing_engines.test @@ -1,5 +1,10 @@ +################################################################################### +# This test cases evaluates the mixture of non-transactional and transcational +# tables. For further details, please, read WL#2687 and WL#5072. +################################################################################### --source include/have_binlog_format_statement.inc --source include/master-slave.inc --source include/have_innodb.inc +let $engine_type=Innodb; --source extra/rpl_tests/rpl_mixing_engines.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test new file mode 100644 index 00000000000..067c4b7c9b6 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_start_stop_slave.test @@ -0,0 +1,8 @@ +################################################################################ +# Please, check ./extra/rpl_tests/rpl_start_stop_slave.test +################################################################################ +--source include/master-slave.inc +--source include/have_binlog_format_statement.inc +--source include/have_innodb.inc + +--source ./extra/rpl_tests/rpl_start_stop_slave.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test new file mode 100644 index 00000000000..649690ebbbe --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_stm_stop_middle_group.test @@ -0,0 +1,9 @@ +################################################################################### +# Please, check extra/rpl_tests/rpl_stop_middle_group.test. +################################################################################### +-- source include/have_debug.inc +-- source include/master-slave.inc +-- source include/have_innodb.inc +-- source include/have_binlog_format_statement.inc + +-- source extra/rpl_tests/rpl_stop_middle_group.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test index 07a3b27763d..f59fab5f1a1 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_until.test +++ b/mysql-test/suite/rpl/t/rpl_stm_until.test @@ -61,7 +61,7 @@ select * from t1; source include/show_slave_status2.inc; # try replicate all up to and not including the second insert to t2; -start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746; +start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=891; --source include/wait_for_slave_io_to_start.inc --source include/wait_for_slave_sql_to_stop.inc select * from t2; diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test index eaf0becdf63..0f9497794c7 100644 --- a/mysql-test/suite/rpl/t/rpl_trigger.test +++ b/mysql-test/suite/rpl/t/rpl_trigger.test @@ -510,7 +510,9 @@ create trigger tr for each row insert into log values ( new.f ); set autocommit = 0; +--disable_warnings insert into t1 values ( 1 ); +--enable_warnings rollback; sync_slave_with_master; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index 8a32cff0cd3..b3b99cc0702 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -54,47 +54,7 @@ a b c 3 4 QA TESTING *** Start Slave *** START SLAVE; -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -123,47 +83,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TEST ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -187,47 +107,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -251,47 +131,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -314,47 +154,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23,1), ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -428,47 +228,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -491,47 +251,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -743,47 +463,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5; ******************************************** *** Expect slave to fail with Error 1060 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1060 -Last_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1060 -Last_SQL_Error Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5' -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1060 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; *** Try to insert in master **** @@ -885,47 +565,7 @@ INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX'); ******************************************** *** Expect slave to fail with Error 1522 *** ******************************************** -SHOW SLAVE STATUS; -Slave_IO_State # -Master_Host 127.0.0.1 -Master_User root -Master_Port # -Connect_Retry 1 -Master_Log_File master-bin.000001 -Read_Master_Log_Pos # -Relay_Log_File # -Relay_Log_Pos # -Relay_Master_Log_File master-bin.000001 -Slave_IO_Running Yes -Slave_SQL_Running No -Replicate_Do_DB -Replicate_Ignore_DB -Replicate_Do_Table -Replicate_Ignore_Table # -Replicate_Wild_Do_Table -Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Skip_Counter 0 -Exec_Master_Log_Pos # -Relay_Log_Space # -Until_Condition None -Until_Log_File -Until_Log_Pos 0 -Master_SSL_Allowed No -Master_SSL_CA_File -Master_SSL_CA_Path -Master_SSL_Cert -Master_SSL_Cipher -Master_SSL_Key -Seconds_Behind_Master # -Master_SSL_Verify_Server_Cert No -Last_IO_Errno # -Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 -Replicate_Ignore_Server_Ids -Master_Server_Id 1 +Slave failed with Error 1535 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result index 301f4c2e45b..67aa0955b71 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result @@ -41,9 +41,12 @@ show binlog events from 107 limit 2; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # BEGIN -show binlog events from 107 limit 2,1; +show binlog events from 107 limit 1,4; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Table_map 1 # table_id: # (test.t1) +master-bin.000001 # Table_map 1 # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows 1 # table_id: # flush logs; create table t3 (a int)ENGINE=NDB; select * from t1 order by 1 asc; @@ -267,7 +270,7 @@ Master_User root Master_Port MASTER_PORT Connect_Retry 1 Master_Log_File master-bin.000002 -Read_Master_Log_Pos 624 +Read_Master_Log_Pos # Relay_Log_File # Relay_Log_Pos # Relay_Master_Log_File master-bin.000002 @@ -282,7 +285,7 @@ Replicate_Wild_Ignore_Table Last_Errno 0 Last_Error Skip_Counter 0 -Exec_Master_Log_Pos 624 +Exec_Master_Log_Pos # Relay_Log_Space # Until_Condition None Until_Log_File diff --git a/mysql-test/t/commit_1innodb.test b/mysql-test/t/commit_1innodb.test index c4a29acdddd..5e2159c808b 100644 --- a/mysql-test/t/commit_1innodb.test +++ b/mysql-test/t/commit_1innodb.test @@ -1,6 +1,8 @@ -- source include/have_log_bin.inc -- source include/have_innodb.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + let $engine_type = InnoDB; -- source include/commit.inc diff --git a/mysql-test/t/ctype_cp932_binlog_stm.test b/mysql-test/t/ctype_cp932_binlog_stm.test index af6e6baf92a..b001b8e927d 100644 --- a/mysql-test/t/ctype_cp932_binlog_stm.test +++ b/mysql-test/t/ctype_cp932_binlog_stm.test @@ -4,6 +4,8 @@ -- source include/have_binlog_format_mixed_or_statement.inc -- source extra/binlog_tests/ctype_cp932_binlog.test +call mtr.add_suppression('Error in Log_event::read_log_event()'); + # # Bug#18293: Values in stored procedure written to binlog unescaped # @@ -22,18 +24,15 @@ CALL bug18293("Foo's a Bar", _cp932 0xED40ED41ED42, 47.93)| SELECT HEX(s1),HEX(s2),d FROM t4| DROP PROCEDURE bug18293| DROP TABLE t4| -SHOW BINLOG EVENTS FROM 371| +SHOW BINLOG EVENTS FROM 514| delimiter ;| --echo End of 5.0 tests # # #28436: Incorrect position in SHOW BINLOG EVENTS causes server coredump -# Note: 365 is a magic position (found experimentally, depends on -# the log's contents) that caused the server crash. - --error 1220 -SHOW BINLOG EVENTS FROM 366; +SHOW BINLOG EVENTS FROM 490; --echo Bug#44352 UPPER/LOWER function doesn't work correctly on cp932 and sjis environment. CREATE TABLE t1 (a varchar(16)) character set cp932; diff --git a/mysql-test/t/mysqlbinlog.test b/mysql-test/t/mysqlbinlog.test index 04fb5486f31..ed5ea5fc554 100644 --- a/mysql-test/t/mysqlbinlog.test +++ b/mysql-test/t/mysqlbinlog.test @@ -71,7 +71,7 @@ select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=240 $MYSQLD_DATADIR/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --position=981 $MYSQLD_DATADIR/master-bin.000002 # These are tests for remote binlog. # They should return the same as previous test. @@ -107,7 +107,7 @@ select "--- --position --" as ""; --enable_query_log --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ ---exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=240 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 +--exec $MYSQL_BINLOG --short-form --local-load=$MYSQLTEST_VARDIR/tmp/ --read-from-remote-server --position=981 --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000002 # Bug#7853 mysqlbinlog does not accept input from stdin --disable_query_log @@ -250,7 +250,7 @@ eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/tmp/mysqlbinlog_tmp.dat' --echo The bug being tested was that 'Query' lines were not preceded by '#' --echo If the line is in the table, it had to have been preceded by a '#' --echo -SELECT COUNT(*) AS `BUG#28293_expect_1` FROM patch WHERE a LIKE '%Query%'; +SELECT COUNT(*) AS `BUG#28293_expect_3` FROM patch WHERE a LIKE '%Query%'; DROP TABLE patch; # @@ -262,7 +262,7 @@ INSERT INTO t1 VALUES(connection_id()); let $a= `SELECT a FROM t1`; FLUSH LOGS; let $outfile= $MYSQLTEST_VARDIR/tmp/bug29928.sql; ---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000014 > $outfile +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000015 > $outfile DROP TABLE t1; connect (con1, localhost, root, , test); connection con1; @@ -286,8 +286,8 @@ exec $MYSQL_BINLOG $MYSQL_TEST_DIR/std_data/corrupt-relay-bin.000624 > $MYSQLTES # FLUSH LOGS; --error 1 ---exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null ---exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000016 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 >/dev/null 2>/dev/null +--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000017 >/dev/null 2>/dev/null --echo Bug#31611 Security risk with BINLOG statement @@ -302,8 +302,8 @@ CREATE TABLE t1 (a INT, b CHAR(64)); flush logs; INSERT INTO t1 VALUES (1,USER()); flush logs; -echo mysqlbinlog var/log/master-bin.000017 > var/tmp/bug31611.sql; -exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000017 > $MYSQLTEST_VARDIR/tmp/bug31611.sql; +echo mysqlbinlog var/log/master-bin.000018 > var/tmp/bug31611.sql; +exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000018 > $MYSQLTEST_VARDIR/tmp/bug31611.sql; connect (unsecure,localhost,untrusted,,mysqltest1); echo mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql; error 1; @@ -336,8 +336,8 @@ FLUSH LOGS; query_vertical SELECT * FROM t1; DROP TABLE t1; -echo >> mysqlbinlog var/log/master-bin.000019 > var/tmp/bug32580.sql; -exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000019 > $MYSQLTEST_VARDIR/tmp/bug32580.sql; +echo >> mysqlbinlog var/log/master-bin.000020 > var/tmp/bug32580.sql; +exec $MYSQL_BINLOG $MYSQLD_DATADIR/master-bin.000020 > $MYSQLTEST_VARDIR/tmp/bug32580.sql; echo >> mysql test < var/tmp/bug32580.sql; exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug32580.sql; remove_file $MYSQLTEST_VARDIR/tmp/bug32580.sql; diff --git a/mysql-test/t/mysqlbinlog2.test b/mysql-test/t/mysqlbinlog2.test index 6089b83e42d..1f0da6bcf54 100644 --- a/mysql-test/t/mysqlbinlog2.test +++ b/mysql-test/t/mysqlbinlog2.test @@ -50,15 +50,15 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=609 $MYSQLD_DATADIR/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=760 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=609 $MYSQLD_DATADIR/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=760 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=609 --stop-position 726 $MYSQLD_DATADIR/master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=760 --stop-position 951 $MYSQLD_DATADIR/master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -84,11 +84,11 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=609 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=760 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=135 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 +--exec $MYSQL_BINLOG --short-form --stop-position=203 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -111,15 +111,15 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=760 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- stop-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --stop-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --stop-position=760 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start and stop positions ---" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=609 --stop-position 726 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 +--exec $MYSQL_BINLOG --short-form --start-position=760 --stop-position 951 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 --disable_query_log select "--- start-datetime --" as ""; --enable_query_log @@ -142,7 +142,7 @@ select "--- offset --" as ""; --disable_query_log select "--- start-position --" as ""; --enable_query_log ---exec $MYSQL_BINLOG --short-form --start-position=609 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 +--exec $MYSQL_BINLOG --short-form --start-position=760 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002 --disable_query_log select "--- stop-position --" as ""; --enable_query_log diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index aba71b6f61d..cc4f5a9c2da 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -1856,7 +1856,7 @@ static void ndb_binlog_query(THD *thd, Cluster_schema *schema) thd->db= schema->db; int errcode = query_error_code(thd, thd->killed == THD::NOT_KILLED); thd->binlog_query(THD::STMT_QUERY_TYPE, schema->query, - schema->query_length, FALSE, + schema->query_length, FALSE, TRUE, schema->name[0] == 0 || thd->db[0] == 0, errcode); thd->server_id= thd_server_id_save; diff --git a/sql/handler.cc b/sql/handler.cc index e3d22fe1bec..abffdaf49d1 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -4537,7 +4537,21 @@ static int write_locked_table_maps(THD *thd) if (table->current_lock == F_WRLCK && check_table_binlog_row_based(thd, table)) { - int const has_trans= table->file->has_transactions(); + /* + We need to have a transactional behavior for SQLCOM_CREATE_TABLE + (e.g. CREATE TABLE... SELECT * FROM TABLE) in order to keep a + compatible behavior with the STMT based replication even when + the table is not transactional. In other words, if the operation + fails while executing the insert phase nothing is written to the + binlog. + + Note that at this point, we check the type of a set of tables to + create the table map events. In the function binlog_log_row(), + which calls the current function, we check the type of the table + of the current row. + */ + bool const has_trans= thd->lex->sql_command == SQLCOM_CREATE_TABLE || + table->file->has_transactions(); int const error= thd->binlog_write_table_map(table, has_trans); /* If an error occurs, it is the responsibility of the caller to @@ -4586,10 +4600,20 @@ static int binlog_log_row(TABLE* table, { bitmap_set_all(&cols); if (likely(!(error= write_locked_table_maps(thd)))) - error= (*log_func)(thd, table, table->file->has_transactions(), - &cols, table->s->fields, + { + /* + We need to have a transactional behavior for SQLCOM_CREATE_TABLE + (i.e. CREATE TABLE... SELECT * FROM TABLE) in order to keep a + compatible behavior with the STMT based replication even when + the table is not transactional. In other words, if the operation + fails while executing the insert phase nothing is written to the + binlog. + */ + bool const has_trans= thd->lex->sql_command == SQLCOM_CREATE_TABLE || + table->file->has_transactions(); + error= (*log_func)(thd, table, has_trans, &cols, table->s->fields, before_record, after_record); - + } if (!use_bitbuf) bitmap_free(&cols); } diff --git a/sql/log.cc b/sql/log.cc index 491030aca34..fa063196e14 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -148,69 +148,27 @@ private: }; /* - Helper class to store binary log transaction data. + Helper classes to store non-transactional and transactional data + before copying it to the binary log. */ -class binlog_trx_data { +class binlog_cache_data +{ public: - binlog_trx_data() - : at_least_one_stmt(0), incident(FALSE), m_pending(0), - before_stmt_pos(MY_OFF_T_UNDEF) + binlog_cache_data(): m_pending(0), before_stmt_pos (MY_OFF_T_UNDEF), + incident(FALSE) { - trans_log.end_of_file= max_binlog_cache_size; + cache_log.end_of_file= max_binlog_cache_size; } - ~binlog_trx_data() + ~binlog_cache_data() { - DBUG_ASSERT(pending() == NULL); - close_cached_file(&trans_log); - } - - my_off_t position() const { - return my_b_tell(&trans_log); + DBUG_ASSERT(empty()); + close_cached_file(&cache_log); } bool empty() const { - return pending() == NULL && my_b_tell(&trans_log) == 0; - } - - /* - Truncate the transaction cache to a certain position. This - includes deleting the pending event. - */ - void truncate(my_off_t pos) - { - DBUG_PRINT("info", ("truncating to position %lu", (ulong) pos)); - DBUG_PRINT("info", ("before_stmt_pos=%lu", (ulong) pos)); - delete pending(); - set_pending(0); - reinit_io_cache(&trans_log, WRITE_CACHE, pos, 0, 0); - trans_log.end_of_file= max_binlog_cache_size; - if (pos < before_stmt_pos) - before_stmt_pos= MY_OFF_T_UNDEF; - - /* - The only valid positions that can be truncated to are at the - beginning of a statement. We are relying on this fact to be able - to set the at_least_one_stmt flag correctly. In other word, if - we are truncating to the beginning of the transaction cache, - there will be no statements in the cache, otherwhise, we will - have at least one statement in the transaction cache. - */ - at_least_one_stmt= (pos > 0); - } - - /* - Reset the entire contents of the transaction cache, emptying it - completely. - */ - void reset() { - if (!empty()) - truncate(0); - before_stmt_pos= MY_OFF_T_UNDEF; - incident= FALSE; - trans_log.end_of_file= max_binlog_cache_size; - DBUG_ASSERT(empty()); + return pending() == NULL && my_b_tell(&cache_log) == 0; } Rows_log_event *pending() const @@ -223,8 +181,6 @@ public: m_pending= pending; } - IO_CACHE trans_log; // The transaction cache - void set_incident(void) { incident= TRUE; @@ -235,25 +191,112 @@ public: return(incident); } - /** - Boolean that is true if there is at least one statement in the - transaction cache. + void reset() + { + truncate(0); + incident= FALSE; + before_stmt_pos= MY_OFF_T_UNDEF; + cache_log.end_of_file= max_binlog_cache_size; + DBUG_ASSERT(empty()); + } + + my_off_t get_byte_position() const + { + return my_b_tell(&cache_log); + } + + my_off_t get_prev_position() + { + return(before_stmt_pos); + } + + void set_prev_position(my_off_t pos) + { + before_stmt_pos= pos; + } + + void restore_prev_position() + { + truncate(before_stmt_pos); + } + + void restore_savepoint(my_off_t pos) + { + truncate(pos); + if (pos < before_stmt_pos) + before_stmt_pos= MY_OFF_T_UNDEF; + } + + /* + Cache to store data before copying it to the binary log. */ - bool at_least_one_stmt; - bool incident; + IO_CACHE cache_log; private: /* - Pending binrows event. This event is the event where the rows are - currently written. + Pending binrows event. This event is the event where the rows are currently + written. */ Rows_log_event *m_pending; -public: /* Binlog position before the start of the current statement. */ my_off_t before_stmt_pos; + + /* + This indicates that some events did not get into the cache and most likely + it is corrupted. + */ + bool incident; + + /* + It truncates the cache to a certain position. This includes deleting the + pending event. + */ + void truncate(my_off_t pos) + { + DBUG_PRINT("info", ("truncating to position %lu", (ulong) pos)); + if (pending()) + { + delete pending(); + set_pending(0); + } + reinit_io_cache(&cache_log, WRITE_CACHE, pos, 0, 0); + cache_log.end_of_file= max_binlog_cache_size; + } + + binlog_cache_data& operator=(const binlog_cache_data& info); + binlog_cache_data(const binlog_cache_data& info); +}; + +class binlog_cache_mngr { +public: + binlog_cache_mngr() {} + + void reset_cache(binlog_cache_data* cache_data) + { + cache_data->reset(); + } + + binlog_cache_data* get_binlog_cache_data(bool is_transactional) + { + return (is_transactional ? &trx_cache : &stmt_cache); + } + + IO_CACHE* get_binlog_cache_log(bool is_transactional) + { + return (is_transactional ? &trx_cache.cache_log : &stmt_cache.cache_log); + } + + binlog_cache_data stmt_cache; + + binlog_cache_data trx_cache; + +private: + + binlog_cache_mngr& operator=(const binlog_cache_mngr& info); + binlog_cache_mngr(const binlog_cache_mngr& info); }; handlerton *binlog_hton; @@ -1265,26 +1308,6 @@ int LOGGER::set_handlers(uint error_log_printer, return 0; } -/** - This function checks if a transactional talbe was updated by the - current statement. - - @param thd The client thread that executed the current statement. - @return - @c true if a transactional table was updated, @false otherwise. -*/ -static bool stmt_has_updated_trans_table(THD *thd) -{ - Ha_trx_info *ha_info; - - for (ha_info= thd->transaction.stmt.ha_list; ha_info; ha_info= ha_info->next()) - { - if (ha_info->is_trx_read_write() && ha_info->ht() != binlog_hton) - return (TRUE); - } - return (FALSE); -} - /* Save position of binary log transaction cache. @@ -1307,10 +1330,10 @@ binlog_trans_log_savepos(THD *thd, my_off_t *pos) DBUG_ASSERT(pos != NULL); if (thd_get_ha_data(thd, binlog_hton) == NULL) thd->binlog_setup_trx_data(); - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); DBUG_ASSERT(mysql_bin_log.is_open()); - *pos= trx_data->position(); + *pos= cache_mngr->trx_cache.get_byte_position(); DBUG_PRINT("return", ("*pos: %lu", (ulong) *pos)); DBUG_VOID_RETURN; } @@ -1341,9 +1364,9 @@ binlog_trans_log_truncate(THD *thd, my_off_t pos) /* Only true if binlog_trans_log_savepos() wasn't called before */ DBUG_ASSERT(pos != ~(my_off_t) 0); - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); - trx_data->truncate(pos); + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + cache_mngr->trx_cache.restore_savepoint(pos); DBUG_VOID_RETURN; } @@ -1372,115 +1395,127 @@ int binlog_init(void *p) static int binlog_close_connection(handlerton *hton, THD *thd) { - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); - DBUG_ASSERT(trx_data->empty()); + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + DBUG_ASSERT(cache_mngr->trx_cache.empty() && cache_mngr->stmt_cache.empty()); thd_set_ha_data(thd, binlog_hton, NULL); - trx_data->~binlog_trx_data(); - my_free((uchar*)trx_data, MYF(0)); + cache_mngr->~binlog_cache_mngr(); + my_free((uchar*)cache_mngr, MYF(0)); return 0; } -/* - End a transaction. +/** + This function flushes a transactional cache upon commit/rollback. - SYNOPSIS - binlog_end_trans() + @param thd The thread whose transaction should be flushed + @param cache_mngr Pointer to the cache data to be flushed + @param end_ev The end event either commit/rollback. - thd The thread whose transaction should be ended - trx_data Pointer to the transaction data to use - end_ev The end event to use, or NULL - all True if the entire transaction should be ended, false if - only the statement transaction should be ended. - - DESCRIPTION - - End the currently open transaction. The transaction can be either - a real transaction (if 'all' is true) or a statement transaction - (if 'all' is false). - - If 'end_ev' is NULL, the transaction is a rollback of only - transactional tables, so the transaction cache will be truncated - to either just before the last opened statement transaction (if - 'all' is false), or reset completely (if 'all' is true). - */ + @return + nonzero if an error pops up when flushing the transactional cache. +*/ static int -binlog_end_trans(THD *thd, binlog_trx_data *trx_data, - Log_event *end_ev, bool all) +binlog_flush_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr, + Log_event *end_ev) { - DBUG_ENTER("binlog_end_trans"); + DBUG_ENTER("binlog_flush_trx_cache"); int error=0; - IO_CACHE *trans_log= &trx_data->trans_log; - DBUG_PRINT("enter", ("transaction: %s end_ev: 0x%lx", - all ? "all" : "stmt", (long) end_ev)); - DBUG_PRINT("info", ("thd->options={ %s%s}", - FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT), - FLAGSTR(thd->options, OPTION_BEGIN))); + IO_CACHE *cache_log= &cache_mngr->trx_cache.cache_log; /* - NULL denotes ROLLBACK with nothing to replicate: i.e., rollback of - only transactional tables. If the transaction contain changes to - any non-transactiona tables, we need write the transaction and log - a ROLLBACK last. + This function handles transactional changes and as such + this flag equals to true. */ - if (end_ev != NULL) + bool const is_transactional= TRUE; + + if (thd->binlog_flush_pending_rows_event(TRUE, is_transactional)) + DBUG_RETURN(1); + /* + Doing a commit or a rollback including non-transactional tables, + i.e., ending a transaction where we might write the transaction + cache to the binary log. + + We can always end the statement when ending a transaction since + transactions are not allowed inside stored functions. If they + were, we would have to ensure that we're not ending a statement + inside a stored function. + */ + error= mysql_bin_log.write(thd, &cache_mngr->trx_cache.cache_log, end_ev, + cache_mngr->trx_cache.has_incident()); + cache_mngr->reset_cache(&cache_mngr->trx_cache); + + /* + We need to step the table map version after writing the + transaction cache to disk. + */ + mysql_bin_log.update_table_map_version(); + statistic_increment(binlog_cache_use, &LOCK_status); + if (cache_log->disk_writes != 0) { - if (thd->binlog_flush_pending_rows_event(TRUE)) - DBUG_RETURN(1); - /* - Doing a commit or a rollback including non-transactional tables, - i.e., ending a transaction where we might write the transaction - cache to the binary log. - - We can always end the statement when ending a transaction since - transactions are not allowed inside stored functions. If they - were, we would have to ensure that we're not ending a statement - inside a stored function. - */ - error= mysql_bin_log.write(thd, &trx_data->trans_log, end_ev, - trx_data->has_incident()); - trx_data->reset(); - - /* - We need to step the table map version after writing the - transaction cache to disk. - */ - mysql_bin_log.update_table_map_version(); - statistic_increment(binlog_cache_use, &LOCK_status); - if (trans_log->disk_writes != 0) - { - statistic_increment(binlog_cache_disk_use, &LOCK_status); - trans_log->disk_writes= 0; - } + statistic_increment(binlog_cache_disk_use, &LOCK_status); + cache_log->disk_writes= 0; } + + DBUG_ASSERT(cache_mngr->trx_cache.empty()); + DBUG_RETURN(error); +} + +/** + This function truncates the transactional cache upon committing or rolling + back either a transaction or a statement. + + @param thd The thread whose transaction should be flushed + @param cache_mngr Pointer to the cache data to be flushed + @param all @c true means truncate the transaction, otherwise the + statement must be truncated. + + @return + nonzero if an error pops up when truncating the transactional cache. +*/ +static int +binlog_truncate_trx_cache(THD *thd, binlog_cache_mngr *cache_mngr, bool all) +{ + DBUG_ENTER("binlog_truncate_trx_cache"); + int error=0; + /* + This function handles transactional changes and as such this flag + equals to true. + */ + bool const is_transactional= TRUE; + + DBUG_PRINT("info", ("thd->options={ %s%s}, transaction: %s", + FLAGSTR(thd->options, OPTION_NOT_AUTOCOMMIT), + FLAGSTR(thd->options, OPTION_BEGIN), + all ? "all" : "stmt")); + /* + If rolling back an entire transaction or a single statement not + inside a transaction, we reset the transaction cache. + */ + thd->binlog_remove_pending_rows_event(TRUE, is_transactional); + if (all || !thd->in_multi_stmt_transaction()) + { + if (cache_mngr->trx_cache.has_incident()) + error= mysql_bin_log.write_incident(thd, TRUE); + + cache_mngr->reset_cache(&cache_mngr->trx_cache); + + thd->clear_binlog_table_maps(); + } + /* + If rolling back a statement in a transaction, we truncate the + transaction cache to remove the statement. + */ else - { - /* - If rolling back an entire transaction or a single statement not - inside a transaction, we reset the transaction cache. + cache_mngr->trx_cache.restore_prev_position(); - If rolling back a statement in a transaction, we truncate the - transaction cache to remove the statement. - */ - thd->binlog_remove_pending_rows_event(TRUE); - if (all || !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) - { - if (trx_data->has_incident()) - mysql_bin_log.write_incident(thd, TRUE); - trx_data->reset(); - } - else // ...statement - trx_data->truncate(trx_data->before_stmt_pos); + /* + We need to step the table map version on a rollback to ensure that a new + table map event is generated instead of the one that was written to the + thrown-away transaction cache. + */ + mysql_bin_log.update_table_map_version(); - /* - We need to step the table map version on a rollback to ensure - that a new table map event is generated instead of the one that - was written to the thrown-away transaction cache. - */ - mysql_bin_log.update_table_map_version(); - } - - DBUG_ASSERT(thd->binlog_get_pending_rows_event() == NULL); + DBUG_ASSERT(thd->binlog_get_pending_rows_event(is_transactional) == NULL); DBUG_RETURN(error); } @@ -1495,11 +1530,57 @@ static int binlog_prepare(handlerton *hton, THD *thd, bool all) return 0; } +/** + This function flushes the non-transactional to the binary log upon + committing or rolling back a statement. + + @param thd The thread whose transaction should be flushed + @param cache_mngr Pointer to the cache data to be flushed + + @return + nonzero if an error pops up when flushing the non-transactional cache. +*/ +static int +binlog_flush_stmt_cache(THD *thd, binlog_cache_mngr *cache_mngr) +{ + int error= 0; + DBUG_ENTER("binlog_flush_stmt_cache"); + /* + If we are flushing the statement cache, it means that the changes get + through otherwise the cache is empty and this routine should not be called. + */ + DBUG_ASSERT(cache_mngr->stmt_cache.has_incident() == FALSE); + /* + This function handles non-transactional changes and as such this flag equals + to false. + */ + bool const is_transactional= FALSE; + IO_CACHE *cache_log= &cache_mngr->stmt_cache.cache_log; + thd->binlog_flush_pending_rows_event(TRUE, is_transactional); + Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE, TRUE, 0); + if ((error= mysql_bin_log.write(thd, cache_log, &qev, + cache_mngr->stmt_cache.has_incident()))) + DBUG_RETURN(error); + cache_mngr->reset_cache(&cache_mngr->stmt_cache); + + /* + We need to step the table map version after writing the + transaction cache to disk. + */ + mysql_bin_log.update_table_map_version(); + statistic_increment(binlog_cache_use, &LOCK_status); + if (cache_log->disk_writes != 0) + { + statistic_increment(binlog_cache_disk_use, &LOCK_status); + cache_log->disk_writes= 0; + } + DBUG_RETURN(error); +} + /** This function is called once after each statement. - It has the responsibility to flush the transaction cache to the - binlog file on commits. + It has the responsibility to flush the caches to the binary log on commits. @param hton The binlog handlerton. @param thd The client thread that executes the transaction. @@ -1512,54 +1593,53 @@ static int binlog_commit(handlerton *hton, THD *thd, bool all) { int error= 0; DBUG_ENTER("binlog_commit"); - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + bool const in_transaction= thd->in_multi_stmt_transaction(); - if (trx_data->empty()) + DBUG_PRINT("debug", + ("all: %d, in_transaction: %s, all.modified_non_trans_table: %s, stmt.modified_non_trans_table: %s", + all, + YESNO(in_transaction), + YESNO(thd->transaction.all.modified_non_trans_table), + YESNO(thd->transaction.stmt.modified_non_trans_table))); + + if (!cache_mngr->stmt_cache.empty()) { - // we're here because trans_log was flushed in MYSQL_BIN_LOG::log_xid() - trx_data->reset(); + binlog_flush_stmt_cache(thd, cache_mngr); + } + + if (cache_mngr->trx_cache.empty()) + { + /* + we're here because cache_log was flushed in MYSQL_BIN_LOG::log_xid() + */ + cache_mngr->reset_cache(&cache_mngr->trx_cache); DBUG_RETURN(0); } /* We commit the transaction if: - - We are not in a transaction and committing a statement, or - - - We are in a transaction and a full transaction is committed - - Otherwise, we accumulate the statement + - We are in a transaction and a full transaction is committed. + Otherwise, we accumulate the changes. */ - ulonglong const in_transaction= - thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN); - DBUG_PRINT("debug", - ("all: %d, empty: %s, in_transaction: %s, all.modified_non_trans_table: %s, stmt.modified_non_trans_table: %s", - all, - YESNO(trx_data->empty()), - YESNO(in_transaction), - YESNO(thd->transaction.all.modified_non_trans_table), - YESNO(thd->transaction.stmt.modified_non_trans_table))); if (!in_transaction || all) { - Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, TRUE, 0); - error= binlog_end_trans(thd, trx_data, &qev, all); - goto end; + Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE, TRUE, 0); + error= binlog_flush_trx_cache(thd, cache_mngr, &qev); } -end: - if (!all) - trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt commit - DBUG_RETURN(error); -} + /* + This is part of the stmt rollback. + */ + if (!all) + cache_mngr->trx_cache.set_prev_position(MY_OFF_T_UNDEF); + DBUG_RETURN(error); + } /** - This function is called when a transaction involving a transactional - table is rolled back. - - It has the responsibility to flush the transaction cache to the - binlog file. However, if the transaction does not involve - non-transactional tables, nothing needs to be logged. + This function is called when a transaction or a statement is rolled back. @param hton The binlog handlerton. @param thd The client thread that executes the transaction. @@ -1572,18 +1652,38 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) { DBUG_ENTER("binlog_rollback"); int error=0; - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); - - if (trx_data->empty()) { - trx_data->reset(); - DBUG_RETURN(0); - } + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); DBUG_PRINT("debug", ("all: %s, all.modified_non_trans_table: %s, stmt.modified_non_trans_table: %s", YESNO(all), YESNO(thd->transaction.all.modified_non_trans_table), YESNO(thd->transaction.stmt.modified_non_trans_table))); + + /* + If an incident event is set we do not flush the content of the statement + cache because it may be corrupted. + */ + if (cache_mngr->stmt_cache.has_incident()) + { + mysql_bin_log.write_incident(thd, TRUE); + cache_mngr->reset_cache(&cache_mngr->stmt_cache); + } + else if (!cache_mngr->stmt_cache.empty()) + { + binlog_flush_stmt_cache(thd, cache_mngr); + } + + if (cache_mngr->trx_cache.empty()) + { + /* + we're here because cache_log was flushed in MYSQL_BIN_LOG::log_xid() + */ + cache_mngr->reset_cache(&cache_mngr->trx_cache); + DBUG_RETURN(0); + } + + if (mysql_bin_log.check_write_error(thd)) { /* @@ -1594,49 +1694,46 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) */ DBUG_ASSERT(!all); /* - We reach this point if either only transactional tables were modified or - the effect of a statement that did not get into the binlog needs to be - rolled back. In the latter case, if a statement changed non-transactional - tables or had the OPTION_KEEP_LOG associated, we write an incident event - to the binlog in order to stop slaves and notify users that some changes - on the master did not get into the binlog and slaves will be inconsistent. - On the other hand, if a statement is transactional, we just safely roll it - back. + We reach this point if the effect of a statement did not properly get into + a cache and need to be rolled back. */ - if ((thd->transaction.stmt.modified_non_trans_table || - (thd->options & OPTION_KEEP_LOG)) && - mysql_bin_log.check_write_error(thd)) - trx_data->set_incident(); - error= binlog_end_trans(thd, trx_data, 0, all); + error= binlog_truncate_trx_cache(thd, cache_mngr, all); } else - { - /* - We flush the cache with a rollback, wrapped in a beging/rollback if: + { + /* + We flush the cache wrapped in a beging/rollback if: . aborting a transcation that modified a non-transactional table or; . aborting a statement that modified both transactional and - non-transctional tables but which is not in the boundaries of any - transaction; + non-transctional tables but which is not in the boundaries of any + transaction; . the OPTION_KEEP_LOG is activate. */ - if ((all && thd->transaction.all.modified_non_trans_table) || + if (thd->variables.binlog_format == BINLOG_FORMAT_STMT && + ((all && thd->transaction.all.modified_non_trans_table) || (!all && thd->transaction.stmt.modified_non_trans_table && - !(thd->options & (OPTION_BEGIN | OPTION_NOT_AUTOCOMMIT))) || - ((thd->options & OPTION_KEEP_LOG))) + !thd->in_multi_stmt_transaction()) || + (thd->options & OPTION_KEEP_LOG))) { - Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, TRUE, 0); - error= binlog_end_trans(thd, trx_data, &qev, all); + Query_log_event qev(thd, STRING_WITH_LEN("ROLLBACK"), TRUE, FALSE, TRUE, 0); + error= binlog_flush_trx_cache(thd, cache_mngr, &qev); } /* Otherwise, we simply truncate the cache as there is no change on non-transactional tables as follows. */ - else if ((all && !thd->transaction.all.modified_non_trans_table) || - (!all && !thd->transaction.stmt.modified_non_trans_table)) - error= binlog_end_trans(thd, trx_data, 0, all); + else if (all || (!all && + (!thd->transaction.stmt.modified_non_trans_table || + !thd->in_multi_stmt_transaction() || + thd->variables.binlog_format != BINLOG_FORMAT_STMT))) + error= binlog_truncate_trx_cache(thd, cache_mngr, all); } + + /* + This is part of the stmt rollback. + */ if (!all) - trx_data->before_stmt_pos = MY_OFF_T_UNDEF; // part of the stmt rollback + cache_mngr->trx_cache.set_prev_position(MY_OFF_T_UNDEF); DBUG_RETURN(error); } @@ -1712,7 +1809,8 @@ static int binlog_savepoint_set(handlerton *hton, THD *thd, void *sv) int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); int const error= thd->binlog_query(THD::STMT_QUERY_TYPE, - thd->query, thd->query_length, TRUE, FALSE, errcode); + thd->query, thd->query_length, TRUE, FALSE, FALSE, + errcode); DBUG_RETURN(error); } @@ -1731,7 +1829,8 @@ static int binlog_savepoint_rollback(handlerton *hton, THD *thd, void *sv) int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); int error= thd->binlog_query(THD::STMT_QUERY_TYPE, - thd->query, thd->query_length, TRUE, FALSE, errcode); + thd->query, thd->query_length, TRUE, FALSE, FALSE, + errcode); DBUG_RETURN(error); } binlog_trans_log_truncate(thd, *(my_off_t*)sv); @@ -3737,27 +3836,67 @@ bool MYSQL_BIN_LOG::is_query_in_union(THD *thd, query_id_t query_id_param) int THD::binlog_setup_trx_data() { DBUG_ENTER("THD::binlog_setup_trx_data"); - binlog_trx_data *trx_data= - (binlog_trx_data*) thd_get_ha_data(this, binlog_hton); + binlog_cache_mngr *cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); - if (trx_data) + if (cache_mngr) DBUG_RETURN(0); // Already set up - trx_data= (binlog_trx_data*) my_malloc(sizeof(binlog_trx_data), MYF(MY_ZEROFILL)); - if (!trx_data || - open_cached_file(&trx_data->trans_log, mysql_tmpdir, + cache_mngr= (binlog_cache_mngr*) my_malloc(sizeof(binlog_cache_mngr), MYF(MY_ZEROFILL)); + if (!cache_mngr || + open_cached_file(&cache_mngr->stmt_cache.cache_log, mysql_tmpdir, + LOG_PREFIX, binlog_cache_size, MYF(MY_WME)) || + open_cached_file(&cache_mngr->trx_cache.cache_log, mysql_tmpdir, LOG_PREFIX, binlog_cache_size, MYF(MY_WME))) { - my_free((uchar*)trx_data, MYF(MY_ALLOW_ZERO_PTR)); + my_free((uchar*)cache_mngr, MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(1); // Didn't manage to set it up } - thd_set_ha_data(this, binlog_hton, trx_data); + thd_set_ha_data(this, binlog_hton, cache_mngr); - trx_data= new (thd_get_ha_data(this, binlog_hton)) binlog_trx_data; + cache_mngr= new (thd_get_ha_data(this, binlog_hton)) binlog_cache_mngr; DBUG_RETURN(0); } +/** + This function checks if a transactional talbe was updated by the + current transaction. + + @param thd The client thread that executed the current statement. + @return + @c true if a transactional table was updated, @false otherwise. +*/ +bool +trans_has_updated_trans_table(THD* thd) +{ + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + + return (cache_mngr ? my_b_tell (&cache_mngr->trx_cache.cache_log) : 0); +} + +/** + This function checks if a transactional talbe was updated by the + current statement. + + @param thd The client thread that executed the current statement. + @return + @c true if a transactional table was updated, @false otherwise. +*/ +bool +stmt_has_updated_trans_table(THD *thd) +{ + Ha_trx_info *ha_info; + + for (ha_info= thd->transaction.stmt.ha_list; ha_info; ha_info= ha_info->next()) + { + if (ha_info->is_trx_read_write() && ha_info->ht() != binlog_hton) + return (TRUE); + } + return (FALSE); +} + /* Function to start a statement and optionally a transaction for the binary log. @@ -3771,11 +3910,10 @@ int THD::binlog_setup_trx_data() - Start a transaction if not in autocommit mode or if a BEGIN statement has been seen. - - Start a statement transaction to allow us to truncate the binary - log. + - Start a statement transaction to allow us to truncate the cache. - Save the currrent binlog position so that we can roll back the - statement by truncating the transaction log. + statement by truncating the cache. We only update the saved position if the old one was undefined, the reason is that there are some cases (e.g., for CREATE-SELECT) @@ -3789,15 +3927,15 @@ int THD::binlog_setup_trx_data() void THD::binlog_start_trans_and_stmt() { - binlog_trx_data *trx_data= (binlog_trx_data*) thd_get_ha_data(this, binlog_hton); + binlog_cache_mngr *cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); DBUG_ENTER("binlog_start_trans_and_stmt"); - DBUG_PRINT("enter", ("trx_data: 0x%lx trx_data->before_stmt_pos: %lu", - (long) trx_data, - (trx_data ? (ulong) trx_data->before_stmt_pos : + DBUG_PRINT("enter", ("cache_mngr: %p cache_mngr->trx_cache.get_prev_position(): %lu", + cache_mngr, + (cache_mngr ? (ulong) cache_mngr->trx_cache.get_prev_position() : (ulong) 0))); - if (trx_data == NULL || - trx_data->before_stmt_pos == MY_OFF_T_UNDEF) + if (cache_mngr == NULL || + cache_mngr->trx_cache.get_prev_position() == MY_OFF_T_UNDEF) { this->binlog_set_stmt_begin(); if (options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)) @@ -3818,27 +3956,35 @@ THD::binlog_start_trans_and_stmt() } void THD::binlog_set_stmt_begin() { - binlog_trx_data *trx_data= - (binlog_trx_data*) thd_get_ha_data(this, binlog_hton); + binlog_cache_mngr *cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); /* - The call to binlog_trans_log_savepos() might create the trx_data + The call to binlog_trans_log_savepos() might create the cache_mngr structure, if it didn't exist before, so we save the position into an auto variable and then write it into the transaction - data for the binary log (i.e., trx_data). + data for the binary log (i.e., cache_mngr). */ my_off_t pos= 0; binlog_trans_log_savepos(this, &pos); - trx_data= (binlog_trx_data*) thd_get_ha_data(this, binlog_hton); - trx_data->before_stmt_pos= pos; + cache_mngr= (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); + cache_mngr->trx_cache.set_prev_position(pos); } -/* - Write a table map to the binary log. - */ - -int THD::binlog_write_table_map(TABLE *table, bool is_trans) +/** + This function writes a table map to the binary log. + Note that in order to keep the signature uniform with related methods, + we use a redundant parameter to indicate whether a transactional table + was changed or not. + + @param table a pointer to the table. + @param is_transactional @c true indicates a transactional table, + otherwise @c false a non-transactional. + @return + nonzero if an error pops up when writing the table map event. +*/ +int THD::binlog_write_table_map(TABLE *table, bool is_transactional) { int error; DBUG_ENTER("THD::binlog_write_table_map"); @@ -3854,12 +4000,17 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans) flags= Table_map_log_event::TM_NO_FLAGS; Table_map_log_event - the_event(this, table, table->s->table_map_id, is_trans, flags); + the_event(this, table, table->s->table_map_id, is_transactional, flags); - if (is_trans && binlog_table_maps == 0) + if (binlog_table_maps == 0) binlog_start_trans_and_stmt(); - if ((error= mysql_bin_log.write(&the_event))) + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); + + IO_CACHE *file= cache_mngr->get_binlog_cache_log(is_transactional); + + if ((error= the_event.write(file))) DBUG_RETURN(error); binlog_table_maps++; @@ -3867,144 +4018,163 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans) DBUG_RETURN(0); } +/** + This function retrieves a pending row event from a cache which is + specified through the parameter @c is_transactional. Respectively, when it + is @c true, the pending event is returned from the transactional cache. + Otherwise from the non-transactional cache. + + @param is_transactional @c true indicates a transactional cache, + otherwise @c false a non-transactional. + @return + The row event if any. +*/ Rows_log_event* -THD::binlog_get_pending_rows_event() const +THD::binlog_get_pending_rows_event(bool is_transactional) const { - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(this, binlog_hton); + Rows_log_event* rows= NULL; + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); + /* - This is less than ideal, but here's the story: If there is no - trx_data, prepare_pending_rows_event() has never been called - (since the trx_data is set up there). In that case, we just return - NULL. + This is less than ideal, but here's the story: If there is no cache_mngr, + prepare_pending_rows_event() has never been called (since the cache_mngr + is set up there). In that case, we just return NULL. */ - return trx_data ? trx_data->pending() : NULL; + if (cache_mngr) + { + binlog_cache_data *cache_data= + cache_mngr->get_binlog_cache_data(is_transactional); + + rows= cache_data->pending(); + } + return (rows); } +/** + This function stores a pending row event into a cache which is specified + through the parameter @c is_transactional. Respectively, when it is @c + true, the pending event is stored into the transactional cache. Otherwise + into the non-transactional cache. + + @param evt a pointer to the row event. + @param is_transactional @c true indicates a transactional cache, + otherwise @c false a non-transactional. +*/ void -THD::binlog_set_pending_rows_event(Rows_log_event* ev) +THD::binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional) { if (thd_get_ha_data(this, binlog_hton) == NULL) binlog_setup_trx_data(); - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(this, binlog_hton); + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton); - DBUG_ASSERT(trx_data); - trx_data->set_pending(ev); + DBUG_ASSERT(cache_mngr); + + binlog_cache_data *cache_data= + cache_mngr->get_binlog_cache_data(is_transactional); + + cache_data->set_pending(ev); } /** - Remove the pending rows event, discarding any outstanding rows. - - If there is no pending rows event available, this is effectively a + This function removes the pending rows event, discarding any outstanding + rows. If there is no pending rows event available, this is effectively a no-op. - */ + + @param thd a pointer to the user thread. + @param is_transactional @c true indicates a transactional cache, + otherwise @c false a non-transactional. +*/ int -MYSQL_BIN_LOG::remove_pending_rows_event(THD *thd) +MYSQL_BIN_LOG::remove_pending_rows_event(THD *thd, bool is_transactional) { DBUG_ENTER("MYSQL_BIN_LOG::remove_pending_rows_event"); - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); - DBUG_ASSERT(trx_data); + DBUG_ASSERT(cache_mngr); - if (Rows_log_event* pending= trx_data->pending()) + binlog_cache_data *cache_data= + cache_mngr->get_binlog_cache_data(is_transactional); + + if (Rows_log_event* pending= cache_data->pending()) { delete pending; - trx_data->set_pending(NULL); + cache_data->set_pending(NULL); } DBUG_RETURN(0); } /* - Moves the last bunch of rows from the pending Rows event to the binlog - (either cached binlog if transaction, or disk binlog). Sets a new pending - event. + Moves the last bunch of rows from the pending Rows event to a cache (either + transactional cache if is_transaction is @c true, or the non-transactional + cache otherwise. Sets a new pending event. + + @param thd a pointer to the user thread. + @param evt a pointer to the row event. + @param is_transactional @c true indicates a transactional cache, + otherwise @c false a non-transactional. */ int MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd, - Rows_log_event* event) + Rows_log_event* event, + bool is_transactional) { DBUG_ENTER("MYSQL_BIN_LOG::flush_and_set_pending_rows_event(event)"); DBUG_ASSERT(mysql_bin_log.is_open()); DBUG_PRINT("enter", ("event: 0x%lx", (long) event)); int error= 0; + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); + DBUG_ASSERT(cache_mngr); - DBUG_ASSERT(trx_data); + binlog_cache_data *cache_data= + cache_mngr->get_binlog_cache_data(is_transactional); - DBUG_PRINT("info", ("trx_data->pending(): 0x%lx", (long) trx_data->pending())); + DBUG_PRINT("info", ("cache_mngr->pending(): 0x%lx", (long) cache_data->pending())); - if (Rows_log_event* pending= trx_data->pending()) + if (Rows_log_event* pending= cache_data->pending()) { - IO_CACHE *file= &log_file; + IO_CACHE *file= &cache_data->cache_log; /* - Decide if we should write to the log file directly or to the - transaction log. - */ - if (pending->get_cache_stmt() || my_b_tell(&trx_data->trans_log)) - file= &trx_data->trans_log; - - /* - If we are writing to the log file directly, we could avoid - locking the log. This does not work since we need to step the - m_table_map_version below, and that change has to be protected - by the LOCK_log mutex. - */ - pthread_mutex_lock(&LOCK_log); - - /* - Write pending event to log file or transaction cache + Write pending event to the cache. */ if (pending->write(file)) { - pthread_mutex_unlock(&LOCK_log); set_write_error(thd); + if (check_write_error(thd) && cache_data && + thd->transaction.stmt.modified_non_trans_table) + cache_data->set_incident(); DBUG_RETURN(1); } /* We step the table map version if we are writing an event - representing the end of a statement. We do this regardless of - wheather we write to the transaction cache or to directly to the - file. - - In an ideal world, we could avoid stepping the table map version - if we were writing to a transaction cache, since we could then - reuse the table map that was written earlier in the transaction - cache. This does not work since STMT_END_F implies closing all - table mappings on the slave side. + representing the end of a statement. + In an ideal world, we could avoid stepping the table map version, + since we could then reuse the table map that was written earlier + in the cache. This does not work since STMT_END_F implies closing + all table mappings on the slave side. + TODO: Find a solution so that table maps does not have to be written several times within a transaction. - */ + */ if (pending->get_flags(Rows_log_event::STMT_END_F)) ++m_table_map_version; delete pending; - - if (file == &log_file) - { - error= flush_and_sync(0); - if (!error) - { - signal_update(); - rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); - } - } - - pthread_mutex_unlock(&LOCK_log); } - thd->binlog_set_pending_rows_event(event); + thd->binlog_set_pending_rows_event(event, is_transactional); DBUG_RETURN(error); } @@ -4018,6 +4188,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) THD *thd= event_info->thd; bool error= 1; DBUG_ENTER("MYSQL_BIN_LOG::write(Log_event *)"); + binlog_cache_data *cache_data= 0; if (thd->binlog_evt_union.do_union) { @@ -4026,27 +4197,22 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) We will log the function call to the binary log on function exit */ thd->binlog_evt_union.unioned_events= TRUE; - thd->binlog_evt_union.unioned_events_trans |= event_info->cache_stmt; + thd->binlog_evt_union.unioned_events_trans |= + event_info->use_trans_cache(); DBUG_RETURN(0); } /* - Flush the pending rows event to the transaction cache or to the - log file. Since this function potentially aquire the LOCK_log - mutex, we do this before aquiring the LOCK_log mutex in this - function. - We only end the statement if we are in a top-level statement. If we are inside a stored function, we do not end the statement since this will close all tables on the slave. */ bool const end_stmt= thd->prelocked_mode && thd->lex->requires_prelocking(); - if (thd->binlog_flush_pending_rows_event(end_stmt)) + if (thd->binlog_flush_pending_rows_event(end_stmt, + event_info->use_trans_cache())) DBUG_RETURN(error); - pthread_mutex_lock(&LOCK_log); - /* In most cases this is only called if 'is_open()' is true; in fact this is mostly called if is_open() *was* true a few instructions before, but it @@ -4054,7 +4220,6 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) */ if (likely(is_open())) { - IO_CACHE *file= &log_file; #ifdef HAVE_REPLICATION /* In the future we need to add to the following if tests like @@ -4064,63 +4229,67 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) const char *local_db= event_info->get_db(); if ((thd && !(thd->options & OPTION_BIN_LOG)) || (!binlog_filter->db_ok(local_db))) - { - VOID(pthread_mutex_unlock(&LOCK_log)); DBUG_RETURN(0); - } #endif /* HAVE_REPLICATION */ -#if defined(USING_TRANSACTIONS) - /* - Should we write to the binlog cache or to the binlog on disk? - Write to the binlog cache if: - - it is already not empty (meaning we're in a transaction; note that the - present event could be about a non-transactional table, but still we need - to write to the binlog cache in that case to handle updates to mixed - trans/non-trans table types the best possible in binlogging) - - or if the event asks for it (cache_stmt == TRUE). - */ - if (opt_using_transactions && thd) +#if defined(USING_TRANSACTIONS) + IO_CACHE *file= NULL; + + if (event_info->use_direct_logging()) + { + file= &log_file; + pthread_mutex_lock(&LOCK_log); + } + else { if (thd->binlog_setup_trx_data()) goto err; - binlog_trx_data *const trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); - IO_CACHE *trans_log= &trx_data->trans_log; - my_off_t trans_log_pos= my_b_tell(trans_log); - if (event_info->get_cache_stmt() || trans_log_pos != 0 || - stmt_has_updated_trans_table(thd)) + binlog_cache_mngr *const cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); + + /* + If we are about to use write rows, we just need to check the type of + the event (either transactional or non-transactional) in order to + choose the cache. + */ + if (thd->is_current_stmt_binlog_format_row()) { - DBUG_PRINT("info", ("Using trans_log: cache: %d, trans_log_pos: %lu", - event_info->get_cache_stmt(), - (ulong) trans_log_pos)); - thd->binlog_start_trans_and_stmt(); - file= trans_log; + file= cache_mngr->get_binlog_cache_log(event_info->use_trans_cache()); + cache_data= cache_mngr->get_binlog_cache_data(event_info->use_trans_cache()); } /* - TODO as Mats suggested, for all the cases above where we write to - trans_log, it sounds unnecessary to lock LOCK_log. We should rather - test first if we want to write to trans_log, and if not, lock - LOCK_log. + However, if we are about to write statements we need to consider other + things. We use the non-transactional cache when: + + . the transactional cache is empty which means that there were no + early statement on behalf of the transaction. + . the respective event is tagged as non-transactional. */ + else if (cache_mngr->trx_cache.empty() && + !event_info->use_trans_cache()) + { + file= &cache_mngr->stmt_cache.cache_log; + cache_data= &cache_mngr->stmt_cache; + } + else + { + file= &cache_mngr->trx_cache.cache_log; + cache_data= &cache_mngr->trx_cache; + } + + thd->binlog_start_trans_and_stmt(); } #endif /* USING_TRANSACTIONS */ DBUG_PRINT("info",("event type: %d",event_info->get_type_code())); /* - No check for auto events flag here - this write method should - never be called if auto-events are enabled - */ + No check for auto events flag here - this write method should + never be called if auto-events are enabled. - /* - 1. Write first log events which describe the 'run environment' - of the SQL command - */ - - /* - If row-based binlogging, Insert_id, Rand and other kind of "setting - context" events are not needed. + Write first log events which describe the 'run environment' + of the SQL command. If row-based binlogging, Insert_id, Rand + and other kind of "setting context" events are not needed. */ if (thd) { @@ -4170,39 +4339,48 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) } /* - Write the SQL command - */ - - if (event_info->write(file) || + Write the event. + */ + if (event_info->write(file) || DBUG_EVALUATE_IF("injecting_fault_writing", 1, 0)) goto err; - if (file == &log_file) // we are writing to the real log (disk) - { - bool synced= 0; - if (flush_and_sync(&synced)) - goto err; - - if (RUN_HOOK(binlog_storage, after_flush, - (thd, log_file_name, file->pos_in_file, synced))) { - sql_print_error("Failed to run 'after_flush' hooks"); - goto err; - } - - signal_update(); - rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); - } - error=0; + error= 0; err: + if (event_info->use_direct_logging()) + { + if (!error) + { + bool synced; + if ((error= flush_and_sync(&synced))) + goto unlock; + + if ((error= RUN_HOOK(binlog_storage, after_flush, + (thd, log_file_name, file->pos_in_file, synced)))) + { + sql_print_error("Failed to run 'after_flush' hooks"); + goto unlock; + } + signal_update(); + rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); + } +unlock: + pthread_mutex_unlock(&LOCK_log); + } + if (error) + { set_write_error(thd); + if (check_write_error(thd) && cache_data && + thd->transaction.stmt.modified_non_trans_table) + cache_data->set_incident(); + } } if (event_info->flags & LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F) ++m_table_map_version; - pthread_mutex_unlock(&LOCK_log); DBUG_RETURN(error); } @@ -4314,7 +4492,7 @@ uint MYSQL_BIN_LOG::next_file_id() write_cache() cache Cache to write to the binary log lock_log True if the LOCK_log mutex should be aquired, false otherwise - sync_log True if the log should be flushed and sync:ed + sync_log True if the log should be flushed and synced DESCRIPTION Write the contents of the cache to the binary log. The cache will @@ -4530,9 +4708,6 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event, DBUG_ENTER("MYSQL_BIN_LOG::write(THD *, IO_CACHE *, Log_event *)"); VOID(pthread_mutex_lock(&LOCK_log)); - /* NULL would represent nothing to replicate after ROLLBACK */ - DBUG_ASSERT(commit_event != NULL); - DBUG_ASSERT(is_open()); if (likely(is_open())) // Should always be true { @@ -4547,19 +4722,9 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event, transaction is either a BEGIN..COMMIT block or a single statement in autocommit mode. */ - Query_log_event qinfo(thd, STRING_WITH_LEN("BEGIN"), TRUE, TRUE, 0); - - /* - Now this Query_log_event has artificial log_pos 0. It must be - adjusted to reflect the real position in the log. Not doing it - would confuse the slave: it would prevent this one from - knowing where he is in the master's binlog, which would result - in wrong positions being shown to the user, MASTER_POS_WAIT - undue waiting etc. - */ + Query_log_event qinfo(thd, STRING_WITH_LEN("BEGIN"), TRUE, FALSE, TRUE, 0); if (qinfo.write(&log_file)) goto err; - DBUG_EXECUTE_IF("crash_before_writing_xid", { if ((write_error= write_cache(cache, false, true))) @@ -5657,13 +5822,13 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid) { DBUG_ENTER("TC_LOG_BINLOG::log"); Xid_log_event xle(thd, xid); - binlog_trx_data *trx_data= - (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); + binlog_cache_mngr *cache_mngr= + (binlog_cache_mngr*) thd_get_ha_data(thd, binlog_hton); /* We always commit the entire transaction when writing an XID. Also note that the return value is inverted. */ - DBUG_RETURN(!binlog_end_trans(thd, trx_data, &xle, TRUE)); + DBUG_RETURN(!binlog_flush_trx_cache(thd, cache_mngr, &xle)); } void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid) diff --git a/sql/log.h b/sql/log.h index a31be6dcce6..40695ed2d2d 100644 --- a/sql/log.h +++ b/sql/log.h @@ -20,6 +20,9 @@ class Relay_log_info; class Format_description_log_event; +bool trans_has_updated_trans_table(THD* thd); +bool stmt_has_updated_trans_table(THD *thd); + /* Transaction Coordinator log - a base abstract class for two different implementations @@ -329,8 +332,9 @@ public: ulonglong table_map_version() const { return m_table_map_version; } void update_table_map_version() { ++m_table_map_version; } - int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event); - int remove_pending_rows_event(THD *thd); + int flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event, + bool is_transactional); + int remove_pending_rows_event(THD *thd, bool is_transactional); #endif /* !defined(MYSQL_CLIENT) */ void reset_bytes_written() @@ -368,7 +372,7 @@ public: /* Use this to start writing a new log file */ void new_file(); - bool write(Log_event* event_info); // binary log write + bool write(Log_event* event_info); bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event, bool incident); bool write_incident(THD *thd, bool lock); diff --git a/sql/log_event.cc b/sql/log_event.cc index e574be774e3..6c7b6fdf409 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -664,10 +664,11 @@ Log_event::Log_event(THD* thd_arg, uint16 flags_arg, bool using_trans) { server_id= thd->server_id; when= thd->start_time; - cache_stmt= using_trans; + cache_type= (using_trans || stmt_has_updated_trans_table(thd) + ? Log_event::EVENT_TRANSACTIONAL_CACHE : + Log_event::EVENT_STMT_CACHE); } - /** This minimal constructor is for when you are not even sure that there is a valid THD. For example in the server when we are shutting down or @@ -676,8 +677,8 @@ Log_event::Log_event(THD* thd_arg, uint16 flags_arg, bool using_trans) */ Log_event::Log_event() - :temp_buf(0), exec_time(0), flags(0), cache_stmt(0), - thd(0) + :temp_buf(0), exec_time(0), flags(0), + cache_type(Log_event::EVENT_INVALID_CACHE), thd(0) { server_id= ::server_id; /* @@ -696,7 +697,7 @@ Log_event::Log_event() Log_event::Log_event(const char* buf, const Format_description_log_event* description_event) - :temp_buf(0), cache_stmt(0) + :temp_buf(0), cache_type(Log_event::EVENT_INVALID_CACHE) { #ifndef MYSQL_CLIENT thd = 0; @@ -2352,7 +2353,7 @@ Query_log_event::Query_log_event() */ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, bool using_trans, - bool suppress_use, int errcode) + bool direct, bool suppress_use, int errcode) :Log_event(thd_arg, (thd_arg->thread_specific_used ? LOG_EVENT_THREAD_SPECIFIC_F : @@ -2431,6 +2432,95 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg, } else time_zone_len= 0; + + /* + In what follows, we decide whether to write to the binary log or to use a + cache. + */ + LEX *lex= thd->lex; + bool implicit_commit= FALSE; + cache_type= Log_event::EVENT_INVALID_CACHE; + switch (lex->sql_command) + { + case SQLCOM_ALTER_DB: + case SQLCOM_CREATE_FUNCTION: + case SQLCOM_DROP_FUNCTION: + case SQLCOM_DROP_PROCEDURE: + case SQLCOM_INSTALL_PLUGIN: + case SQLCOM_UNINSTALL_PLUGIN: + case SQLCOM_ALTER_TABLESPACE: + implicit_commit= TRUE; + break; + case SQLCOM_DROP_TABLE: + implicit_commit= !(lex->drop_temporary && thd->in_multi_stmt_transaction()); + break; + case SQLCOM_ALTER_TABLE: + case SQLCOM_CREATE_TABLE: + implicit_commit= !((lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) && + thd->in_multi_stmt_transaction()) && + !(lex->select_lex.item_list.elements && + thd->is_current_stmt_binlog_format_row()); + break; + case SQLCOM_SET_OPTION: + implicit_commit= (lex->autocommit ? TRUE : FALSE); + break; + /* + Replace what follows after CF_AUTO_COMMIT_TRANS is backported by: + + default: + implicit_commit= ((sql_command_flags[lex->sql_command] & + CF_AUTO_COMMIT_TRANS)); + break; + */ + case SQLCOM_CREATE_INDEX: + case SQLCOM_TRUNCATE: + case SQLCOM_CREATE_DB: + case SQLCOM_DROP_DB: + case SQLCOM_ALTER_DB_UPGRADE: + case SQLCOM_RENAME_TABLE: + case SQLCOM_DROP_INDEX: + case SQLCOM_CREATE_VIEW: + case SQLCOM_DROP_VIEW: + case SQLCOM_CREATE_TRIGGER: + case SQLCOM_DROP_TRIGGER: + case SQLCOM_CREATE_EVENT: + case SQLCOM_ALTER_EVENT: + case SQLCOM_DROP_EVENT: + case SQLCOM_REPAIR: + case SQLCOM_OPTIMIZE: + case SQLCOM_ANALYZE: + case SQLCOM_CREATE_USER: + case SQLCOM_DROP_USER: + case SQLCOM_RENAME_USER: + case SQLCOM_REVOKE_ALL: + case SQLCOM_REVOKE: + case SQLCOM_GRANT: + case SQLCOM_CREATE_PROCEDURE: + case SQLCOM_CREATE_SPFUNCTION: + case SQLCOM_ALTER_PROCEDURE: + case SQLCOM_ALTER_FUNCTION: + case SQLCOM_ASSIGN_TO_KEYCACHE: + case SQLCOM_PRELOAD_KEYS: + case SQLCOM_FLUSH: + case SQLCOM_CHECK: + implicit_commit= TRUE; + break; + default: + implicit_commit= FALSE; + break; + } + + if (implicit_commit || direct) + { + cache_type= Log_event::EVENT_NO_CACHE; + } + else + { + cache_type= (using_trans || stmt_has_updated_trans_table(thd) + ? Log_event::EVENT_TRANSACTIONAL_CACHE : + Log_event::EVENT_STMT_CACHE); + } + DBUG_ASSERT(cache_type != Log_event::EVENT_INVALID_CACHE); DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %lu", (ulong) flags2, sql_mode)); } @@ -6684,9 +6774,9 @@ Execute_load_query_log_event(THD *thd_arg, const char* query_arg, ulong query_length_arg, uint fn_pos_start_arg, uint fn_pos_end_arg, enum_load_dup_handling dup_handling_arg, - bool using_trans, bool suppress_use, + bool using_trans, bool direct, bool suppress_use, int errcode): - Query_log_event(thd_arg, query_arg, query_length_arg, using_trans, + Query_log_event(thd_arg, query_arg, query_length_arg, using_trans, direct, suppress_use, errcode), file_id(thd_arg->file_id), fn_pos_start(fn_pos_start_arg), fn_pos_end(fn_pos_end_arg), dup_handling(dup_handling_arg) @@ -7509,7 +7599,7 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) error= 0; } - if (!cache_stmt) + if (!use_trans_cache()) { DBUG_PRINT("info", ("Marked that we need to keep log")); thd->options|= OPTION_KEEP_LOG; @@ -7539,7 +7629,6 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) const_cast(rli)->cleanup_context(thd, error); thd->is_slave_error= 1; } - DBUG_RETURN(error); } @@ -7587,7 +7676,7 @@ static int rows_event_stmt_cleanup(Relay_log_info const *rli, THD * thd) (assume the last master's transaction is ignored by the slave because of replicate-ignore rules). */ - thd->binlog_flush_pending_rows_event(true); + thd->binlog_flush_pending_rows_event(TRUE); /* If this event is not in a transaction, the call below will, if some @@ -7854,7 +7943,7 @@ int Table_map_log_event::save_field_metadata() #if !defined(MYSQL_CLIENT) Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, bool is_transactional, uint16 flags) - : Log_event(thd, 0, true), + : Log_event(thd, 0, is_transactional), m_table(tbl), m_dbnam(tbl->s->db.str), m_dblen(m_dbnam ? tbl->s->db.length : 0), diff --git a/sql/log_event.h b/sql/log_event.h index de171145acd..5a897c55061 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -870,6 +870,31 @@ public: EVENT_SKIP_COUNT }; + enum enum_event_cache_type + { + EVENT_INVALID_CACHE, + /* + If possible the event should use a non-transactional cache before + being flushed to the binary log. This means that it must be flushed + right after its correspondent statement is completed. + */ + EVENT_STMT_CACHE, + /* + The event should use a transactional cache before being flushed to + the binary log. This means that it must be flushed upon commit or + rollback. + */ + EVENT_TRANSACTIONAL_CACHE, + /* + The event must be written directly to the binary log without going + through a cache. + */ + EVENT_NO_CACHE, + /** + If there is a need for different types, introduce them before this. + */ + EVENT_CACHE_COUNT + }; /* The following type definition is to be used whenever data is placed @@ -920,8 +945,12 @@ public: LOG_EVENT_SUPPRESS_USE_F for notes. */ uint16 flags; - - bool cache_stmt; + + /* + Defines the type of the cache, if any, where the event will be + stored before being flushed to disk. + */ + uint16 cache_type; /** A storage to cache the global system variable's value. @@ -933,7 +962,7 @@ public: THD* thd; Log_event(); - Log_event(THD* thd_arg, uint16 flags_arg, bool cache_stmt); + Log_event(THD* thd_arg, uint16 flags_arg, bool is_transactional); /* read_log_event() functions read an event from a binlog or relay log; used by SHOW BINLOG EVENTS, the binlog_dump thread on the @@ -1031,7 +1060,18 @@ public: void set_relay_log_event() { flags |= LOG_EVENT_RELAY_LOG_F; } bool is_artificial_event() const { return flags & LOG_EVENT_ARTIFICIAL_F; } bool is_relay_log_event() const { return flags & LOG_EVENT_RELAY_LOG_F; } - inline bool get_cache_stmt() const { return cache_stmt; } + inline bool use_trans_cache() const + { + return (cache_type == Log_event::EVENT_TRANSACTIONAL_CACHE); + } + inline void set_direct_logging() + { + cache_type = Log_event::EVENT_NO_CACHE; + } + inline bool use_direct_logging() + { + return (cache_type == Log_event::EVENT_NO_CACHE); + } Log_event(const char* buf, const Format_description_log_event *description_event); virtual ~Log_event() { free_temp_buf();} @@ -1645,7 +1685,7 @@ public: #ifndef MYSQL_CLIENT Query_log_event(THD* thd_arg, const char* query_arg, ulong query_length, - bool using_trans, bool suppress_use, int error); + bool using_trans, bool direct, bool suppress_use, int error); const char* get_db() { return db; } #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); @@ -2895,8 +2935,8 @@ public: ulong query_length, uint fn_pos_start_arg, uint fn_pos_end_arg, enum_load_dup_handling dup_handling_arg, - bool using_trans, bool suppress_use, - int errcode); + bool using_trans, bool direct, + bool suppress_use, int errcode); #ifdef HAVE_REPLICATION void pack_info(Protocol* protocol); #endif /* HAVE_REPLICATION */ @@ -3328,10 +3368,10 @@ public: return new table_def(m_coltype, m_colcnt, m_field_metadata, m_field_metadata_size, m_null_bits); } +#endif ulong get_table_id() const { return m_table_id; } const char *get_table_name() const { return m_tblnam; } const char *get_db_name() const { return m_dbnam; } -#endif virtual Log_event_type get_type_code() { return TABLE_MAP_EVENT; } virtual bool is_valid() const { return m_memory != NULL; /* we check malloc */ } @@ -3883,6 +3923,7 @@ public: DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message.str= NULL; /* Just as a precaution */ m_message.length= 0; + set_direct_logging(); DBUG_VOID_RETURN; } @@ -3892,6 +3933,7 @@ public: DBUG_ENTER("Incident_log_event::Incident_log_event"); DBUG_PRINT("enter", ("m_incident: %d", m_incident)); m_message= msg; + set_direct_logging(); DBUG_VOID_RETURN; } #endif diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index e7dda24f60d..fe81e865048 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -226,7 +226,7 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info DBUG_EXECUTE_IF("stop_slave_middle_group", const_cast(rli)->abort_slave= 1;); error= do_after_row_operations(table, error); - if (!ev->cache_stmt) + if (!ev->use_trans_cache()) { DBUG_PRINT("info", ("Marked that we need to keep log")); thd->options|= OPTION_KEEP_LOG; @@ -1510,7 +1510,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) NOTE: For this new scheme there should be no pending event: need to add code to assert that is the case. */ - thd->binlog_flush_pending_rows_event(false); + thd->binlog_flush_pending_rows_event(FALSE); TABLE_LIST *tables= rli->tables_to_lock; close_tables_for_reopen(thd, &tables); @@ -1716,7 +1716,7 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) DBUG_EXECUTE_IF("stop_slave_middle_group", const_cast(rli)->abort_slave= 1;); error= do_after_row_operations(rli, error); - if (!cache_stmt) + if (!use_trans_cache()) { DBUG_PRINT("info", ("Marked that we need to keep log")); thd->options|= OPTION_KEEP_LOG; @@ -1755,7 +1755,6 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) thd->is_slave_error= 1; DBUG_RETURN(error); } - DBUG_RETURN(0); } @@ -1800,7 +1799,7 @@ Old_rows_log_event::do_update_pos(Relay_log_info *rli) (assume the last master's transaction is ignored by the slave because of replicate-ignore rules). */ - thd->binlog_flush_pending_rows_event(true); + thd->binlog_flush_pending_rows_event(TRUE); /* If this event is not in a transaction, the call below will, if some diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 507f4b013cc..e3a1b5e6c73 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -939,7 +939,8 @@ struct Query_cache_query_flags #endif /*HAVE_QUERY_CACHE*/ void write_bin_log(THD *thd, bool clear_error, - char const *query, ulong query_length); + char const *query, ulong query_length, + bool is_trans= FALSE); /* sql_connect.cc */ int check_user(THD *thd, enum enum_server_command command, diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 3ae0683568e..7afc73582ab 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6235,6 +6235,8 @@ ER_BINLOG_UNSAFE_SYSTEM_VARIABLE eng "Statement uses a system variable whose value may differ on slave." ER_BINLOG_UNSAFE_SYSTEM_FUNCTION eng "Statement uses a system function whose value may differ on slave." +ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS + eng "Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction." ER_MESSAGE_AND_STATEMENT eng "%s Statement: %s" diff --git a/sql/sp.cc b/sql/sp.cc index 9fafe4ac355..e44b8b3ffdf 100644 --- a/sql/sp.cc +++ b/sql/sp.cc @@ -938,7 +938,7 @@ sp_create_routine(THD *thd, int type, sp_head *sp) /* Such a statement can always go directly to binlog, no trans cache */ thd->binlog_query(THD::STMT_QUERY_TYPE, log_query.c_ptr(), log_query.length(), - FALSE, FALSE, 0); + FALSE, FALSE, FALSE, 0); thd->variables.sql_mode= 0; } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index ef5dc8d3351..06382f85694 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1781,7 +1781,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, { int errcode = query_error_code(thd, thd->killed == THD::NOT_KILLED); Query_log_event qinfo(thd, binlog_buf.ptr(), binlog_buf.length(), - thd->binlog_evt_union.unioned_events_trans, FALSE, errcode); + thd->binlog_evt_union.unioned_events_trans, FALSE, FALSE, errcode); if (mysql_bin_log.write(&qinfo) && thd->binlog_evt_union.unioned_events_trans) { diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 10fefd5bb04..89ba9bc091b 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1655,7 +1655,7 @@ bool change_password(THD *thd, const char *host, const char *user, new_password)); thd->clear_error(); thd->binlog_query(THD::STMT_QUERY_TYPE, buff, query_length, - FALSE, FALSE, 0); + FALSE, FALSE, FALSE, 0); } end: close_thread_tables(thd); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 10185705efe..44d15d0ed65 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1542,7 +1542,7 @@ void close_temporary_tables(THD *thd) thd->variables.character_set_client= system_charset_info; Query_log_event qinfo(thd, s_query.ptr(), s_query.length() - 1 /* to remove trailing ',' */, - 0, FALSE, 0); + FALSE, TRUE, FALSE, 0); qinfo.db= db.ptr(); thd->variables.character_set_client= cs_save; mysql_bin_log.write(&qinfo); @@ -4021,7 +4021,7 @@ retry: int errcode= query_error_code(thd, TRUE); thd->binlog_query(THD::STMT_QUERY_TYPE, query, (ulong)(end-query), - FALSE, FALSE, errcode); + FALSE, FALSE, FALSE, errcode); my_free(query, MYF(0)); } else diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 2301dec5b51..94d7b679c05 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -828,7 +828,8 @@ void THD::init(void) else options &= ~OPTION_BIG_SELECTS; - transaction.all.modified_non_trans_table= transaction.stmt.modified_non_trans_table= FALSE; + transaction.all.modified_non_trans_table= + transaction.stmt.modified_non_trans_table= FALSE; open_options=ha_open_options; update_lock_default= (variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : @@ -3403,7 +3404,10 @@ int THD::decide_logging_format(TABLE_LIST *tables) HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE; my_bool multi_engine= FALSE; - void* prev_ht= NULL; + my_bool mixed_engine= FALSE; + my_bool all_trans_engines= TRUE; + TABLE* prev_write_table= NULL; + TABLE* prev_access_table= NULL; #ifndef DBUG_OFF { @@ -3432,14 +3436,94 @@ int THD::decide_logging_format(TABLE_LIST *tables) handler::Table_flags const flags= table->table->file->ha_table_flags(); DBUG_PRINT("info", ("table: %s; ha_table_flags: 0x%llx", table->table_name, flags)); - if (prev_ht && prev_ht != table->table->file->ht) + if (prev_write_table && prev_write_table->file->ht != + table->table->file->ht) multi_engine= TRUE; - prev_ht= table->table->file->ht; + all_trans_engines= all_trans_engines && + table->table->file->has_transactions(); + prev_write_table= table->table; flags_all_set &= flags; flags_some_set |= flags; } + if (prev_access_table && prev_access_table->file->ht != table->table->file->ht) + mixed_engine= mixed_engine || (prev_access_table->file->has_transactions() != + table->table->file->has_transactions()); + prev_access_table= table->table; } + /* + Set the statement as unsafe if: + + . it is a mixed statement, i.e. access transactional and non-transactional + tables, and updates at least one; + or + . an early statement updated a transactional table; + . and, the current statement updates a non-transactional table. + + Any mixed statement is classified as unsafe to ensure that mixed mode is + completely safe. Consider the following example to understand why we + decided to do this: + + Note that mixed statements such as + + 1: INSERT INTO myisam_t SELECT * FROM innodb_t; + + 2: INSERT INTO innodb_t SELECT * FROM myisam_t; + + are classified as unsafe to ensure that in mixed mode the execution is + completely safe and equivalent to the row mode. Consider the following + statements and sessions (connections) to understand the reason: + + con1: INSERT INTO innodb_t VALUES (1); + con1: INSERT INTO innodb_t VALUES (100); + + con1: BEGIN + con2: INSERT INTO myisam_t SELECT * FROM innodb_t; + con1: INSERT INTO innodb_t VALUES (200); + con1: COMMIT; + + The point is that the concurrent statements may be written into the binary log + in a way different from the execution. For example, + + BINARY LOG: + + con2: BEGIN; + con2: INSERT INTO myisam_t SELECT * FROM innodb_t; + con2: COMMIT; + con1: BEGIN + con1: INSERT INTO innodb_t VALUES (200); + con1: COMMIT; + + .... + + or + + BINARY LOG: + + con1: BEGIN + con1: INSERT INTO innodb_t VALUES (200); + con1: COMMIT; + con2: BEGIN; + con2: INSERT INTO myisam_t SELECT * FROM innodb_t; + con2: COMMIT; + + Clearly, this may become a problem in STMT mode and setting the statement + as unsafe will make rows to be written into the binary log in MIXED mode + and as such the problem will not stand. + + In STMT mode, although such statement is classified as unsafe, i.e. + + INSERT INTO myisam_t SELECT * FROM innodb_t; + + there is no enough information to avoid writing it outside the boundaries + of a transaction. This is not a problem if we are considering snapshot + isolation level but if we have pure repeatable read or serializable the + lock history on the slave will be different from the master. + */ + if (mixed_engine || + trans_has_updated_trans_table(this) && !all_trans_engines) + lex->set_stmt_unsafe(LEX::BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS); + DBUG_PRINT("info", ("flags_all_set: 0x%llx", flags_all_set)); DBUG_PRINT("info", ("flags_some_set: 0x%llx", flags_some_set)); DBUG_PRINT("info", ("multi_engine: %d", multi_engine)); @@ -3630,7 +3714,7 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id, if (binlog_setup_trx_data()) DBUG_RETURN(NULL); - Rows_log_event* pending= binlog_get_pending_rows_event(); + Rows_log_event* pending= binlog_get_pending_rows_event(is_transactional); if (unlikely(pending && !pending->is_valid())) DBUG_RETURN(NULL); @@ -3664,7 +3748,9 @@ THD::binlog_prepare_pending_rows_event(TABLE* table, uint32 serv_id, flush the pending event and replace it with the newly created event... */ - if (unlikely(mysql_bin_log.flush_and_set_pending_rows_event(this, ev))) + if (unlikely( + mysql_bin_log.flush_and_set_pending_rows_event(this, ev, + is_transactional))) { delete ev; DBUG_RETURN(NULL); @@ -3988,14 +4074,15 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans, } -int THD::binlog_remove_pending_rows_event(bool clear_maps) +int THD::binlog_remove_pending_rows_event(bool clear_maps, + bool is_transactional) { DBUG_ENTER("THD::binlog_remove_pending_rows_event"); if (!mysql_bin_log.is_open()) DBUG_RETURN(0); - mysql_bin_log.remove_pending_rows_event(this); + mysql_bin_log.remove_pending_rows_event(this, is_transactional); if (clear_maps) binlog_table_maps= 0; @@ -4003,7 +4090,7 @@ int THD::binlog_remove_pending_rows_event(bool clear_maps) DBUG_RETURN(0); } -int THD::binlog_flush_pending_rows_event(bool stmt_end) +int THD::binlog_flush_pending_rows_event(bool stmt_end, bool is_transactional) { DBUG_ENTER("THD::binlog_flush_pending_rows_event"); /* @@ -4019,7 +4106,7 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end) flag is set. */ int error= 0; - if (Rows_log_event *pending= binlog_get_pending_rows_event()) + if (Rows_log_event *pending= binlog_get_pending_rows_event(is_transactional)) { if (stmt_end) { @@ -4028,7 +4115,8 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end) binlog_table_maps= 0; } - error= mysql_bin_log.flush_and_set_pending_rows_event(this, 0); + error= mysql_bin_log.flush_and_set_pending_rows_event(this, 0, + is_transactional); } DBUG_RETURN(error); @@ -4144,8 +4232,8 @@ void THD::issue_unsafe_warnings() write failure), then the error code is returned. */ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, - ulong query_len, bool is_trans, bool suppress_use, - int errcode) + ulong query_len, bool is_trans, bool direct, + bool suppress_use, int errcode) { DBUG_ENTER("THD::binlog_query"); DBUG_PRINT("enter", ("qtype: %s query: '%s'", @@ -4162,7 +4250,7 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, top-most close_thread_tables(). */ if (this->prelocked_mode == NON_PRELOCKED) - if (int error= binlog_flush_pending_rows_event(TRUE)) + if (int error= binlog_flush_pending_rows_event(TRUE, is_trans)) DBUG_RETURN(error); /* @@ -4207,8 +4295,8 @@ int THD::binlog_query(THD::enum_binlog_query_type qtype, char const *query_arg, flush the pending rows event if necessary. */ { - Query_log_event qinfo(this, query_arg, query_len, is_trans, suppress_use, - errcode); + Query_log_event qinfo(this, query_arg, query_len, is_trans, direct, + suppress_use, errcode); qinfo.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F; /* Binlog table maps will be irrelevant after a Query_log_event diff --git a/sql/sql_class.h b/sql/sql_class.h index 521884f3f4d..b6950108be4 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -1427,10 +1427,15 @@ public: size_t needed, bool is_transactional, RowsEventT* hint); - Rows_log_event* binlog_get_pending_rows_event() const; - void binlog_set_pending_rows_event(Rows_log_event* ev); - int binlog_flush_pending_rows_event(bool stmt_end); - int binlog_remove_pending_rows_event(bool clear_maps); + Rows_log_event* binlog_get_pending_rows_event(bool is_transactional) const; + void binlog_set_pending_rows_event(Rows_log_event* ev, bool is_transactional); + inline int binlog_flush_pending_rows_event(bool stmt_end) + { + return (binlog_flush_pending_rows_event(stmt_end, FALSE) || + binlog_flush_pending_rows_event(stmt_end, TRUE)); + } + int binlog_flush_pending_rows_event(bool stmt_end, bool is_transactional); + int binlog_remove_pending_rows_event(bool clear_maps, bool is_transactional); /** Determine the binlog format of the current statement. @@ -1494,6 +1499,9 @@ public: uint get_binlog_table_maps() const { return binlog_table_maps; } + void clear_binlog_table_maps() { + binlog_table_maps= 0; + } #endif /* MYSQL_CLIENT */ public: @@ -1959,8 +1967,8 @@ public: }; int binlog_query(enum_binlog_query_type qtype, - char const *query, ulong query_len, - bool is_trans, bool suppress_use, + char const *query, ulong query_len, bool is_trans, + bool direct, bool suppress_use, int errcode); #endif @@ -2009,6 +2017,21 @@ public: return 0; #endif } + /** + Returns TRUE if session is in a multi-statement transaction mode. + + OPTION_NOT_AUTOCOMMIT: When autocommit is off, a multi-statement + transaction is implicitly started on the first statement after a + previous transaction has been ended. + + OPTION_BEGIN: Regardless of the autocommit status, a multi-statement + transaction can be explicitly started with the statements "START + TRANSACTION", "BEGIN [WORK]", "[COMMIT | ROLLBACK] AND CHAIN", etc. + */ + inline bool in_multi_stmt_transaction() + { + return options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN); + } inline bool fill_derived_tables() { return !stmt_arena->is_stmt_prepare() && !lex->only_view_structure(); diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 3fca5bd7df6..770f68f0282 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -181,7 +181,7 @@ uchar* dboptions_get_key(my_dbopt_t *opt, size_t *length, static inline void write_to_binlog(THD *thd, char *query, uint q_len, char *db, uint db_len) { - Query_log_event qinfo(thd, query, q_len, 0, 0, 0); + Query_log_event qinfo(thd, query, q_len, FALSE, TRUE, FALSE, 0); qinfo.db= db; qinfo.db_len= db_len; mysql_bin_log.write(&qinfo); @@ -722,7 +722,7 @@ not_silent: if (mysql_bin_log.is_open()) { int errcode= query_error_code(thd, TRUE); - Query_log_event qinfo(thd, query, query_length, 0, + Query_log_event qinfo(thd, query, query_length, FALSE, TRUE, /* suppress_use */ TRUE, errcode); /* @@ -811,7 +811,7 @@ bool mysql_alter_db(THD *thd, const char *db, HA_CREATE_INFO *create_info) if (mysql_bin_log.is_open()) { int errcode= query_error_code(thd, TRUE); - Query_log_event qinfo(thd, thd->query, thd->query_length, 0, + Query_log_event qinfo(thd, thd->query, thd->query_length, FALSE, TRUE, /* suppress_use */ TRUE, errcode); /* @@ -959,7 +959,7 @@ bool mysql_rm_db(THD *thd,char *db,bool if_exists, bool silent) if (mysql_bin_log.is_open()) { int errcode= query_error_code(thd, TRUE); - Query_log_event qinfo(thd, query, query_length, 0, + Query_log_event qinfo(thd, query, query_length, FALSE, TRUE, /* suppress_use */ TRUE, errcode); /* Write should use the database being created as the "current @@ -1961,7 +1961,7 @@ bool mysql_upgrade_db(THD *thd, LEX_STRING *old_db) { int errcode= query_error_code(thd, TRUE); Query_log_event qinfo(thd, thd->query, thd->query_length, - 0, TRUE, errcode); + FALSE, TRUE, TRUE, errcode); thd->clear_error(); mysql_bin_log.write(&qinfo); } diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 7fa7e39e5bf..c851ffdcc09 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -385,7 +385,8 @@ cleanup: transactional_table= table->file->has_transactions(); if (!transactional_table && deleted > 0) - thd->transaction.stmt.modified_non_trans_table= TRUE; + thd->transaction.stmt.modified_non_trans_table= + thd->transaction.all.modified_non_trans_table= TRUE; /* See similar binlogging code in sql_update.cc, for comments */ if ((error < 0) || thd->transaction.stmt.modified_non_trans_table) @@ -414,15 +415,13 @@ cleanup: */ int log_result= thd->binlog_query(query_type, thd->query, thd->query_length, - is_trans, FALSE, errcode); + is_trans, FALSE, FALSE, errcode); if (log_result) { error=1; } } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; } DBUG_ASSERT(transactional_table || !deleted || thd->transaction.stmt.modified_non_trans_table); free_underlaid_joins(thd, select_lex); @@ -808,6 +807,9 @@ void multi_delete::abort() if (deleted) query_cache_invalidate3(thd, delete_tables, 1); + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; + /* If rows from the first table only has been deleted and it is transactional, just do rollback. @@ -838,9 +840,8 @@ void multi_delete::abort() int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_tables, FALSE, errcode); + transactional_tables, FALSE, FALSE, errcode); } - thd->transaction.all.modified_non_trans_table= true; } DBUG_VOID_RETURN; } @@ -967,6 +968,9 @@ bool multi_delete::send_eof() /* reset used flags */ thd_proc_info(thd, "end"); + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; + /* We must invalidate the query cache before binlog writing and ha_autocommit_... @@ -986,14 +990,12 @@ bool multi_delete::send_eof() errcode= query_error_code(thd, killed_status == THD::NOT_KILLED); if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_tables, FALSE, errcode) && + transactional_tables, FALSE, FALSE, errcode) && !normal_tables) { local_error=1; // Log write failed: roll back the SQL statement } } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; } if (local_error != 0) error_handled= TRUE; // to force early leave from ::send_error() diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index e5b03a1d44d..4bb2045c06c 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -856,6 +856,10 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, */ query_cache_invalidate3(thd, table_list, 1); } + + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; + if ((changed && error <= 0) || thd->transaction.stmt.modified_non_trans_table || was_insert_delayed) @@ -895,14 +899,12 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list, DBUG_ASSERT(thd->killed != THD::KILL_BAD_DATA || error > 0); if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_table, FALSE, - errcode)) + transactional_table, FALSE, FALSE, + errcode)) { error=1; } } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; } DBUG_ASSERT(transactional_table || !changed || thd->transaction.stmt.modified_non_trans_table); @@ -2565,6 +2567,7 @@ bool Delayed_insert::handle_inserts(void) { int error; ulong max_rows; + bool has_trans = TRUE; bool using_ignore= 0, using_opt_replace= 0, using_bin_log= mysql_bin_log.is_open(); delayed_row *row; @@ -2717,7 +2720,7 @@ bool Delayed_insert::handle_inserts(void) */ thd.binlog_query(THD::ROW_QUERY_TYPE, row->query.str, row->query.length, - FALSE, FALSE, errcode); + FALSE, FALSE, FALSE, errcode); thd.time_zone_used = backup_time_zone_used; thd.variables.time_zone = backup_time_zone; @@ -2785,9 +2788,11 @@ bool Delayed_insert::handle_inserts(void) or trigger. TODO: Move the logging to last in the sequence of rows. - */ + */ + has_trans= thd.lex->sql_command == SQLCOM_CREATE_TABLE || + table->file->has_transactions(); if (thd.is_current_stmt_binlog_format_row()) - thd.binlog_flush_pending_rows_event(TRUE); + thd.binlog_flush_pending_rows_event(TRUE, has_trans); if ((error=table->file->extra(HA_EXTRA_NO_CACHE))) { // This shouldn't happen @@ -3214,9 +3219,11 @@ bool select_insert::send_eof() and ha_autocommit_or_rollback. */ query_cache_invalidate3(thd, table, 1); - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; } + + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; + DBUG_ASSERT(trans_table || !changed || thd->transaction.stmt.modified_non_trans_table); @@ -3235,7 +3242,7 @@ bool select_insert::send_eof() errcode= query_error_code(thd, killed_status == THD::NOT_KILLED); thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - trans_table, FALSE, errcode); + trans_table, FALSE, FALSE, errcode); } table->file->ha_release_auto_increment(); @@ -3301,14 +3308,15 @@ void select_insert::abort() { transactional_table= table->file->has_transactions(); if (thd->transaction.stmt.modified_non_trans_table) { + if (!can_rollback_data()) + thd->transaction.all.modified_non_trans_table= TRUE; + if (mysql_bin_log.is_open()) { int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_table, FALSE, errcode); + transactional_table, FALSE, FALSE, errcode); } - if (!thd->is_current_stmt_binlog_format_row() && !can_rollback_data()) - thd->transaction.all.modified_non_trans_table= TRUE; if (changed) query_cache_invalidate3(thd, table, 1); } @@ -3709,6 +3717,7 @@ select_create::binlog_show_create_table(TABLE **tables, uint count) thd->binlog_query(THD::STMT_QUERY_TYPE, query.ptr(), query.length(), /* is_trans */ TRUE, + /* direct */ FALSE, /* suppress_use */ FALSE, errcode); } @@ -3809,7 +3818,7 @@ void select_create::abort() select_insert::abort(); thd->transaction.stmt.modified_non_trans_table= FALSE; reenable_binlog(thd); - thd->binlog_flush_pending_rows_event(TRUE); + thd->binlog_flush_pending_rows_event(TRUE, TRUE); if (m_plock) { diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index a36b947fecc..a08338f4c76 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -44,7 +44,8 @@ Query_tables_list::binlog_stmt_unsafe_errcode[BINLOG_STMT_UNSAFE_COUNT] = ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS, ER_BINLOG_UNSAFE_UDF, ER_BINLOG_UNSAFE_SYSTEM_VARIABLE, - ER_BINLOG_UNSAFE_SYSTEM_FUNCTION + ER_BINLOG_UNSAFE_SYSTEM_FUNCTION, + ER_BINLOG_UNSAFE_NONTRANS_AFTER_TRANS }; diff --git a/sql/sql_lex.h b/sql/sql_lex.h index db4b8701635..3e278f784a6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1094,6 +1094,13 @@ public: */ BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION, + /** + Mixing transactional and non-transactional statements are unsafe if + non-transactional reads or writes are occur after transactional + reads or writes inside a transaction. + */ + BINLOG_STMT_UNSAFE_NONTRANS_AFTER_TRANS, + /* The last element of this enumeration type. */ BINLOG_STMT_UNSAFE_COUNT }; diff --git a/sql/sql_load.cc b/sql/sql_load.cc index ab5f3165974..986af637931 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -530,7 +530,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, after this point. */ if (thd->is_current_stmt_binlog_format_row()) - thd->binlog_flush_pending_rows_event(true); + thd->binlog_flush_pending_rows_event(TRUE, transactional_table); else { /* @@ -575,7 +575,7 @@ static bool write_execute_load_query_log_event(THD *thd, (uint) ((char*)thd->lex->fname_end - (char*)thd->query), (duplicates == DUP_REPLACE) ? LOAD_DUP_REPLACE : (ignore ? LOAD_DUP_IGNORE : LOAD_DUP_ERROR), - transactional_table, FALSE, errcode); + transactional_table, FALSE, FALSE, errcode); e.flags|= LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F; return mysql_bin_log.write(&e); } diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 84868cfb509..1d6c5ba48b4 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1730,7 +1730,7 @@ end: */ void write_bin_log(THD *thd, bool clear_error, - char const *query, ulong query_length) + char const *query, ulong query_length, bool is_trans) { if (mysql_bin_log.is_open()) { @@ -1739,8 +1739,9 @@ void write_bin_log(THD *thd, bool clear_error, thd->clear_error(); else errcode= query_error_code(thd, TRUE); + thd->binlog_query(THD::STMT_QUERY_TYPE, - query, query_length, FALSE, FALSE, errcode); + query, query_length, is_trans, FALSE, FALSE, errcode); } } @@ -2127,7 +2128,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, */ built_tmp_query.chop(); // Chop of the last comma built_tmp_query.append(" /* generated by server */"); - write_bin_log(thd, !error, built_tmp_query.ptr(), built_tmp_query.length()); + write_bin_log(thd, !error, built_tmp_query.ptr(), built_tmp_query.length(), + thd->in_multi_stmt_transaction()); } } @@ -6525,7 +6527,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - 0, FALSE, 0); + FALSE, TRUE, FALSE, 0); mysql_bin_log.write(&qinfo); } my_ok(thd); diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b0085864108..c2b0c66d3a6 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -789,6 +789,9 @@ int mysql_update(THD *thd, { query_cache_invalidate3(thd, table_list, 1); } + + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; /* error < 0 means really no error at all: we processed all rows until the @@ -811,13 +814,11 @@ int mysql_update(THD *thd, if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_table, FALSE, errcode)) + transactional_table, FALSE, FALSE, errcode)) { error=1; // Rollback update } } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; } DBUG_ASSERT(transactional_table || !updated || thd->transaction.stmt.modified_non_trans_table); free_underlaid_joins(thd, select_lex); @@ -1735,10 +1736,10 @@ bool multi_update::send_data(List ¬_used_values) /* non-transactional or transactional table got modified */ /* either multi_update class' flag is raised in its branch */ if (table->file->has_transactions()) - transactional_tables= 1; + transactional_tables= TRUE; else { - trans_safe= 0; + trans_safe= FALSE; thd->transaction.stmt.modified_non_trans_table= TRUE; } } @@ -1848,7 +1849,7 @@ void multi_update::abort() int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED); thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_tables, FALSE, errcode); + transactional_tables, FALSE, FALSE, errcode); } thd->transaction.all.modified_non_trans_table= TRUE; } @@ -1986,10 +1987,10 @@ int multi_update::do_updates() if (updated != org_updated) { if (table->file->has_transactions()) - transactional_tables= 1; + transactional_tables= TRUE; else { - trans_safe= 0; // Can't do safe rollback + trans_safe= FALSE; // Can't do safe rollback thd->transaction.stmt.modified_non_trans_table= TRUE; } } @@ -2019,10 +2020,10 @@ err2: if (updated != org_updated) { if (table->file->has_transactions()) - transactional_tables= 1; + transactional_tables= TRUE; else { - trans_safe= 0; + trans_safe= FALSE; thd->transaction.stmt.modified_non_trans_table= TRUE; } } @@ -2068,8 +2069,9 @@ bool multi_update::send_eof() either from the query's list or via a stored routine: bug#13270,23333 */ - DBUG_ASSERT(trans_safe || !updated || - thd->transaction.stmt.modified_non_trans_table); + if (thd->transaction.stmt.modified_non_trans_table) + thd->transaction.all.modified_non_trans_table= TRUE; + if (local_error == 0 || thd->transaction.stmt.modified_non_trans_table) { if (mysql_bin_log.is_open()) @@ -2081,14 +2083,15 @@ bool multi_update::send_eof() errcode= query_error_code(thd, killed_status == THD::NOT_KILLED); if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query, thd->query_length, - transactional_tables, FALSE, errcode)) + transactional_tables, FALSE, FALSE, errcode)) { local_error= 1; // Rollback update } } - if (thd->transaction.stmt.modified_non_trans_table) - thd->transaction.all.modified_non_trans_table= TRUE; } + DBUG_ASSERT(trans_safe || !updated || + thd->transaction.stmt.modified_non_trans_table); + if (local_error != 0) error_handled= TRUE; // to force early leave from ::send_error() diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 8b00b8f0d9b..9b583f2e869 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -663,7 +663,7 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views, int errcode= query_error_code(thd, TRUE); thd->binlog_query(THD::STMT_QUERY_TYPE, - buff.ptr(), buff.length(), FALSE, FALSE, errcode); + buff.ptr(), buff.length(), FALSE, FALSE, FALSE, errcode); } VOID(pthread_mutex_unlock(&LOCK_open)); From 6ed2c82436e405518e48ffd245cf1b9509a3c2af Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 11 Nov 2009 13:51:49 +0000 Subject: [PATCH 16/69] Post-fix for merge mysql-5.1-rep+2 --> mysql-5.1-rep+3 mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test: Re-enabled some parts of the test after BUG#46572 mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result: Re-enabled some parts of the test after BUG#46572 mysql-test/suite/rpl/r/rpl_mysql_upgrade.result: Suppressed warning messages due to unsafe statements. mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result: Re-enabled some parts of the test after BUG#46572 mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result: Re-enabled some parts of the test after BUG#46572 mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test: Re-enabled some parts of the test after BUG#46572 mysql-test/suite/rpl/t/rpl_mysql_upgrade.test: Suppressed warning messages due to unsafe statements. mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test: Re-enabled some parts of the test after BUG#46572 mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test: Re-enabled some parts of the test after BUG#46572 --- .../rpl_tests/rpl_implicit_commit_binlog.test | 22 +++++++------------ .../r/rpl_mixed_implicit_commit_binlog.result | 9 ++++++++ .../suite/rpl/r/rpl_mysql_upgrade.result | 1 + .../r/rpl_row_implicit_commit_binlog.result | 9 ++++++++ .../r/rpl_stm_implicit_commit_binlog.result | 9 ++++++++ .../t/rpl_mixed_implicit_commit_binlog.test | 3 +-- mysql-test/suite/rpl/t/rpl_mysql_upgrade.test | 2 ++ .../rpl/t/rpl_row_implicit_commit_binlog.test | 3 +-- .../rpl/t/rpl_stm_implicit_commit_binlog.test | 3 +-- 9 files changed, 41 insertions(+), 20 deletions(-) diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index 39190611983..1cf99c9e92e 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -19,8 +19,7 @@ --echo ######################################################################### --echo # CONFIGURATION --echo ######################################################################### -#Re-enable this after fixing BUG#46572 -#connection master; +connection master; CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; @@ -353,23 +352,18 @@ SET AUTOCOMMIT= 1; --echo ################################################################################### --echo # CHECK CONSISTENCY --echo ################################################################################### -# Re-enable this after fixing BUG#46572 -# #--sync_slave_with_master -# -# #--let $diff_table_1= master:test.tt_1 -# #--let $diff_table_2= slave:test.tt_1 -# #--source include/diff_tables.inc -# +--sync_slave_with_master + +--let $diff_table_1= master:test.tt_1 +--let $diff_table_2= slave:test.tt_1 +--source include/diff_tables.inc --echo ################################################################################### --echo # CLEAN --echo ################################################################################### -#Re-enable this after fixing BUG#46572 -#connection master; +connection master; DROP TABLE tt_1; DROP TABLE tt_2; - -#Re-enable this after fixing BUG#46572 -#sync_slave_with_master; +sync_slave_with_master; diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index 39d68c75ca0..2641df307b4 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -1,3 +1,9 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; ######################################################################### # CONFIGURATION ######################################################################### @@ -524,6 +530,9 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db ################################################################################### # CHECK CONSISTENCY ################################################################################### +Comparing tables master:test.tt_1 and slave:test.tt_1 ################################################################################### # CLEAN ################################################################################### +DROP TABLE tt_1; +DROP TABLE tt_2; diff --git a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result index 09a9121d22c..f7bb14d1adb 100644 --- a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result +++ b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result @@ -4,6 +4,7 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`; CREATE DATABASE `#mysql50#mysqltest-1`; Master position is not changed diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result index bc53057e5a1..8704eb566a3 100644 --- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result @@ -1,3 +1,9 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; ######################################################################### # CONFIGURATION ######################################################################### @@ -565,6 +571,9 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db ################################################################################### # CHECK CONSISTENCY ################################################################################### +Comparing tables master:test.tt_1 and slave:test.tt_1 ################################################################################### # CLEAN ################################################################################### +DROP TABLE tt_1; +DROP TABLE tt_2; diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result index 7365f4591e5..02e7a34ef2d 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result @@ -1,3 +1,9 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; ######################################################################### # CONFIGURATION ######################################################################### @@ -523,6 +529,9 @@ master-bin.000001 # Query # # DROP DATABASE IF EXISTS db ################################################################################### # CHECK CONSISTENCY ################################################################################### +Comparing tables master:test.tt_1 and slave:test.tt_1 ################################################################################### # CLEAN ################################################################################### +DROP TABLE tt_1; +DROP TABLE tt_2; diff --git a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test index c12427ba350..7c406aa560f 100644 --- a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test +++ b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test @@ -2,8 +2,7 @@ # Check file extra/rpl_tests/rpl_implicit_commit_binlog.test ################################################################################ --source include/have_binlog_format_mixed.inc -#Re-enable this after fixing BUG#46572 -#--source include/master-slave.inc +--source include/master-slave.inc --source include/have_innodb.inc --source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test index bf5c6d2b921..273d8f692a2 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test +++ b/mysql-test/suite/rpl/t/rpl_mysql_upgrade.test @@ -10,6 +10,8 @@ # Only run test if "mysql_upgrade" is found --source include/have_mysql_upgrade.inc +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); + connection master; --disable_warnings DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`; diff --git a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test index 25764f1acc9..f5ee09ffacf 100644 --- a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test @@ -2,8 +2,7 @@ # Check file extra/rpl_tests/rpl_implicit_commit_binlog.test ################################################################################ --source include/have_binlog_format_row.inc -#Re-enable this after fixing BUG#46572 -#--source include/master-slave.inc +--source include/master-slave.inc --source include/have_innodb.inc --source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test index be1906f39d3..392a2defc42 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test +++ b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test @@ -2,8 +2,7 @@ # Check file extra/rpl_tests/rpl_implicit_commit_binlog.test ################################################################################ --source include/have_binlog_format_statement.inc -#Re-enable this after fixing BUG#46572 -#--source include/master-slave.inc +--source include/master-slave.inc --source include/have_innodb.inc --source extra/rpl_tests/rpl_implicit_commit_binlog.test From 518f79326559486135a131357bbd02e10e93acf8 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Wed, 11 Nov 2009 16:35:58 +0000 Subject: [PATCH 17/69] Post-fix after mysql-5.1-rep+2 --> mysql-5.1-rep+3. mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test: Merged the test case into rpl_mixing_engines.test. mysql-test/extra/rpl_tests/rpl_mixing_engines.inc: Incorporated some tests from binlog_failure_mixing_engines.test and fixed after BUG#47323. mysql-test/extra/rpl_tests/rpl_mixing_engines.test: Incorporated some tests from binlog_failure_mixing_engines.test and fixed after BUG#47323. mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result: Merged the test case into rpl_mixing_engines.test. mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result: Merged the test case into rpl_mixing_engines.test. mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test: Merged the test case into rpl_mixing_engines.test. mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test: Merged the test case into rpl_mixing_engines.test. mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result: Incorporated some tests from binlog_failure_mixing_engines.test and changed after BUG#47323. mysql-test/suite/rpl/r/rpl_row_mixing_engines.result: Incorporated some tests from binlog_failure_mixing_engines.test and changed after BUG#47323. mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result: Incorporated some tests from binlog_failure_mixing_engines.test and changed after BUG#47323. --- .../binlog_failure_mixing_engines.test | 300 ----- .../extra/rpl_tests/rpl_mixing_engines.inc | 77 +- .../extra/rpl_tests/rpl_mixing_engines.test | 116 +- ...binlog_mixed_failure_mixing_engines.result | 398 ------ .../binlog_row_failure_mixing_engines.result | 414 ------ .../binlog_mixed_failure_mixing_engines.test | 4 - .../t/binlog_row_failure_mixing_engines.test | 4 - .../rpl/r/rpl_mixed_mixing_engines.result | 1005 +++++++++++++-- .../suite/rpl/r/rpl_row_mixing_engines.result | 1113 +++++++++++++++-- .../suite/rpl/r/rpl_stm_mixing_engines.result | 954 ++++++++++++-- 10 files changed, 2997 insertions(+), 1388 deletions(-) delete mode 100644 mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test delete mode 100644 mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result delete mode 100644 mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result delete mode 100644 mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test delete mode 100644 mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test diff --git a/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test b/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test deleted file mode 100644 index 54f3c538c79..00000000000 --- a/mysql-test/extra/binlog_tests/binlog_failure_mixing_engines.test +++ /dev/null @@ -1,300 +0,0 @@ -################################################################################ -# Let -# - B be begin, C commit and R rollback. -# - T a statement that accesses and changes only transactional tables, i.e. -# T-tables -# - N a statement that accesses and changes only non-transactional tables, -# i.e, N-tables. -# - M be a mixed statement, i.e. a statement that updates both T- and -# N-tables. -# - M* be a mixed statement that fails while updating either a T -# or N-table. -# - N* be a statement that fails while updating a N-table. -# -# In this test case, when changes are logged as rows either in the RBR or MIXED -# modes, we check if a M* statement that happens early in a transaction is -# written to the binary log outside the boundaries of the transaction and -# wrapped up in a BEGIN/ROLLBACK. This is done to keep the slave consistent with -# the master as the rollback will keep the changes on N-tables and undo them on -# T-tables. In particular, we expect the following behavior: -# -# 1. B M* T C would generate in the binlog B M* R B T C. -# 2. B M M* C would generate in the binlog B M M* C. -# 3. B M* M* T C would generate in the binlog B M* R B M* R B T C. -# -# SBR is not considered in this test because a failing statement is written to -# the binary along with the error code such that a slave executes and rolls it -# back, thus undoing the effects on T-tables. -# -# Note that, in the first case, we are not preserving history from the master as -# we are introducing a rollback that never happened. However, this seems to be -# more acceptable than making the slave diverge. In the second case, the slave -# will diverge as the changes on T-tables that originated from the M statement -# are rolled back on the master but not on the slave. Unfortunately, we cannot -# simply roll the transaction back as this would undo any uncommitted changes -# on T-tables. -# -# We check two more cases. First, INSERT...SELECT* which produces the following -# results: -# -# 1. B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates in -# the binlog the following entries: "Nothing". -# 2. B INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates in -# the binlog the following entries: B INSERT M...SELECT* R. -# -# Finally, we also check if any N statement that happens early in a transaction -# (i.e. before any T or M statement) is written to the binary log outside the -# boundaries of the transaction. In particular, we expect the following -# behavior: -# -# 1. B N N T C would generate in the binlog B N C B N C B T C. -# 2. B N N T R would generate in the binlog B N C B N C B T R. -# 3. B N* N* T C would generate in the binlog B N R B N R B T C. -# 4. B N* N* T R would generate in the binlog B N R B N R B T R. -# 5. B N N T N T C would generate in the binlog B N C B N C B T N T C. -# 6. B N N T N T R would generate in the binlog the B N C B N C B T N T R. -# -# Such issues do not happen in SBR. In RBR and MBR, a full-fledged fix will be -# pushed after the WL#2687. -# -# Please, remove this test case after pushing WL#2687. -################################################################################ - - ---echo ################################################################################### ---echo # CONFIGURATION ---echo ################################################################################### -CREATE TABLE nt_1 (a text, b int PRIMARY KEY) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY) ENGINE = Innodb; - -DELIMITER |; - -CREATE TRIGGER tr_i_tt_1_to_nt_1 BEFORE INSERT ON tt_1 FOR EACH ROW -BEGIN - INSERT INTO nt_1 VALUES (NEW.a, NEW.b); -END| - -CREATE TRIGGER tr_i_nt_2_to_tt_2 BEFORE INSERT ON nt_2 FOR EACH ROW -BEGIN - INSERT INTO tt_2 VALUES (NEW.a, NEW.b); -END| - -DELIMITER ;| - ---echo ################################################################################### ---echo # CHECK HISTORY IN BINLOG ---echo ################################################################################### ---echo ---echo ---echo ---echo *** "B M* T C" with error in M* generates in the binlog the "B M* R B T C" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO nt_1 VALUES ("new text 1", 1); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES (USER(), 2), (USER(), 1); -INSERT INTO tt_2 VALUES ("new text 3", 3); -COMMIT; ---source include/show_binlog_events.inc - ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO tt_2 VALUES ("new text 4", 4); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO nt_2 VALUES (USER(), 5), (USER(), 4); -INSERT INTO tt_2 VALUES ("new text 6", 6); -COMMIT; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B M M* T C" with error in M* generates in the binlog the "B M M* T C" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO nt_1 VALUES ("new text 10", 10); -BEGIN; -INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8); ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES (USER(), 9), (USER(), 10); -INSERT INTO tt_2 VALUES ("new text 11", 11); -COMMIT; ---source include/show_binlog_events.inc - ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO tt_2 VALUES ("new text 15", 15); -BEGIN; -INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13); ---error ER_DUP_ENTRY -INSERT INTO nt_2 VALUES (USER(), 14), (USER(), 15); -INSERT INTO tt_2 VALUES ("new text 16", 16); -COMMIT; ---source include/show_binlog_events.inc - - ---echo ---echo ---echo ---echo *** "B M* M* T C" with error in M* generates in the binlog the "B M* R B M* R B T C" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO nt_1 VALUES ("new text 18", 18); -INSERT INTO nt_1 VALUES ("new text 20", 20); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES (USER(), 17), (USER(), 18); ---error ER_DUP_ENTRY -INSERT INTO tt_1 VALUES (USER(), 19), (USER(), 20); -INSERT INTO tt_2 VALUES ("new text 21", 21); -COMMIT; ---source include/show_binlog_events.inc - ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -INSERT INTO tt_2 VALUES ("new text 23", 23); -INSERT INTO tt_2 VALUES ("new text 25", 25); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO nt_2 VALUES (USER(), 22), (USER(), 23); ---error ER_DUP_ENTRY -INSERT INTO nt_2 VALUES (USER(), 24), (USER(), 25); -INSERT INTO tt_2 VALUES ("new text 26", 26); -COMMIT; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates ---echo *** in the binlog the following entries: "Nothing". ---echo *** There is a bug in that will be fixed after WL#2687. Please, check BUG#47175 for further details. ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -TRUNCATE TABLE nt_2; -TRUNCATE TABLE tt_2; -INSERT INTO tt_2 VALUES ("new text 7", 7); -BEGIN; -INSERT INTO tt_2 VALUES ("new text 27", 27); ---error ER_DUP_ENTRY -INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1; -INSERT INTO tt_2 VALUES ("new text 28", 28); -ROLLBACK; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B INSERT M..SELECT* C" with an error in INSERT M...SELECT* generates ---echo *** in the binlog the following entries: "B INSERT M..SELECT* R". ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -TRUNCATE TABLE nt_2; -TRUNCATE TABLE tt_2; -INSERT INTO tt_2 VALUES ("new text 7", 7); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1; -COMMIT; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B N N T C" generates in the binlog the "B N C B N C B T C" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -TRUNCATE TABLE nt_1; -TRUNCATE TABLE tt_2; -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 1); -INSERT INTO nt_1 VALUES (USER(), 2); -INSERT INTO tt_2 VALUES (USER(), 3); -COMMIT; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B N N T R" generates in the binlog the "B N C B N C B T R" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 4); -INSERT INTO nt_1 VALUES (USER(), 5); -INSERT INTO tt_2 VALUES (USER(), 6); -ROLLBACK; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B N* N* T C" with error in N* generates in the binlog the "B N R B N R B T C" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES (USER(), 7), (USER(), 1); ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES (USER(), 8), (USER(), 1); -INSERT INTO tt_2 VALUES (USER(), 9); -COMMIT; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B N* N* T R" with error in N* generates in the binlog the "B N R B N R B T R" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES (USER(), 10), (USER(), 1); ---error ER_DUP_ENTRY -INSERT INTO nt_1 VALUES (USER(), 11), (USER(), 1); -INSERT INTO tt_2 VALUES (USER(), 12); -ROLLBACK; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B N N T N T C" generates in the binlog the "B N C B N C B T N T C" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 13); -INSERT INTO nt_1 VALUES (USER(), 14); -INSERT INTO tt_2 VALUES (USER(), 15); -INSERT INTO nt_1 VALUES (USER(), 16); -INSERT INTO tt_2 VALUES (USER(), 17); -COMMIT; ---source include/show_binlog_events.inc - ---echo ---echo ---echo ---echo *** "B N N T N T R" generates in the binlog the "B N C B N C B T N T R" entries ---echo -let $binlog_start= query_get_value("SHOW MASTER STATUS", Position, 1); -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 18); -INSERT INTO nt_1 VALUES (USER(), 19); -INSERT INTO tt_2 VALUES (USER(), 20); -INSERT INTO nt_1 VALUES (USER(), 21); -INSERT INTO tt_2 VALUES (USER(), 22); -ROLLBACK; ---source include/show_binlog_events.inc - ---echo ################################################################################### ---echo # CLEAN ---echo ################################################################################### - -DROP TABLE tt_1; -DROP TABLE tt_2; -DROP TABLE nt_1; -DROP TABLE nt_2; diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc index 68e67208f4a..0aead91e03d 100644 --- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc +++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc @@ -138,6 +138,7 @@ if (`SELECT HEX(@commands) = HEX('configure')`) let $pos_trans_command= query_get_value("SHOW MASTER STATUS", Position, 1); let $trans_id= 7; + let $tb_id= 1; let $stmt_id= 1; let $commands= ''; @@ -172,7 +173,7 @@ if (`SELECT HEX(@commands) = HEX('clean')`) SET @commands= ''; } -if (`SELECT HEX(@commands) != HEX('')`) +while (`SELECT HEX(@commands) != HEX('')`) { --disable_query_log SET @command= SUBSTRING_INDEX(@commands, ' ', 1); @@ -413,54 +414,104 @@ if (`SELECT HEX(@commands) != HEX('')`) } if (`SELECT HEX(@command) = HEX('CS-T->T')`) { - --eval CREATE TABLE tt_xx_$trans_id engine=$engine_type SELECT * FROM tt_1; + --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM tt_1; } if (`SELECT HEX(@command) = HEX('CS-N->N')`) { - --eval CREATE TABLE nt_xx_$trans_id engine=MyIsam SELECT * FROM nt_1; + --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1; } if (`SELECT HEX(@command) = HEX('CS-T->N')`) { - --eval CREATE TABLE tt_xx_$trans_id engine=$engine_type SELECT * FROM nt_1; + --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=$engine_type SELECT * FROM nt_1; } if (`SELECT HEX(@command) = HEX('CS-N->T')`) { - --eval CREATE TABLE nt_xx_$trans_id engine=MyIsam SELECT * FROM tt_1; + --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1; } if (`SELECT HEX(@command) = HEX('CSe-T->T')`) { --error ER_DUP_ENTRY, ER_DUP_KEY - --eval CREATE TABLE tt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM tt_1; + --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM tt_1; } if (`SELECT HEX(@command) = HEX('CSe-N->N')`) { --error ER_DUP_ENTRY, ER_DUP_KEY - --eval CREATE TABLE nt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1; + --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1; } if (`SELECT HEX(@command) = HEX('CSe-T->N')`) { --error ER_DUP_ENTRY, ER_DUP_KEY - --eval CREATE TABLE tt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM nt_1; + --eval CREATE TABLE tt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=$engine_type SELECT stmt_id FROM nt_1; } if (`SELECT HEX(@command) = HEX('CSe-N->T')`) { --error ER_DUP_ENTRY, ER_DUP_KEY - --eval CREATE TABLE nt_xx_$trans_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1; + --eval CREATE TABLE nt_xx_$tb_id (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1; } if (`SELECT HEX(@command) = HEX('CT')`) { - --eval CREATE TEMPORARY TABLE tt_xx_$trans_id (a int) engine=$engine_type; + --eval CREATE TEMPORARY TABLE tt_xx_$tb_id (a int) engine=$engine_type; + } + if (`SELECT HEX(@command) = HEX('IS-T<-N')`) + { + --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('ISe-T<-N')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('IS-N<-T')`) + { + --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('ISe-N<-T')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('IS-T<-T')`) + { + --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('ISe-T<-T')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval INSERT INTO tt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1; + } + if (`SELECT HEX(@command) = HEX('IS-N<-N')`) + { + --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('ISe-N<-N')`) + { + --error ER_DUP_ENTRY, ER_DUP_KEY + --eval INSERT INTO nt_xx_$tb_id(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1; + } + if (`SELECT HEX(@command) = HEX('trunc-CS-T')`) + { + eval TRUNCATE TABLE tt_xx_$tb_id; + } + if (`SELECT HEX(@command) = HEX('trunc-CS-N')`) + { + eval TRUNCATE TABLE nt_xx_$tb_id; + } + if (`SELECT HEX(@command) = HEX('trunc-CT')`) + { + eval TRUNCATE TABLE tt_xx_$tb_id; } if (`SELECT HEX(@command) = HEX('drop-CS')`) { --disable_warnings - eval DROP TABLE IF EXISTS tt_xx_$trans_id, nt_xx_$trans_id; + eval DROP TABLE IF EXISTS tt_xx_$tb_id, nt_xx_$tb_id; + inc $tb_id; --enable_warnings } if (`SELECT HEX(@command) = HEX('drop-CT')`) { --disable_warnings - eval DROP TEMPORARY TABLE IF EXISTS tt_xx_$trans_id; + eval DROP TEMPORARY TABLE IF EXISTS tt_xx_$tb_id; + inc $tb_id; --enable_warnings } if (`SELECT HEX(@command) = HEX('C')`) @@ -498,6 +549,4 @@ if (`SELECT HEX(@commands) != HEX('')`) inc $trans_id; let $commands= ''; } - - --source extra/rpl_tests/rpl_mixing_engines.inc } diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test index ea36a241664..b8b2b1bc01b 100644 --- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.test +++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.test @@ -214,9 +214,26 @@ # CSe-T->N - Fails while creating a T-table selecting from a a N-table. # CSe-N->T - Fails while creating a N-table selecting from a T-table. # drop-CS - Drops any of the tables previously created. +# trunc-CS-T - Truncates a T-table previously created. +# trunc-CS-N - Truncates a N-table previously created. # CT - Creates a temporary T-table. # drop-CT - Drops a temporary T-table. # +# - This is INSERT...SELECT: +# IS-T<-T - Inserts data from a T-table into a T-table. +# IS-T<-N - Inserts data from a N-table into a T-table. +# IS-N<-T - Inserts data from a T-table into a N-table. +# IS-N<-N - Inserts data from a N-table into a N-table. +# ISe-T<-T - Fails while inserting data from a T-table into a T-table. +# ISe-T<-N - Fails while inserting data from a N-table into a T-table. +# ISe-N<-T - Fails while inserting data from a T-table into a N-table. +# ISe-N<-N - Fails while inserting data from a N-table into a N-table. +# +# For the CREATE...SELECT and INSERT...SELECT, the table names are defined based +# on the variable $tb_id which is automatically incremented after each drop. +# This indirectly means that two tables cannot co-exist unless we manually keep +# the variable $tb_id. +# # The format of the entries in the binlog depends on the mode and on the type # statements: S - statement and R - row. And when it is clear from the context # which statement is referred to, we sometimes use "M" to denote a "Mixed" @@ -1624,27 +1641,124 @@ SET @commands= 'CSe-N->T CS-N->T drop-CS'; SET @commands= 'CSe-N->T CS-N->T drop-CS'; --source extra/rpl_tests/rpl_mixing_engines.inc + --echo ################################################################################### ---echo # 4 - ROLLBACK TEMPORARY TABLE +--echo # 4 - INSERT TABLE...SELECT +--echo ################################################################################### + +SET @commands= 'CS-T->T'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B T IS-T<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B T ISe-T<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B IS-T<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B ISe-T<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'CS-T->T'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B T IS-T<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B T ISe-T<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B IS-T<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-T B ISe-T<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'CS-N->N'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B T IS-N<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B T ISe-N<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B IS-N<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B ISe-N<-T T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'CS-N->N'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B T IS-N<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B T ISe-N<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B IS-N<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'trunc-CS-N B ISe-N<-N T C'; +--source extra/rpl_tests/rpl_mixing_engines.inc + +SET @commands= 'drop-CS'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + +--echo ################################################################################### +--echo # 5 - ROLLBACK TEMPORARY TABLE --echo ################################################################################### SET @commands= 'B T CT R'; --source extra/rpl_tests/rpl_mixing_engines.inc +SET @commands= 'drop-CT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + SET @commands= 'B T S1 T CT R1 R'; --source extra/rpl_tests/rpl_mixing_engines.inc +SET @commands= 'drop-CT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + SET @commands= 'B T CT T R'; --source extra/rpl_tests/rpl_mixing_engines.inc +SET @commands= 'drop-CT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + SET @commands= 'B tN CT T R'; --source extra/rpl_tests/rpl_mixing_engines.inc +SET @commands= 'drop-CT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + SET @commands= 'B CT T R'; --source extra/rpl_tests/rpl_mixing_engines.inc +SET @commands= 'drop-CT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + SET @commands= 'B N CT T R'; --source extra/rpl_tests/rpl_mixing_engines.inc +SET @commands= 'drop-CT'; +--source extra/rpl_tests/rpl_mixing_engines.inc + + --echo ################################################################################### --echo # CHECK CONSISTENCY --echo ################################################################################### diff --git a/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result b/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result deleted file mode 100644 index 84dfead202a..00000000000 --- a/mysql-test/suite/binlog/r/binlog_mixed_failure_mixing_engines.result +++ /dev/null @@ -1,398 +0,0 @@ -################################################################################### -# CONFIGURATION -################################################################################### -CREATE TABLE nt_1 (a text, b int PRIMARY KEY) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY) ENGINE = Innodb; -CREATE TRIGGER tr_i_tt_1_to_nt_1 BEFORE INSERT ON tt_1 FOR EACH ROW -BEGIN -INSERT INTO nt_1 VALUES (NEW.a, NEW.b); -END| -CREATE TRIGGER tr_i_nt_2_to_tt_2 BEFORE INSERT ON nt_2 FOR EACH ROW -BEGIN -INSERT INTO tt_2 VALUES (NEW.a, NEW.b); -END| -################################################################################### -# CHECK HISTORY IN BINLOG -################################################################################### - - - -*** "B M* T C" with error in M* generates in the binlog the "B M* R B T C" entries - -INSERT INTO nt_1 VALUES ("new text 1", 1); -BEGIN; -INSERT INTO tt_1 VALUES (USER(), 2), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 3", 3); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 1", 1) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 3", 3) -master-bin.000001 # Xid # # COMMIT /* XID */ - -INSERT INTO tt_2 VALUES ("new text 4", 4); -BEGIN; -INSERT INTO nt_2 VALUES (USER(), 5), (USER(), 4); -ERROR 23000: Duplicate entry '4' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 6", 6); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 4", 4) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 6", 6) -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B M M* T C" with error in M* generates in the binlog the "B M M* T C" entries - -INSERT INTO nt_1 VALUES ("new text 10", 10); -BEGIN; -INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8); -INSERT INTO tt_1 VALUES (USER(), 9), (USER(), 10); -ERROR 23000: Duplicate entry '10' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 11", 11); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 10", 10) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 11", 11) -master-bin.000001 # Xid # # COMMIT /* XID */ - -INSERT INTO tt_2 VALUES ("new text 15", 15); -BEGIN; -INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13); -INSERT INTO nt_2 VALUES (USER(), 14), (USER(), 15); -ERROR 23000: Duplicate entry '15' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 16", 16); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 15", 15) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 16", 16) -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B M* M* T C" with error in M* generates in the binlog the "B M* R B M* R B T C" entries - -INSERT INTO nt_1 VALUES ("new text 18", 18); -INSERT INTO nt_1 VALUES ("new text 20", 20); -BEGIN; -INSERT INTO tt_1 VALUES (USER(), 17), (USER(), 18); -ERROR 23000: Duplicate entry '18' for key 'PRIMARY' -INSERT INTO tt_1 VALUES (USER(), 19), (USER(), 20); -ERROR 23000: Duplicate entry '20' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 21", 21); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 18", 18) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1 VALUES ("new text 20", 20) -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 21", 21) -master-bin.000001 # Xid # # COMMIT /* XID */ - -INSERT INTO tt_2 VALUES ("new text 23", 23); -INSERT INTO tt_2 VALUES ("new text 25", 25); -BEGIN; -INSERT INTO nt_2 VALUES (USER(), 22), (USER(), 23); -ERROR 23000: Duplicate entry '23' for key 'PRIMARY' -INSERT INTO nt_2 VALUES (USER(), 24), (USER(), 25); -ERROR 23000: Duplicate entry '25' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 26", 26); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 23", 23) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 25", 25) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 26", 26) -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates -*** in the binlog the following entries: "Nothing". -*** There is a bug in that will be fixed after WL#2687. Please, check BUG#47175 for further details. - -TRUNCATE TABLE nt_2; -TRUNCATE TABLE tt_2; -INSERT INTO tt_2 VALUES ("new text 7", 7); -BEGIN; -INSERT INTO tt_2 VALUES ("new text 27", 27); -INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1; -ERROR 23000: Duplicate entry '7' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 28", 28); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2 -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 7", 7) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B INSERT M..SELECT* C" with an error in INSERT M...SELECT* generates -*** in the binlog the following entries: "B INSERT M..SELECT* R". - -TRUNCATE TABLE nt_2; -TRUNCATE TABLE tt_2; -INSERT INTO tt_2 VALUES ("new text 7", 7); -BEGIN; -INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1; -ERROR 23000: Duplicate entry '7' for key 'PRIMARY' -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2 -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_2 VALUES ("new text 7", 7) -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B N N T C" generates in the binlog the "B N C B N C B T C" entries - -TRUNCATE TABLE nt_1; -TRUNCATE TABLE tt_2; -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 1); -INSERT INTO nt_1 VALUES (USER(), 2); -INSERT INTO tt_2 VALUES (USER(), 3); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_1 -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B N N T R" generates in the binlog the "B N C B N C B T R" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 4); -INSERT INTO nt_1 VALUES (USER(), 5); -INSERT INTO tt_2 VALUES (USER(), 6); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B N* N* T C" with error in N* generates in the binlog the "B N R B N R B T C" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 7), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO nt_1 VALUES (USER(), 8), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO tt_2 VALUES (USER(), 9); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B N* N* T R" with error in N* generates in the binlog the "B N R B N R B T R" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 10), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO nt_1 VALUES (USER(), 11), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO tt_2 VALUES (USER(), 12); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B N N T N T C" generates in the binlog the "B N C B N C B T N T C" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 13); -INSERT INTO nt_1 VALUES (USER(), 14); -INSERT INTO tt_2 VALUES (USER(), 15); -INSERT INTO nt_1 VALUES (USER(), 16); -INSERT INTO tt_2 VALUES (USER(), 17); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B N N T N T R" generates in the binlog the "B N C B N C B T N T R" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 18); -INSERT INTO nt_1 VALUES (USER(), 19); -INSERT INTO tt_2 VALUES (USER(), 20); -INSERT INTO nt_1 VALUES (USER(), 21); -INSERT INTO tt_2 VALUES (USER(), 22); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -################################################################################### -# CLEAN -################################################################################### -DROP TABLE tt_1; -DROP TABLE tt_2; -DROP TABLE nt_1; -DROP TABLE nt_2; diff --git a/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result b/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result deleted file mode 100644 index ef9eebd142f..00000000000 --- a/mysql-test/suite/binlog/r/binlog_row_failure_mixing_engines.result +++ /dev/null @@ -1,414 +0,0 @@ -################################################################################### -# CONFIGURATION -################################################################################### -CREATE TABLE nt_1 (a text, b int PRIMARY KEY) ENGINE = MyISAM; -CREATE TABLE nt_2 (a text, b int PRIMARY KEY) ENGINE = MyISAM; -CREATE TABLE tt_1 (a text, b int PRIMARY KEY) ENGINE = Innodb; -CREATE TABLE tt_2 (a text, b int PRIMARY KEY) ENGINE = Innodb; -CREATE TRIGGER tr_i_tt_1_to_nt_1 BEFORE INSERT ON tt_1 FOR EACH ROW -BEGIN -INSERT INTO nt_1 VALUES (NEW.a, NEW.b); -END| -CREATE TRIGGER tr_i_nt_2_to_tt_2 BEFORE INSERT ON nt_2 FOR EACH ROW -BEGIN -INSERT INTO tt_2 VALUES (NEW.a, NEW.b); -END| -################################################################################### -# CHECK HISTORY IN BINLOG -################################################################################### - - - -*** "B M* T C" with error in M* generates in the binlog the "B M* R B T C" entries - -INSERT INTO nt_1 VALUES ("new text 1", 1); -BEGIN; -INSERT INTO tt_1 VALUES (USER(), 2), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 3", 3); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - -INSERT INTO tt_2 VALUES ("new text 4", 4); -BEGIN; -INSERT INTO nt_2 VALUES (USER(), 5), (USER(), 4); -ERROR 23000: Duplicate entry '4' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 6", 6); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B M M* T C" with error in M* generates in the binlog the "B M M* T C" entries - -INSERT INTO nt_1 VALUES ("new text 10", 10); -BEGIN; -INSERT INTO tt_1 VALUES ("new text 7", 7), ("new text 8", 8); -INSERT INTO tt_1 VALUES (USER(), 9), (USER(), 10); -ERROR 23000: Duplicate entry '10' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 11", 11); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - -INSERT INTO tt_2 VALUES ("new text 15", 15); -BEGIN; -INSERT INTO nt_2 VALUES ("new text 12", 12), ("new text 13", 13); -INSERT INTO nt_2 VALUES (USER(), 14), (USER(), 15); -ERROR 23000: Duplicate entry '15' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 16", 16); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B M* M* T C" with error in M* generates in the binlog the "B M* R B M* R B T C" entries - -INSERT INTO nt_1 VALUES ("new text 18", 18); -INSERT INTO nt_1 VALUES ("new text 20", 20); -BEGIN; -INSERT INTO tt_1 VALUES (USER(), 17), (USER(), 18); -ERROR 23000: Duplicate entry '18' for key 'PRIMARY' -INSERT INTO tt_1 VALUES (USER(), 19), (USER(), 20); -ERROR 23000: Duplicate entry '20' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 21", 21); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - -INSERT INTO tt_2 VALUES ("new text 23", 23); -INSERT INTO tt_2 VALUES ("new text 25", 25); -BEGIN; -INSERT INTO nt_2 VALUES (USER(), 22), (USER(), 23); -ERROR 23000: Duplicate entry '23' for key 'PRIMARY' -INSERT INTO nt_2 VALUES (USER(), 24), (USER(), 25); -ERROR 23000: Duplicate entry '25' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 26", 26); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B T INSERT M...SELECT* C" with an error in INSERT M...SELECT* generates -*** in the binlog the following entries: "Nothing". -*** There is a bug in that will be fixed after WL#2687. Please, check BUG#47175 for further details. - -TRUNCATE TABLE nt_2; -TRUNCATE TABLE tt_2; -INSERT INTO tt_2 VALUES ("new text 7", 7); -BEGIN; -INSERT INTO tt_2 VALUES ("new text 27", 27); -INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1; -ERROR 23000: Duplicate entry '7' for key 'PRIMARY' -INSERT INTO tt_2 VALUES ("new text 28", 28); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2 -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B INSERT M..SELECT* C" with an error in INSERT M...SELECT* generates -*** in the binlog the following entries: "B INSERT M..SELECT* R". - -TRUNCATE TABLE nt_2; -TRUNCATE TABLE tt_2; -INSERT INTO tt_2 VALUES ("new text 7", 7); -BEGIN; -INSERT INTO nt_2(a, b) SELECT USER(), b FROM nt_1; -ERROR 23000: Duplicate entry '7' for key 'PRIMARY' -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_2 -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B N N T C" generates in the binlog the "B N C B N C B T C" entries - -TRUNCATE TABLE nt_1; -TRUNCATE TABLE tt_2; -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 1); -INSERT INTO nt_1 VALUES (USER(), 2); -INSERT INTO tt_2 VALUES (USER(), 3); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_1 -master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_2 -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B N N T R" generates in the binlog the "B N C B N C B T R" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 4); -INSERT INTO nt_1 VALUES (USER(), 5); -INSERT INTO tt_2 VALUES (USER(), 6); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B N* N* T C" with error in N* generates in the binlog the "B N R B N R B T C" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 7), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO nt_1 VALUES (USER(), 8), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO tt_2 VALUES (USER(), 9); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B N* N* T R" with error in N* generates in the binlog the "B N R B N R B T R" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 10), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO nt_1 VALUES (USER(), 11), (USER(), 1); -ERROR 23000: Duplicate entry '1' for key 'PRIMARY' -INSERT INTO tt_2 VALUES (USER(), 12); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT - - - -*** "B N N T N T C" generates in the binlog the "B N C B N C B T N T C" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 13); -INSERT INTO nt_1 VALUES (USER(), 14); -INSERT INTO tt_2 VALUES (USER(), 15); -INSERT INTO nt_1 VALUES (USER(), 16); -INSERT INTO tt_2 VALUES (USER(), 17); -COMMIT; -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Table_map # # table_id: # (test.tt_2) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ - - - -*** "B N N T N T R" generates in the binlog the "B N C B N C B T N T R" entries - -BEGIN; -INSERT INTO nt_1 VALUES (USER(), 18); -INSERT INTO nt_1 VALUES (USER(), 19); -INSERT INTO tt_2 VALUES (USER(), 20); -INSERT INTO nt_1 VALUES (USER(), 21); -INSERT INTO tt_2 VALUES (USER(), 22); -ROLLBACK; -Warnings: -Warning 1196 Some non-transactional changed tables couldn't be rolled back -show binlog events from ; -Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -################################################################################### -# CLEAN -################################################################################### -DROP TABLE tt_1; -DROP TABLE tt_2; -DROP TABLE nt_1; -DROP TABLE nt_2; diff --git a/mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test b/mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test deleted file mode 100644 index 09b168c2882..00000000000 --- a/mysql-test/suite/binlog/t/binlog_mixed_failure_mixing_engines.test +++ /dev/null @@ -1,4 +0,0 @@ ---source include/have_binlog_format_mixed.inc ---source include/have_innodb.inc - ---source extra/binlog_tests/binlog_failure_mixing_engines.test diff --git a/mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test b/mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test deleted file mode 100644 index e25af7a7e10..00000000000 --- a/mysql-test/suite/binlog/t/binlog_row_failure_mixing_engines.test +++ /dev/null @@ -1,4 +0,0 @@ ---source include/have_binlog_format_row.inc ---source include/have_innodb.inc - ---source extra/binlog_tests/binlog_failure_mixing_engines.test diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index 1abd5fb2b38..dc27e4a5037 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -10892,210 +10892,981 @@ master-bin.000001 # Xid # # COMMIT /* XID */ # 3 - CREATE TABLE...SELECT ################################################################################### -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_321 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; +CREATE TABLE tt_xx_1 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1;; +CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_321, nt_xx_321; +DROP TABLE IF EXISTS tt_xx_1, nt_xx_1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_1, nt_xx_1 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T CS-T->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_1, nt_xx_1 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T CS-T->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_322 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; +CREATE TABLE nt_xx_2 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1;; +CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_322, nt_xx_322; +DROP TABLE IF EXISTS tt_xx_2, nt_xx_2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_2, nt_xx_2 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N CS-N->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_2, nt_xx_2 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N CS-N->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_323 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; +CREATE TABLE tt_xx_3 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-T->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1;; +CREATE TABLE tt_xx_3 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM nt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_3` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=InnoDB -master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_3) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> CS-T->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_323, nt_xx_323; +DROP TABLE IF EXISTS tt_xx_3, nt_xx_3; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_3, nt_xx_3 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N CS-T->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_3` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=InnoDB -master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_3) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_3, nt_xx_3 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N CS-T->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_324 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_4 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_4 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_4` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_324, nt_xx_324; +DROP TABLE IF EXISTS tt_xx_4, nt_xx_4; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_4, nt_xx_4 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_4` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_4, nt_xx_4 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_325 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_5 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_5 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_5` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_5) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_325, nt_xx_325; +DROP TABLE IF EXISTS tt_xx_5, nt_xx_5; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_5, nt_xx_5 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_5` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_5) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_5, nt_xx_5 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_326 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_6 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_6 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_6` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_6) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_326, nt_xx_326; +DROP TABLE IF EXISTS tt_xx_6, nt_xx_6; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_6, nt_xx_6 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_6` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_6) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_6, nt_xx_6 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### -# 4 - ROLLBACK TEMPORARY TABLE +# 4 - INSERT TABLE...SELECT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T IS-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T IS-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T ISe-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T ISe-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B IS-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B IS-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B ISe-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B ISe-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_7, nt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_7, nt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_7, nt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T IS-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T IS-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T ISe-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T ISe-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B IS-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B IS-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B ISe-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B ISe-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_8, nt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_8, nt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_8, nt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T IS-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T ISe-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B IS-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B ISe-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_9, nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_9, nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_9, nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T IS-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T ISe-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B IS-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B ISe-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_10, nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_10, nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_10, nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 5 - ROLLBACK TEMPORARY TABLE ################################################################################### -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -11106,12 +11877,22 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_11; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_11 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_11 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -11119,11 +11900,11 @@ SAVEPOINT s1; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -11140,20 +11921,30 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_12; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_12 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_12 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -11164,12 +11955,22 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_13; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_13 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_13 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1; +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_1) @@ -11177,11 +11978,14 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -11196,18 +12000,34 @@ master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_14; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_14 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_14 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -11216,26 +12036,41 @@ Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_15; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_15 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_15 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2); +INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb +master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -11247,11 +12082,23 @@ Log_name Pos Event_type Server_id End_log_pos Info -b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_1) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_16; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_16 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_16 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + ################################################################################### # CHECK CONSISTENCY ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result index 47559b921dc..3f2c472ffe9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result @@ -12382,244 +12382,1143 @@ master-bin.000001 # Xid # # COMMIT /* XID */ # 3 - CREATE TABLE...SELECT ################################################################################### -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_321 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; +CREATE TABLE tt_xx_1 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1;; +CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_321` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_1` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=InnoDB -master-bin.000001 # Table_map # # table_id: # (test.tt_xx_321) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_321, nt_xx_321; +DROP TABLE IF EXISTS tt_xx_1, nt_xx_1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_1, nt_xx_1 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T CS-T->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_321` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_1` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=InnoDB -master-bin.000001 # Table_map # # table_id: # (test.tt_xx_321) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_1) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_1, nt_xx_1 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T CS-T->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_322 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; +CREATE TABLE nt_xx_2 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1;; +CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_322` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_2` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_322) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_2) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_322, nt_xx_322; +DROP TABLE IF EXISTS tt_xx_2, nt_xx_2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_2, nt_xx_2 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N CS-N->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_322` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_2` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_322) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_2) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_2, nt_xx_2 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N CS-N->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_323 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; +CREATE TABLE tt_xx_3 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-T->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1;; +CREATE TABLE tt_xx_3 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM nt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_3` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=InnoDB -master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_3) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> CS-T->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_323, nt_xx_323; +DROP TABLE IF EXISTS tt_xx_3, nt_xx_3; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_3, nt_xx_3 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N CS-T->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_323` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_3` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=InnoDB -master-bin.000001 # Table_map # # table_id: # (test.tt_xx_323) +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_3) master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_3, nt_xx_3 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N CS-T->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_324 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_4 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_4 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_4` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_324, nt_xx_324; +DROP TABLE IF EXISTS tt_xx_4, nt_xx_4; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_4, nt_xx_4 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_324` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_4` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_324) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_4, nt_xx_4 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_325 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_5 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_5 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_5` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_5) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_325, nt_xx_325; +DROP TABLE IF EXISTS tt_xx_5, nt_xx_5; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_5, nt_xx_5 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_325` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_5` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_325) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_5) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_5, nt_xx_5 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_326 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_6 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_6 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_6` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_6) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_326, nt_xx_326; +DROP TABLE IF EXISTS tt_xx_6, nt_xx_6; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_6, nt_xx_6 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_326` ( +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_6` ( `trans_id` int(11) NOT NULL DEFAULT '0', `stmt_id` int(11) NOT NULL DEFAULT '0', - `info` varchar(64) DEFAULT NULL + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) ) ENGINE=MyISAM -master-bin.000001 # Table_map # # table_id: # (test.nt_xx_326) +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_6) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_6, nt_xx_6 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### -# 4 - ROLLBACK TEMPORARY TABLE +# 4 - INSERT TABLE...SELECT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_7` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_7` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T IS-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T IS-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T ISe-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T ISe-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B IS-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_7) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B IS-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B ISe-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B ISe-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_7, nt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_7, nt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_7, nt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_8` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `tt_xx_8` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=InnoDB +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T IS-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T IS-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T ISe-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T ISe-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B IS-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_xx_8) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B IS-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B ISe-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B ISe-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_8, nt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_8, nt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_8, nt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_9` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_9` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T IS-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T ISe-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B IS-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B ISe-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_9) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_9, nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_9, nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_9, nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_10` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TABLE `nt_xx_10` ( + `trans_id` int(11) NOT NULL DEFAULT '0', + `stmt_id` int(11) NOT NULL DEFAULT '0', + `info` varchar(64) DEFAULT NULL, + PRIMARY KEY (`trans_id`,`stmt_id`) +) ENGINE=MyISAM +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T IS-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T ISe-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B IS-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B ISe-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_xx_10) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_10, nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_10, nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_10, nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 5 - ROLLBACK TEMPORARY TABLE ################################################################################### -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -12630,12 +13529,20 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_11; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -12643,11 +13550,11 @@ SAVEPOINT s1; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -12664,20 +13571,28 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_12; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -12688,12 +13603,20 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_13; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1; +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_1) @@ -12701,11 +13624,11 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -12722,16 +13645,24 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_14; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -12742,12 +13673,20 @@ Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_15; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2); +INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_1) @@ -12755,11 +13694,11 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -12776,6 +13715,14 @@ master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_16; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + ################################################################################### # CHECK CONSISTENCY ################################################################################### diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result index ebe6d3e82b9..14f763ab646 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result @@ -10028,176 +10028,898 @@ master-bin.000001 # Xid # # COMMIT /* XID */ # 3 - CREATE TABLE...SELECT ################################################################################### -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_321 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; +CREATE TABLE tt_xx_1 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1;; +CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_321, nt_xx_321; +DROP TABLE IF EXISTS tt_xx_1, nt_xx_1; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_1, nt_xx_1 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->T CS-T->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_321 engine=Innodb SELECT * FROM tt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_321, nt_xx_321 +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_1 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_1, nt_xx_1 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->T CS-T->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_322 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; +CREATE TABLE nt_xx_2 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1;; +CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_322, nt_xx_322; +DROP TABLE IF EXISTS tt_xx_2, nt_xx_2; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_2, nt_xx_2 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->N CS-N->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_322 engine=MyIsam SELECT * FROM nt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_322, nt_xx_322 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_2 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_2, nt_xx_2 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->N CS-N->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_323 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; +CREATE TABLE tt_xx_3 (PRIMARY KEY (stmt_id)) engine=Innodb SELECT stmt_id FROM nt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-T->N << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1;; +CREATE TABLE tt_xx_3 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM nt_1;; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_3 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM nt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-T->N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_323, nt_xx_323; +DROP TABLE IF EXISTS tt_xx_3, nt_xx_3; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_3, nt_xx_3 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-T->N CS-T->N drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_323 engine=Innodb SELECT * FROM nt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_323, nt_xx_323 +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_3 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM nt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_3, nt_xx_3 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-T->N CS-T->N drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_324 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_4 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_4 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_4 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_324, nt_xx_324; +DROP TABLE IF EXISTS tt_xx_4, nt_xx_4; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_4, nt_xx_4 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_324 engine=MyIsam SELECT * FROM tt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_324, nt_xx_324 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_4 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_4, nt_xx_4 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_325 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_5 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_5 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_5 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_325, nt_xx_325; +DROP TABLE IF EXISTS tt_xx_5, nt_xx_5; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_5, nt_xx_5 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_325 engine=MyIsam SELECT * FROM tt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_325, nt_xx_325 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_5 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_5, nt_xx_5 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_326 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; +CREATE TABLE nt_xx_6 (PRIMARY KEY (stmt_id)) engine=MyIsam SELECT stmt_id FROM tt_1;; Got one of the listed errors Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CS-N->T << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1;; +CREATE TABLE nt_xx_6 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1;; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_6 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1 -e-e-e-e-e-e-e-e-e-e-e- >> CS-N->T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- -DROP TABLE IF EXISTS tt_xx_326, nt_xx_326; +DROP TABLE IF EXISTS tt_xx_6, nt_xx_6; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_6, nt_xx_6 -e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CSe-N->T CS-N->T drop-CS << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_326 engine=MyIsam SELECT * FROM tt_1 -master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_326, nt_xx_326 +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_6 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM tt_1 +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_6, nt_xx_6 -e-e-e-e-e-e-e-e-e-e-e- >> CSe-N->T CS-N->T drop-CS << -e-e-e-e-e-e-e-e-e-e-e- ################################################################################### -# 4 - ROLLBACK TEMPORARY TABLE +# 4 - INSERT TABLE...SELECT +################################################################################### +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_7 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T IS-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T IS-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T ISe-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T ISe-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B IS-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B IS-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_7(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B ISe-T<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_7 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B ISe-T<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_7, nt_xx_7; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_7, nt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_7, nt_xx_7 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-T->T << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx_8 (PRIMARY KEY(trans_id, stmt_id)) engine=Innodb SELECT * FROM tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-T->T << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T IS-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (334, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T IS-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B T ISe-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (335, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B T ISe-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B IS-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (336, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B IS-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE tt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-T<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_xx_8(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-T<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-T B ISe-T<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE tt_xx_8 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (337, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-T B ISe-T<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_8, nt_xx_8; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_8, nt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_8, nt_xx_8 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_9 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T IS-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (340, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T ISe-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (341, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B IS-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (342, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B IS-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B ISe-N<-T T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_9 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_9(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM tt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (343, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B ISe-N<-T T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_9, nt_xx_9; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_9, nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_9, nt_xx_9 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1;; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> CS-N->N << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE nt_xx_10 (PRIMARY KEY(trans_id, stmt_id)) engine=MyIsam SELECT * FROM nt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> CS-N->N << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T IS-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (346, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B T ISe-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (347, 6) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B T ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> IS-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1;; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> IS-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B IS-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, stmt_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (348, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B IS-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N << -b-b-b-b-b-b-b-b-b-b-b- +TRUNCATE TABLE nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- +BEGIN; +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> ISe-N<-N << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1;; +Got one of the listed errors +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> ISe-N<-N << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4); +Log_name Pos Event_type Server_id End_log_pos Info +-e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> C << -b-b-b-b-b-b-b-b-b-b-b- +COMMIT; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> C << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> trunc-CS-N B ISe-N<-N T C << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE nt_xx_10 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO nt_xx_10(trans_id, stmt_id, info) SELECT trans_id, trans_id, USER() FROM nt_1 +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (349, 4) +master-bin.000001 # Xid # # COMMIT /* XID */ +-e-e-e-e-e-e-e-e-e-e-e- >> trunc-CS-N B ISe-N<-N T C << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +DROP TABLE IF EXISTS tt_xx_10, nt_xx_10; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_10, nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CS << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx_10, nt_xx_10 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CS << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# 5 - ROLLBACK TEMPORARY TABLE ################################################################################### -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (327, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_327 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (351, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_11 (a int) engine=Innodb master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_11; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_11 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_11 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> S1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -10205,11 +10927,11 @@ SAVEPOINT s1; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> S1 << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R1 << -b-b-b-b-b-b-b-b-b-b-b- @@ -10222,80 +10944,100 @@ Log_name Pos Event_type Server_id End_log_pos Info ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T S1 T CT R1 R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 2) master-bin.000001 # Query # # use `test`; SAVEPOINT s1 -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (328, 5) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_328 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (353, 5) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_12 (a int) engine=Innodb master-bin.000001 # Query # # use `test`; ROLLBACK TO s1 master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T S1 T CT R1 R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_12; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_12 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_12 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B T CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 2) -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_329 (a int) engine=Innodb -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (329, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 2) +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_13 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (355, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B T CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_13; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_13 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_13 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> tN << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1; +INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Non-transactional reads or writes are unsafe if they occur after transactional reads or writes inside a transaction. Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> tN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10304,74 +11046,94 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B tN CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 330, 2, COUNT(*) FROM tt_1 +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id, info) SELECT 357, 2, COUNT(*) FROM tt_1 master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_330 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_14 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (330, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (357, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B tN CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_14; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_14 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_14 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- ROLLBACK; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_331 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_15 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (331, 3) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (359, 3) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_15; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_15 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_15 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + -b-b-b-b-b-b-b-b-b-b-b- >> B << -b-b-b-b-b-b-b-b-b-b-b- BEGIN; Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> B << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> N << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2); +INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2) master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> N << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> CT << -b-b-b-b-b-b-b-b-b-b-b- -CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb;; +CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb;; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> CT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> T << -b-b-b-b-b-b-b-b-b-b-b- -INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5); +INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5); Log_name Pos Event_type Server_id End_log_pos Info -e-e-e-e-e-e-e-e-e-e-e- >> T << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> R << -b-b-b-b-b-b-b-b-b-b-b- @@ -10380,22 +11142,32 @@ Warnings: Warning 1196 Some non-transactional changed tables couldn't be rolled back Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> R << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> B N CT T R << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (332, 2) +master-bin.000001 # Query # # use `test`; INSERT INTO nt_1(trans_id, stmt_id) VALUES (361, 2) master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_332 (a int) engine=Innodb +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx_16 (a int) engine=Innodb master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # BEGIN -master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (332, 5) +master-bin.000001 # Query # # use `test`; INSERT INTO tt_1(trans_id, stmt_id) VALUES (361, 5) master-bin.000001 # Query # # ROLLBACK -e-e-e-e-e-e-e-e-e-e-e- >> B N CT T R << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +DROP TEMPORARY TABLE IF EXISTS tt_xx_16; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_16 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> drop-CT << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS tt_xx_16 +-e-e-e-e-e-e-e-e-e-e-e- >> drop-CT << -e-e-e-e-e-e-e-e-e-e-e- + ################################################################################### # CHECK CONSISTENCY ################################################################################### From 4677f4de0fb8a3b23a715443f8326b45d5750c57 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Fri, 13 Nov 2009 00:17:10 +0000 Subject: [PATCH 18/69] Post-fix for WL#2687 WL#5072 BUG#40278 BUG#47175 Create a set of test cases to see if some DDL statements implicitly commit a transaction on the NDB and are written directly to the binary log without going through either the Statement- or Transactional-Cache. --- .../rpl_tests/rpl_implicit_commit_binlog.test | 307 +++++++- .../extra/rpl_tests/rpl_mixing_engines.inc | 2 + .../r/rpl_mixed_implicit_commit_binlog.result | 25 +- .../r/rpl_row_implicit_commit_binlog.result | 25 +- .../r/rpl_stm_implicit_commit_binlog.result | 25 +- .../t/rpl_mixed_implicit_commit_binlog.test | 1 + .../rpl/t/rpl_row_implicit_commit_binlog.test | 1 + .../rpl/t/rpl_stm_implicit_commit_binlog.test | 1 + ...pl_ndb_mixed_implicit_commit_binlog.result | 660 ++++++++++++++++++ .../rpl_ndb_row_implicit_commit_binlog.result | 658 +++++++++++++++++ .../rpl_ndb_mixed_implicit_commit_binlog.test | 9 + .../t/rpl_ndb_row_implicit_commit_binlog.test | 9 + 12 files changed, 1668 insertions(+), 55 deletions(-) create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result create mode 100644 mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test create mode 100644 mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test diff --git a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test index 1cf99c9e92e..39d18b7403d 100644 --- a/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test +++ b/mysql-test/extra/rpl_tests/rpl_implicit_commit_binlog.test @@ -21,8 +21,9 @@ --echo ######################################################################### connection master; -CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; -CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +eval CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = $engine; +eval CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = $engine; +eval CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; INSERT INTO tt_1(ddl_case) VALUES(0); INSERT INTO tt_2(ddl_case) VALUES(0); @@ -36,6 +37,7 @@ while (`SELECT $ddl_cases >= 1`) { --echo -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- let $in_temporary= "no"; + let $ok= "yes"; # # In SBR and MIXED modes, the commit event is usually the third event in the # binary log: @@ -62,16 +64,55 @@ while (`SELECT $ddl_cases >= 1`) { let $commit_event_row_number= 4; } + # + # In NDB (RBR and MIXED modes), the commit event is usually the seventh event + # in the binary log: + # + # 1: COMMAND + # 2: BEGIN + # 3: TABLE MAP EVENT + # 4: TABLE MAP EVENT (ndb_apply_status) + # 5: ROW EVENT + # 6: ROW EVENT + # 7: COMMIT + # + if (`select '$engine' = 'NDB'`) + { + let $commit_event_row_number= 7; + } + let $first_binlog_position= query_get_value("SHOW MASTER STATUS", Position, 1); --enable_query_log eval INSERT INTO tt_1(ddl_case) VALUES ($ddl_cases); if (`SELECT $ddl_cases = 41`) { let $cmd= LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; + if (`SELECT '$engine' = 'NDB'`) + { + # This seems to be related to epochs. + # We need to check this against an updated version or avoid it. + let $ok= "no"; + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 40`) { - let $cmd= LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; + let $cmd= LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 39`) { @@ -80,6 +121,21 @@ while (`SELECT $ddl_cases >= 1`) if (`SELECT $ddl_cases = 38`) { let $cmd= CHECK TABLE nt_1; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 37`) { @@ -92,10 +148,40 @@ while (`SELECT $ddl_cases >= 1`) if (`SELECT $ddl_cases = 35`) { let $cmd= LOCK TABLES tt_1 WRITE; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 34`) { let $cmd= UNLOCK TABLES; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 33`) { @@ -108,6 +194,43 @@ while (`SELECT $ddl_cases >= 1`) if (`SELECT $ddl_cases = 31`) { let $cmd= SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); + # + # In NDB (RBR mode), the commit event is the eleventh event + # in the binary log: + # + # 1: DDL EVENT which triggered the previous commmit. + # 2: BEGIN + # 3: TABLE MAP EVENT + # 4: ROW EVENT + # 5: COMMIT + # 6: BEGIN + # 7: TABLE MAP EVENT + # 8: TABLE MAP EVENT (ndb_apply_status) + # 9: ROW EVENT + # 10: ROW EVENT + # 11: COMMIT + # + if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'`) + { + let $commit_event_row_number= 11; + } + # + # In NDB (MIXED mode), the commit event is the eighth event + # in the binary log: + # + # 1: DDL EVENT which triggered the previous commmit. + # 2: COMMIT + # 3: BEGIN + # 4: TABLE MAP EVENT + # 5: TABLE MAP EVENT (ndb_apply_status) + # 6: ROW EVENT + # 7: ROW EVENT + # 8: COMMIT + # + if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'`) + { + let $commit_event_row_number= 7; + } } if (`SELECT $ddl_cases = 30`) { @@ -150,7 +273,7 @@ while (`SELECT $ddl_cases >= 1`) # 5: COMMIT # 6: DDL EVENT which triggered the previous commmit. # - if (`select @@binlog_format = 'ROW'`) + if (`select @@binlog_format = 'ROW' && '$engine' != 'NDB'`) { let $commit_event_row_number= 5; } @@ -194,10 +317,42 @@ while (`SELECT $ddl_cases >= 1`) if (`SELECT $ddl_cases = 13`) { let $cmd= CREATE INDEX ix ON tt_1(ddl_case); + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # 7: DDL EVENT which triggered the previous commmit. + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 12`) { - let $cmd= DROP INDEX ix ON tt_1; + let $cmd= DROP INDEX ix ON tt_1; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # 7: DDL EVENT which triggered the previous commmit. + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 11`) { @@ -221,6 +376,39 @@ while (`SELECT $ddl_cases >= 1`) { let $commit_event_row_number= 4; } + # + # In NDB (RBR mode), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB' && @@binlog_format = 'ROW'` ) + { + let $commit_event_row_number= 6; + } + # + # In NDB (MIXED mode), the commit event is the nineth event + # in the binary log: + # + # 1: BEGIN + # 2: DDL EVENT which triggered the previous commmit. + # 3: COMMIT + # 4: BEGIN + # 5: TABLE MAP EVENT + # 6: TABLE MAP EVENT (ndb_apply_status) + # 7: ROW EVENT + # 8: ROW EVENT + # 9: COMMIT + # + if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` ) + { + let $commit_event_row_number= 9; + } } if (`SELECT $ddl_cases = 10`) { @@ -238,6 +426,21 @@ while (`SELECT $ddl_cases >= 1`) { let $commit_event_row_number= 4; } + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 9`) { @@ -255,6 +458,21 @@ while (`SELECT $ddl_cases >= 1`) { let $commit_event_row_number= 4; } + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 8`) { @@ -290,6 +508,39 @@ while (`SELECT $ddl_cases >= 1`) { let $commit_event_row_number= 5; } + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } + # + # In NDB (MIXED mode), the commit event is the nineth event + # in the binary log: + # + # 1: BEGIN + # 2: DDL EVENT which triggered the previous commmit. + # 3: COMMIT + # 4: BEGIN + # 5: TABLE MAP EVENT + # 6: TABLE MAP EVENT (ndb_apply_status) + # 7: ROW EVENT + # 8: ROW EVENT + # 9: COMMIT + # + if (`SELECT '$engine' = 'NDB' && @@binlog_format != 'ROW'` ) + { + let $commit_event_row_number= 9; + } } if (`SELECT $ddl_cases = 7`) { @@ -314,10 +565,42 @@ while (`SELECT $ddl_cases >= 1`) if (`SELECT $ddl_cases = 2`) { let $cmd= CREATE DATABASE db; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # 7: DDL EVENT which triggered the previous commmit. + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } if (`SELECT $ddl_cases = 1`) { let $cmd= DROP DATABASE IF EXISTS db; + # + # In NDB (RBR and MIXED modes), the commit event is the sixth event + # in the binary log: + # + # 1: BEGIN + # 2: TABLE MAP EVENT + # 3: TABLE MAP EVENT (ndb_apply_status) + # 4: ROW EVENT + # 5: ROW EVENT + # 6: COMMIT + # 7: DDL EVENT which triggered the previous commmit. + # + if (`SELECT '$engine' = 'NDB'`) + { + let $commit_event_row_number= 6; + } } --eval $cmd --disable_query_log @@ -333,11 +616,14 @@ while (`SELECT $ddl_cases >= 1`) let $event_commit= query_get_value("SHOW BINLOG EVENTS FROM $first_binlog_position", Info, $commit_event_row_number); if (`SELECT SUBSTRING("$event_commit",1,6) != "COMMIT"`) { - --echo it *does not* commit the current transaction. - --echo $cmd - --echo $event_commit - SHOW BINLOG EVENTS; - exit; + if (`SELECT $ok = "yes"`) + { + --echo it *does not* commit the current transaction. + --echo $cmd + --echo $event_commit + SHOW BINLOG EVENTS; + exit; + } } --echo -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- let $binlog_start= $first_binlog_position; @@ -365,5 +651,6 @@ connection master; DROP TABLE tt_1; DROP TABLE tt_2; +DROP TABLE nt_1; sync_slave_with_master; diff --git a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc index 0aead91e03d..6dde3e079a1 100644 --- a/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc +++ b/mysql-test/extra/rpl_tests/rpl_mixing_engines.inc @@ -516,10 +516,12 @@ while (`SELECT HEX(@commands) != HEX('')`) } if (`SELECT HEX(@command) = HEX('C')`) { + --error 0, ER_GET_ERRMSG eval COMMIT; } if (`SELECT HEX(@command) = HEX('R')`) { + --error 0, ER_GET_ERRMSG eval ROLLBACK; } if (`SELECT HEX(@command) = HEX('S1')`) diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result index 2641df307b4..386274af7b2 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result @@ -9,6 +9,7 @@ start slave; ######################################################################### CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; INSERT INTO tt_1(ddl_case) VALUES(0); INSERT INTO tt_2(ddl_case) VALUES(0); ######################################################################### @@ -19,8 +20,7 @@ SET AUTOCOMMIT= 0; INSERT INTO tt_1(ddl_case) VALUES (41); LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; Table Op Msg_type Msg_text -test.nt_1 preload_keys Error Table 'test.nt_1' doesn't exist -test.nt_1 preload_keys status Operation failed +test.nt_1 preload_keys status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -31,12 +31,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (40); -LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; Table Op Msg_type Msg_text -test.t1 preload_keys Error Table 'test.t1' doesn't exist -test.t1 preload_keys status Operation failed -test.t2 preload_keys Error Table 'test.t2' doesn't exist -test.t2 preload_keys status Operation failed +test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys +test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -49,8 +47,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_1(ddl_case) VALUES (39); ANALYZE TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 analyze Error Table 'test.nt_1' doesn't exist -test.nt_1 analyze status Operation failed +test.nt_1 analyze status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -64,8 +61,7 @@ master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 INSERT INTO tt_1(ddl_case) VALUES (38); CHECK TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 check Error Table 'test.nt_1' doesn't exist -test.nt_1 check status Operation failed +test.nt_1 check status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -78,8 +74,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_1(ddl_case) VALUES (37); OPTIMIZE TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 optimize Error Table 'test.nt_1' doesn't exist -test.nt_1 optimize status Operation failed +test.nt_1 optimize status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -93,8 +88,7 @@ master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 INSERT INTO tt_1(ddl_case) VALUES (36); REPAIR TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 repair Error Table 'test.nt_1' doesn't exist -test.nt_1 repair status Operation failed +test.nt_1 repair status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -536,3 +530,4 @@ Comparing tables master:test.tt_1 and slave:test.tt_1 ################################################################################### DROP TABLE tt_1; DROP TABLE tt_2; +DROP TABLE nt_1; diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result index 8704eb566a3..077aba8ddb0 100644 --- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result @@ -9,6 +9,7 @@ start slave; ######################################################################### CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; INSERT INTO tt_1(ddl_case) VALUES(0); INSERT INTO tt_2(ddl_case) VALUES(0); ######################################################################### @@ -19,8 +20,7 @@ SET AUTOCOMMIT= 0; INSERT INTO tt_1(ddl_case) VALUES (41); LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; Table Op Msg_type Msg_text -test.nt_1 preload_keys Error Table 'test.nt_1' doesn't exist -test.nt_1 preload_keys status Operation failed +test.nt_1 preload_keys status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -32,12 +32,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (40); -LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; Table Op Msg_type Msg_text -test.t1 preload_keys Error Table 'test.t1' doesn't exist -test.t1 preload_keys status Operation failed -test.t2 preload_keys Error Table 'test.t2' doesn't exist -test.t2 preload_keys status Operation failed +test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys +test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -51,8 +49,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_1(ddl_case) VALUES (39); ANALYZE TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 analyze Error Table 'test.nt_1' doesn't exist -test.nt_1 analyze status Operation failed +test.nt_1 analyze status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -67,8 +64,7 @@ master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 INSERT INTO tt_1(ddl_case) VALUES (38); CHECK TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 check Error Table 'test.nt_1' doesn't exist -test.nt_1 check status Operation failed +test.nt_1 check status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -82,8 +78,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_1(ddl_case) VALUES (37); OPTIMIZE TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 optimize Error Table 'test.nt_1' doesn't exist -test.nt_1 optimize status Operation failed +test.nt_1 optimize status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -98,8 +93,7 @@ master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 INSERT INTO tt_1(ddl_case) VALUES (36); REPAIR TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 repair Error Table 'test.nt_1' doesn't exist -test.nt_1 repair status Operation failed +test.nt_1 repair status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -577,3 +571,4 @@ Comparing tables master:test.tt_1 and slave:test.tt_1 ################################################################################### DROP TABLE tt_1; DROP TABLE tt_2; +DROP TABLE nt_1; diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result index 02e7a34ef2d..8e245db6c3c 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result +++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result @@ -9,6 +9,7 @@ start slave; ######################################################################### CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb; +CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; INSERT INTO tt_1(ddl_case) VALUES(0); INSERT INTO tt_2(ddl_case) VALUES(0); ######################################################################### @@ -19,8 +20,7 @@ SET AUTOCOMMIT= 0; INSERT INTO tt_1(ddl_case) VALUES (41); LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; Table Op Msg_type Msg_text -test.nt_1 preload_keys Error Table 'test.nt_1' doesn't exist -test.nt_1 preload_keys status Operation failed +test.nt_1 preload_keys status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -31,12 +31,10 @@ master-bin.000001 # Xid # # COMMIT /* XID */ -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_1(ddl_case) VALUES (40); -LOAD INDEX INTO CACHE t1, t2 IGNORE LEAVES; +LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; Table Op Msg_type Msg_text -test.t1 preload_keys Error Table 'test.t1' doesn't exist -test.t1 preload_keys status Operation failed -test.t2 preload_keys Error Table 'test.t2' doesn't exist -test.t2 preload_keys status Operation failed +test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys +test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -49,8 +47,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_1(ddl_case) VALUES (39); ANALYZE TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 analyze Error Table 'test.nt_1' doesn't exist -test.nt_1 analyze status Operation failed +test.nt_1 analyze status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -64,8 +61,7 @@ master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 INSERT INTO tt_1(ddl_case) VALUES (38); CHECK TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 check Error Table 'test.nt_1' doesn't exist -test.nt_1 check status Operation failed +test.nt_1 check status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -78,8 +74,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */ INSERT INTO tt_1(ddl_case) VALUES (37); OPTIMIZE TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 optimize Error Table 'test.nt_1' doesn't exist -test.nt_1 optimize status Operation failed +test.nt_1 optimize status Table is already up to date -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -93,8 +88,7 @@ master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 INSERT INTO tt_1(ddl_case) VALUES (36); REPAIR TABLE nt_1; Table Op Msg_type Msg_text -test.nt_1 repair Error Table 'test.nt_1' doesn't exist -test.nt_1 repair status Operation failed +test.nt_1 repair status OK -e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info @@ -535,3 +529,4 @@ Comparing tables master:test.tt_1 and slave:test.tt_1 ################################################################################### DROP TABLE tt_1; DROP TABLE tt_2; +DROP TABLE nt_1; diff --git a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test index 7c406aa560f..6e1d3286f07 100644 --- a/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test +++ b/mysql-test/suite/rpl/t/rpl_mixed_implicit_commit_binlog.test @@ -5,4 +5,5 @@ --source include/master-slave.inc --source include/have_innodb.inc +--let $engine=Innodb --source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test index f5ee09ffacf..5c3b163eea3 100644 --- a/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test +++ b/mysql-test/suite/rpl/t/rpl_row_implicit_commit_binlog.test @@ -5,4 +5,5 @@ --source include/master-slave.inc --source include/have_innodb.inc +--let $engine=Innodb --source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test index 392a2defc42..87dd3eb3295 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test +++ b/mysql-test/suite/rpl/t/rpl_stm_implicit_commit_binlog.test @@ -5,4 +5,5 @@ --source include/master-slave.inc --source include/have_innodb.inc +--let $engine=Innodb --source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result new file mode 100644 index 00000000000..f29953a1dd5 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_mixed_implicit_commit_binlog.result @@ -0,0 +1,660 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +######################################################################### +# CONFIGURATION +######################################################################### +CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB; +CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB; +CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; +INSERT INTO tt_1(ddl_case) VALUES(0); +INSERT INTO tt_2(ddl_case) VALUES(0); +######################################################################### +# CHECK IMPLICT COMMIT +######################################################################### +SET AUTOCOMMIT= 0; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (41); +LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.nt_1 preload_keys status OK +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (test.tt_2) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (40); +LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys +test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (39); +ANALYZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 analyze status Table is already up to date +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (38); +CHECK TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 check status OK +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (37); +OPTIMIZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 optimize status Table is already up to date +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (36); +REPAIR TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 repair status OK +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (35); +LOCK TABLES tt_1 WRITE; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (34); +UNLOCK TABLES; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (33); +CREATE USER 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (32); +GRANT ALL ON *.* TO 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (31); +SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (30); +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (29); +RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (28); +DROP USER 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (27); +CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (26); +ALTER EVENT evt COMMENT 'evt'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (25); +DROP EVENT evt; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP EVENT evt +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (24); +CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (23); +DROP TRIGGER tr; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TRIGGER tr +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (22); +CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1 +RETURN "fc" +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (21); +ALTER FUNCTION fc COMMENT 'fc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (20); +DROP FUNCTION fc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP FUNCTION fc +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (19); +CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`() +UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (18); +ALTER PROCEDURE pc COMMENT 'pc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (17); +DROP PROCEDURE pc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (16); +CREATE VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (15); +ALTER VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (14); +DROP VIEW v; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP VIEW v +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (13); +CREATE INDEX ix ON tt_1(ddl_case); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; CREATE INDEX ix ON tt_1(ddl_case) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (12); +DROP INDEX ix ON tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP INDEX ix ON tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (11); +CREATE TEMPORARY TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE tt_xx (a int) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (10); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (9); +ALTER TABLE tt_xx RENAME new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (8); +DROP TEMPORARY TABLE IF EXISTS new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE IF EXISTS `new_tt_xx` /* generated by server */ +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (7); +CREATE TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (6); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (5); +RENAME TABLE tt_xx TO new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (4); +TRUNCATE TABLE new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (3); +DROP TABLE IF EXISTS tt_xx, new_tt_xx; +Warnings: +Note 1051 Unknown table 'tt_xx' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx, new_tt_xx +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (2); +CREATE DATABASE db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # CREATE DATABASE db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (1); +DROP DATABASE IF EXISTS db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # DROP DATABASE IF EXISTS db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +Comparing tables master:test.tt_1 and slave:test.tt_1 +################################################################################### +# CLEAN +################################################################################### +DROP TABLE tt_1; +DROP TABLE tt_2; +DROP TABLE nt_1; diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result new file mode 100644 index 00000000000..dd8bb3a0c41 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_row_implicit_commit_binlog.result @@ -0,0 +1,658 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +######################################################################### +# CONFIGURATION +######################################################################### +CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB; +CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = NDB; +CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam; +INSERT INTO tt_1(ddl_case) VALUES(0); +INSERT INTO tt_2(ddl_case) VALUES(0); +######################################################################### +# CHECK IMPLICT COMMIT +######################################################################### +SET AUTOCOMMIT= 0; +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (41); +LOAD INDEX INTO CACHE nt_1 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.nt_1 preload_keys status OK +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (test.tt_2) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (40); +LOAD INDEX INTO CACHE tt_1, tt_2 IGNORE LEAVES; +Table Op Msg_type Msg_text +test.tt_1 preload_keys note The storage engine for the table doesn't support preload_keys +test.tt_2 preload_keys note The storage engine for the table doesn't support preload_keys +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (39); +ANALYZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 analyze status Table is already up to date +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ANALYZE TABLE nt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (38); +CHECK TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 check status OK +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (37); +OPTIMIZE TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 optimize status Table is already up to date +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; OPTIMIZE TABLE nt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (36); +REPAIR TABLE nt_1; +Table Op Msg_type Msg_text +test.nt_1 repair status OK +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; REPAIR TABLE nt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (35); +LOCK TABLES tt_1 WRITE; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (34); +UNLOCK TABLES; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (33); +CREATE USER 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE USER 'user'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (32); +GRANT ALL ON *.* TO 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; GRANT ALL ON *.* TO 'user'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (31); +SET PASSWORD FOR 'user'@'localhost' = PASSWORD('newpass'); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; SET PASSWORD FOR 'user'@'localhost'='*D8DECEC305209EEFEC43008E1D420E1AA06B19E0' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (mysql.user) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (30); +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'user'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (29); +RENAME USER 'user'@'localhost' TO 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; RENAME USER 'user'@'localhost' TO 'user_new'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (28); +DROP USER 'user_new'@'localhost'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP USER 'user_new'@'localhost' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (27); +CREATE EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` EVENT evt ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO SELECT * FROM tt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (26); +ALTER EVENT evt COMMENT 'evt'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER EVENT evt COMMENT 'evt' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (25); +DROP EVENT evt; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP EVENT evt +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (24); +CREATE TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` TRIGGER tr AFTER INSERT ON tt_1 FOR EACH ROW UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (23); +DROP TRIGGER tr; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TRIGGER tr +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (22); +CREATE FUNCTION fc () RETURNS VARCHAR(64) RETURN "fc"; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `fc`() RETURNS varchar(64) CHARSET latin1 +RETURN "fc" +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (21); +ALTER FUNCTION fc COMMENT 'fc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER FUNCTION fc COMMENT 'fc' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (20); +DROP FUNCTION fc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP FUNCTION fc +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (19); +CREATE PROCEDURE pc () UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE DEFINER=`root`@`localhost` PROCEDURE `pc`() +UPDATE tt_2 SET ddl_case = ddl_case WHERE ddl_case= NEW.ddl_case +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (18); +ALTER PROCEDURE pc COMMENT 'pc'; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER PROCEDURE pc COMMENT 'pc' +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (17); +DROP PROCEDURE pc; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP PROCEDURE pc +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (16); +CREATE VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (15); +ALTER VIEW v AS SELECT * FROM tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v` AS SELECT * FROM tt_1 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (14); +DROP VIEW v; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP VIEW v +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (13); +CREATE INDEX ix ON tt_1(ddl_case); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; CREATE INDEX ix ON tt_1(ddl_case) +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (12); +DROP INDEX ix ON tt_1; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; DROP INDEX ix ON tt_1 +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (11); +CREATE TEMPORARY TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (10); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (9); +ALTER TABLE tt_xx RENAME new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (8); +DROP TEMPORARY TABLE IF EXISTS new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (7); +CREATE TABLE tt_xx (a int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE tt_xx (a int) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (6); +ALTER TABLE tt_xx ADD COLUMN (b int); +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; ALTER TABLE tt_xx ADD COLUMN (b int) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (5); +RENAME TABLE tt_xx TO new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; RENAME TABLE tt_xx TO new_tt_xx +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (4); +TRUNCATE TABLE new_tt_xx; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; TRUNCATE TABLE new_tt_xx +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (3); +DROP TABLE IF EXISTS tt_xx, new_tt_xx; +Warnings: +Note 1051 Unknown table 'tt_xx' +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS tt_xx, new_tt_xx +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (2); +CREATE DATABASE db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # CREATE DATABASE db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +INSERT INTO tt_1(ddl_case) VALUES (1); +DROP DATABASE IF EXISTS db; +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- +-b-b-b-b-b-b-b-b-b-b-b- >> << -b-b-b-b-b-b-b-b-b-b-b- +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_1) +master-bin.000001 # Table_map # # table_id: # (mysql.ndb_apply_status) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # DROP DATABASE IF EXISTS db +-e-e-e-e-e-e-e-e-e-e-e- >> << -e-e-e-e-e-e-e-e-e-e-e- + +################################################################################### +# CHECK CONSISTENCY +################################################################################### +Comparing tables master:test.tt_1 and slave:test.tt_1 +################################################################################### +# CLEAN +################################################################################### +DROP TABLE tt_1; +DROP TABLE tt_2; +DROP TABLE nt_1; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test new file mode 100644 index 00000000000..d70d9b48834 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_mixed_implicit_commit_binlog.test @@ -0,0 +1,9 @@ +################################################################################ +# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test +################################################################################ +--source include/have_binlog_format_mixed.inc +--source include/have_ndb.inc +--source include/ndb_master-slave.inc + +--let $engine=NDB +--source extra/rpl_tests/rpl_implicit_commit_binlog.test diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test new file mode 100644 index 00000000000..3ddf659f1e9 --- /dev/null +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_row_implicit_commit_binlog.test @@ -0,0 +1,9 @@ +################################################################################ +# Check file extra/rpl_tests/rpl_implicit_commit_binlog.test +################################################################################ +--source include/have_binlog_format_row.inc +--source include/have_ndb.inc +--source include/ndb_master-slave.inc + +--let $engine=NDB +--source extra/rpl_tests/rpl_implicit_commit_binlog.test From 9220e09fbc3b33f0dd4858a52e17789e83dbca61 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Fri, 13 Nov 2009 18:29:30 +0000 Subject: [PATCH 19/69] BUG#44188: STOP SLAVE should flush info files and relay logs. Replication info files are not being flushed and synced when the command 'STOP SLAVE' is issued. This means that one cannot just rely on existing values on those files when the slave has been stopped. Having consistent, uncorrupted and up-to-date info files when stopping the slave would be most useful, for instance, for snapshotting purposes (a procedure that is often used for restoring slaves). This patch addresses this by instrumenting the terminate_slave_threads function so that it also flushes and syncs the *info files as well as the relay log whenever it gets called, ie, on 'STOP SLAVE'. Although this imposes a performance trade-off (specifically when stopping the slave), it should have no negative influence on overall replication performance (impact is only noticeable on 'STOP SLAVE'). --- sql/slave.cc | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/sql/slave.cc b/sql/slave.cc index c35f0641729..faee649be32 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -470,6 +470,7 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) DBUG_RETURN(0); /* successfully do nothing */ int error,force_all = (thread_mask & SLAVE_FORCE_ALL); pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock; + pthread_mutex_t *log_lock= mi->rli.relay_log.get_log_lock(); if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) { @@ -481,6 +482,22 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) skip_lock)) && !force_all) DBUG_RETURN(error); + + pthread_mutex_lock(log_lock); + + DBUG_PRINT("info",("Flushing relay log and master info file.")); + if (current_thd) + thd_proc_info(current_thd, "Flushing relay log and master info files."); + if (flush_master_info(mi, TRUE /* flush relay log */)) + DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS); + + if (my_sync(mi->rli.relay_log.get_log_file()->file, MYF(MY_WME))) + DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS); + + if (my_sync(mi->fd, MYF(MY_WME))) + DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS); + + pthread_mutex_unlock(log_lock); } if (thread_mask & (SLAVE_SQL|SLAVE_FORCE_ALL)) { @@ -492,8 +509,21 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) skip_lock)) && !force_all) DBUG_RETURN(error); + + pthread_mutex_lock(log_lock); + + DBUG_PRINT("info",("Flushing relay-log info file.")); + if (current_thd) + thd_proc_info(current_thd, "Flushing relay-log info file."); + if (flush_relay_log_info(&mi->rli)) + DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS); + + if (my_sync(mi->rli.info_fd, MYF(MY_WME))) + DBUG_RETURN(ER_ERROR_DURING_FLUSH_LOGS); + + pthread_mutex_unlock(log_lock); } - DBUG_RETURN(0); + DBUG_RETURN(0); } @@ -4421,8 +4451,9 @@ MYSQL *rpl_connect_master(MYSQL *mysql) rli Relay log information NOTES - - As this is only called by the slave thread, we don't need to - have a lock on this. + - As this is only called by the slave thread or on STOP SLAVE, with the + log_lock grabbed and the slave thread stopped, we don't need to have + a lock here. - If there is an active transaction, then we don't update the position in the relay log. This is to ensure that we re-execute statements if we die in the middle of an transaction that was rolled back. @@ -4473,7 +4504,10 @@ bool flush_relay_log_info(Relay_log_info* rli) error=1; rli->sync_counter= 0; } - /* Flushing the relay log is done by the slave I/O thread */ + /* + Flushing the relay log is done by the slave I/O thread + or by the user on STOP SLAVE. + */ DBUG_RETURN(error); } From 558feaa2087397d43a48116743dcdaee9558485e Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Sun, 15 Nov 2009 11:30:58 +0800 Subject: [PATCH 20/69] Postfix after merge After fix of bug46322, logging to table is turned off, each test that need this should turn on it in it's opt file. Add suppression to unsafe statement warnings for binlog_unsafe.test. mysql-test/suite/binlog/t/binlog_unsafe-master.opt: After fix of bug46322, logging to table is turned off, each test that need this should turn on it in it's opt file. mysql-test/suite/binlog/t/binlog_unsafe.test: suppress Unsafe statement warnings --- mysql-test/suite/binlog/t/binlog_unsafe-master.opt | 2 +- mysql-test/suite/binlog/t/binlog_unsafe.test | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/binlog/t/binlog_unsafe-master.opt b/mysql-test/suite/binlog/t/binlog_unsafe-master.opt index 7d8786c156a..78bcdd89270 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe-master.opt +++ b/mysql-test/suite/binlog/t/binlog_unsafe-master.opt @@ -1 +1 @@ -$UDF_EXAMPLE_LIB_OPT +$UDF_EXAMPLE_LIB_OPT --log-output=file,table diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index 8fb09fe9ab7..34c1dc0cd01 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -96,6 +96,10 @@ --source include/have_log_bin.inc --source include/have_binlog_format_statement.inc +--disable_query_log +call mtr.add_suppression("Unsafe statement binlogged in statement format"); +--enable_query_log + --echo #### Setup tables #### CREATE TABLE t0 (a CHAR(100)); From ac647f5a3eb12313f981800ac1fd0c562402abcc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Dec 2009 16:59:58 +0800 Subject: [PATCH 21/69] WL#5142 FLUSH LOGS should take optional arguments for which log(s) to flush Support for flushing individual logs, so that the user can selectively flush a subset of the server logs. Flush of individual logs is done according to the following syntax: FLUSH LOGS; The syntax is extended so that the user is able to flush a subset of logs: FLUSH [log_category LOGS,]; where log_category is one of: SLOW ERROR BINARY ENGINE GENERAL RELAY. mysql-test/suite/rpl/r/rpl_flush_logs.result: Test result for WL#5142. mysql-test/suite/rpl/t/rpl_flush_logs.test: Added the test file to verify if the 'flush individual log' statement works fine. sql/log.cc: Added the two functions to flush slow and general log. sql/sql_parse.cc: Added code to flush specified logs against the option. sql/sql_yacc.yy: Added code to parse the 'flush * log' statement syntax and set its option to Lex->type. --- include/mysql_com.h | 6 + mysql-test/suite/rpl/r/rpl_flush_logs.result | 67 +++++++ .../suite/rpl/t/rpl_flush_logs-master.opt | 1 + mysql-test/suite/rpl/t/rpl_flush_logs.test | 172 ++++++++++++++++++ sql/lex.h | 4 + sql/log.cc | 48 +++++ sql/log.h | 2 + sql/sql_parse.cc | 39 ++-- sql/sql_yacc.yy | 18 ++ 9 files changed, 346 insertions(+), 11 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_flush_logs.result create mode 100644 mysql-test/suite/rpl/t/rpl_flush_logs-master.opt create mode 100644 mysql-test/suite/rpl/t/rpl_flush_logs.test diff --git a/include/mysql_com.h b/include/mysql_com.h index db5a5eb8741..43bdcb4c3c7 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -115,6 +115,12 @@ enum enum_server_command thread */ #define REFRESH_MASTER 128 /* Remove all bin logs in the index and truncate the index */ +#define REFRESH_ERROR_LOG 256 /* Rotate only the erorr log */ +#define REFRESH_ENGINE_LOG 512 /* Flush all storage engine logs */ +#define REFRESH_BINARY_LOG 1024 /* Flush the binary log */ +#define REFRESH_RELAY_LOG 2048 /* Flush the relay log */ +#define REFRESH_GENERAL_LOG 4096 /* Flush the general log */ +#define REFRESH_SLOW_LOG 8192 /* Flush the slow query log */ /* The following can't be set with mysql_refresh() */ #define REFRESH_READ_LOCK 16384 /* Lock tables for read */ diff --git a/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-test/suite/rpl/r/rpl_flush_logs.result new file mode 100644 index 00000000000..7f50ce0cdd0 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_flush_logs.result @@ -0,0 +1,67 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +# Make sure the 'master_log.err-old' file does not +# exist before execute 'flush error logs' statement. +# Test if support 'flush error logs' statement. +flush error logs; +# Check the 'master_log.err-old' file is created +# after executed 'flush error logs' statement. +# Make sure binary logs was not be flushed +# after execute 'flush error logs' statement. +# Make sure relay logs was not be flushed +# after execute 'flush error logs' statement. +# Make sure the 'slave-relay-bin.000004' file does not +# exist before execute 'flush relay logs' statement. +# Test if support 'flush relay logs' statement. +flush relay logs; +# Check the 'slave-relay-bin.000004' file is created +# after executed 'flush relay logs' statement. +# Make sure binary logs was not be flushed +# after execute 'flush relay logs' statement. +# Test if support 'flush slow logs' statement. +flush slow logs; +# Make sure binary logs was not be flushed +# after execute 'flush slow logs' statement. +# Test if support 'flush general logs' statement. +flush general logs; +# Make sure binary logs was not be flushed +# after execute 'flush general logs' statement. +# Test if support 'flush engine logs' statement. +flush engine logs; +# Make sure binary logs was not be flushed +# after execute 'flush engine logs' statement. +# Make sure the 'master-bin.000002' file does not +# exist before execute 'flush binary logs' statement. +# Test if support 'flush binary logs' statement. +flush binary logs; +# Check the 'master-bin.000002' file is created +# after executed 'flush binary logs' statement. +# Make sure the 'slave-relay-bin.000007' file does not exist +# exist before execute 'flush error logs, relay logs' statement. +# Make sure the 'master_log.err-old' file does not exist +# before execute 'flush error logs, relay logs' statement. +# Test if support to combine all kinds of logs into one statement. +flush error logs, relay logs; +# Check the 'master_log.err-old' file is created +# after executed 'flush error logs, relay logs' statement. +# Make sure binary logs was not be flushed +# after execute 'flush error logs, relay logs' statement. +# Check the 'slave-relay-bin.000007' file is created after +# execute 'flush error logs, relay logs' statement. +# Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009' +# files do not exist before execute 'flush error logs, relay logs' +# statement. +# Make sure the 'master_log.err-old' file does not exist +# before execute 'flush logs' statement. +# Test if 'flush logs' statement works fine and flush all the logs. +flush logs; +# Check the 'master_log.err-old' file is created +# after executed 'flush logs' statement. +# Check 'master-bin.000003' is created +# after execute 'flush logs' statement. +# Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009' +# files are created after execute 'flush logs' statement. diff --git a/mysql-test/suite/rpl/t/rpl_flush_logs-master.opt b/mysql-test/suite/rpl/t/rpl_flush_logs-master.opt new file mode 100644 index 00000000000..36eab1d6c8f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_flush_logs-master.opt @@ -0,0 +1 @@ +--log-error=$MYSQLTEST_VARDIR/tmp/master_log.err diff --git a/mysql-test/suite/rpl/t/rpl_flush_logs.test b/mysql-test/suite/rpl/t/rpl_flush_logs.test new file mode 100644 index 00000000000..2118b48f946 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_flush_logs.test @@ -0,0 +1,172 @@ +# +# WL#5124 +# This test verifies if the 'flush individual logs' statement +# works fine. +# + +--source include/master-slave.inc +--source include/have_binlog_format_statement.inc +connection master; + +# Test 'flush error logs' statement. +--echo # Make sure the 'master_log.err-old' file does not +--echo # exist before execute 'flush error logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old; + +--echo # Test if support 'flush error logs' statement. +flush error logs; + +--echo # Check the 'master_log.err-old' file is created +--echo # after executed 'flush error logs' statement. +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old; +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; + +--echo # Make sure binary logs was not be flushed +--echo # after execute 'flush error logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; + +sync_slave_with_master; +--echo # Make sure relay logs was not be flushed +--echo # after execute 'flush error logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004; + + +# Test 'flush relay logs' statement. +--echo # Make sure the 'slave-relay-bin.000004' file does not +--echo # exist before execute 'flush relay logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004; + +connection master; +--echo # Test if support 'flush relay logs' statement. +flush relay logs; + +sync_slave_with_master; +--echo # Check the 'slave-relay-bin.000004' file is created +--echo # after executed 'flush relay logs' statement. +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000004; + +connection master; +--echo # Make sure binary logs was not be flushed +--echo # after execute 'flush relay logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; + + +# Test 'flush slow logs' statement. +--echo # Test if support 'flush slow logs' statement. +flush slow logs; + +--echo # Make sure binary logs was not be flushed +--echo # after execute 'flush slow logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; + + +# Test 'flush general logs' statement. +--echo # Test if support 'flush general logs' statement. +flush general logs; + +--echo # Make sure binary logs was not be flushed +--echo # after execute 'flush general logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; + + +# Test 'flush engine logs' statement. +--echo # Test if support 'flush engine logs' statement. +flush engine logs; + +--echo # Make sure binary logs was not be flushed +--echo # after execute 'flush engine logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; + + +# Test 'flush binary logs' statement. +--echo # Make sure the 'master-bin.000002' file does not +--echo # exist before execute 'flush binary logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; + +--echo # Test if support 'flush binary logs' statement. +flush binary logs; + +--echo # Check the 'master-bin.000002' file is created +--echo # after executed 'flush binary logs' statement. +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000002; +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000001; + + +# Test 'flush error logs, relay logs' statement +sync_slave_with_master; +--echo # Make sure the 'slave-relay-bin.000007' file does not exist +--echo # exist before execute 'flush error logs, relay logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; + +connection master; +remove_file $MYSQLTEST_VARDIR/tmp/master_log.err-old; + +--echo # Make sure the 'master_log.err-old' file does not exist +--echo # before execute 'flush error logs, relay logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old; + +--echo # Test if support to combine all kinds of logs into one statement. +flush error logs, relay logs; + +--echo # Check the 'master_log.err-old' file is created +--echo # after executed 'flush error logs, relay logs' statement. +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old; +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; + +--echo # Make sure binary logs was not be flushed +--echo # after execute 'flush error logs, relay logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003; + +sync_slave_with_master; +--echo # Check the 'slave-relay-bin.000007' file is created after +--echo # execute 'flush error logs, relay logs' statement. +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; + + +# Test 'flush logs' statement +--echo # Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009' +--echo # files do not exist before execute 'flush error logs, relay logs' +--echo # statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; +--error 1 +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009; + +connection master; +remove_file $MYSQLTEST_VARDIR/tmp/master_log.err-old; + +--echo # Make sure the 'master_log.err-old' file does not exist +--echo # before execute 'flush logs' statement. +--error 1 +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old; + +--echo # Test if 'flush logs' statement works fine and flush all the logs. +flush logs; + +--echo # Check the 'master_log.err-old' file is created +--echo # after executed 'flush logs' statement. +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old; +file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; + +--echo # Check 'master-bin.000003' is created +--echo # after execute 'flush logs' statement. +file_exists $MYSQLTEST_VARDIR/mysqld.1/data/master-bin.000003; + +sync_slave_with_master; +--echo # Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009' +--echo # files are created after execute 'flush logs' statement. +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; +file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009; + diff --git a/sql/lex.h b/sql/lex.h index 71d52914e3b..b1a88b200e6 100644 --- a/sql/lex.h +++ b/sql/lex.h @@ -189,6 +189,7 @@ static SYMBOL symbols[] = { { "ENGINE", SYM(ENGINE_SYM)}, { "ENGINES", SYM(ENGINES_SYM)}, { "ENUM", SYM(ENUM)}, + { "ERROR", SYM(ERROR_SYM)}, { "ERRORS", SYM(ERRORS)}, { "ESCAPE", SYM(ESCAPE_SYM)}, { "ESCAPED", SYM(ESCAPED)}, @@ -223,6 +224,7 @@ static SYMBOL symbols[] = { { "FULL", SYM(FULL)}, { "FULLTEXT", SYM(FULLTEXT_SYM)}, { "FUNCTION", SYM(FUNCTION_SYM)}, + { "GENERAL", SYM(GENERAL)}, { "GEOMETRY", SYM(GEOMETRY_SYM)}, { "GEOMETRYCOLLECTION",SYM(GEOMETRYCOLLECTION)}, { "GET_FORMAT", SYM(GET_FORMAT)}, @@ -429,6 +431,7 @@ static SYMBOL symbols[] = { { "REDUNDANT", SYM(REDUNDANT_SYM)}, { "REFERENCES", SYM(REFERENCES)}, { "REGEXP", SYM(REGEXP)}, + { "RELAY", SYM(RELAY)}, { "RELAYLOG", SYM(RELAYLOG_SYM)}, { "RELAY_LOG_FILE", SYM(RELAY_LOG_FILE_SYM)}, { "RELAY_LOG_POS", SYM(RELAY_LOG_POS_SYM)}, @@ -481,6 +484,7 @@ static SYMBOL symbols[] = { { "SIGNED", SYM(SIGNED_SYM)}, { "SIMPLE", SYM(SIMPLE_SYM)}, { "SLAVE", SYM(SLAVE)}, + { "SLOW", SYM(SLOW)}, { "SNAPSHOT", SYM(SNAPSHOT_SYM)}, { "SMALLINT", SYM(SMALLINT)}, { "SOCKET", SYM(SOCKET_SYM)}, diff --git a/sql/log.cc b/sql/log.cc index 3d863583859..1c95b21f533 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -965,6 +965,54 @@ bool LOGGER::flush_logs(THD *thd) } +/** + Close and reopen the slow log (with locks). + + @returns FALSE. +*/ +bool LOGGER::flush_slow_log() +{ + /* + Now we lock logger, as nobody should be able to use logging routines while + log tables are closed + */ + logger.lock_exclusive(); + + /* Reopen slow log file */ + if (opt_slow_log) + file_log_handler->get_mysql_slow_log()->reopen_file(); + + /* End of log flush */ + logger.unlock(); + + return 0; +} + + +/** + Close and reopen the general log (with locks). + + @returns FALSE. +*/ +bool LOGGER::flush_general_log() +{ + /* + Now we lock logger, as nobody should be able to use logging routines while + log tables are closed + */ + logger.lock_exclusive(); + + /* Reopen general log file */ + if (opt_log) + file_log_handler->get_mysql_log()->reopen_file(); + + /* End of log flush */ + logger.unlock(); + + return 0; +} + + /* Log slow query with all enabled log event handlers diff --git a/sql/log.h b/sql/log.h index 9be86b797a7..76ca18c8288 100644 --- a/sql/log.h +++ b/sql/log.h @@ -570,6 +570,8 @@ public: void init_base(); void init_log_tables(); bool flush_logs(THD *thd); + bool flush_slow_log(); + bool flush_general_log(); /* Perform basic logger cleanup. this will leave e.g. error log open. */ void cleanup_base(); /* Free memory. Nothing could be logged after this function is called */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 80f366d774a..0a6c04b82ce 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -6664,6 +6664,30 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, tables. */ + options|= REFRESH_BINARY_LOG; + options|= REFRESH_RELAY_LOG; + options|= REFRESH_SLOW_LOG; + options|= REFRESH_GENERAL_LOG; + options|= REFRESH_ENGINE_LOG; + options|= REFRESH_ERROR_LOG; + } + + if (options & REFRESH_ERROR_LOG) + if (flush_error_log()) + result= 1; + + if ((options & REFRESH_SLOW_LOG) && opt_slow_log) + logger.flush_slow_log(); + + if ((options & REFRESH_GENERAL_LOG) && opt_log) + logger.flush_general_log(); + + if (options & REFRESH_ENGINE_LOG) + if (ha_flush_logs(NULL)) + result= 1; + + if (options & REFRESH_BINARY_LOG) + { /* Writing this command to the binlog may result in infinite loops when doing mysqlbinlog|mysql, and anyway it does not really make @@ -6671,23 +6695,16 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, than it would help them) */ tmp_write_to_binlog= 0; - if( mysql_bin_log.is_open() ) - { + if (mysql_bin_log.is_open()) mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE); - } + } + if (options & REFRESH_RELAY_LOG) + { #ifdef HAVE_REPLICATION pthread_mutex_lock(&LOCK_active_mi); rotate_relay_log(active_mi); pthread_mutex_unlock(&LOCK_active_mi); #endif - - /* flush slow and general logs */ - logger.flush_logs(thd); - - if (ha_flush_logs(NULL)) - result=1; - if (flush_error_log()) - result=1; } #ifdef HAVE_QUERY_CACHE if (options & REFRESH_QUERY_CACHE_FREE) diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1b85e5afdce..577f0b5ef71 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -681,6 +681,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token ENUM %token EQ /* OPERATOR */ %token EQUAL_SYM /* OPERATOR */ +%token ERROR_SYM %token ERRORS %token ESCAPED %token ESCAPE_SYM /* SQL-2003-R */ @@ -714,6 +715,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token FULLTEXT_SYM %token FUNCTION_SYM /* SQL-2003-R */ %token GE +%token GENERAL %token GEOMETRYCOLLECTION %token GEOMETRY_SYM %token GET_FORMAT /* MYSQL-FUNC */ @@ -931,6 +933,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token REDUNDANT_SYM %token REFERENCES /* SQL-2003-R */ %token REGEXP +%token RELAY %token RELAYLOG_SYM %token RELAY_LOG_FILE_SYM %token RELAY_LOG_POS_SYM @@ -985,6 +988,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); %token SIGNED_SYM %token SIMPLE_SYM /* SQL-2003-N */ %token SLAVE +%token SLOW %token SMALLINT /* SQL-2003-R */ %token SNAPSHOT_SYM %token SOCKET_SYM @@ -10313,6 +10317,18 @@ flush_option: opt_table_list {} | TABLES WITH READ_SYM LOCK_SYM { Lex->type|= REFRESH_TABLES | REFRESH_READ_LOCK; } + | ERROR_SYM LOGS_SYM + { Lex->type|= REFRESH_ERROR_LOG; } + | ENGINE_SYM LOGS_SYM + { Lex->type|= REFRESH_ENGINE_LOG; } + | GENERAL LOGS_SYM + { Lex->type|= REFRESH_GENERAL_LOG; } + | SLOW LOGS_SYM + { Lex->type|= REFRESH_SLOW_LOG; } + | BINARY LOGS_SYM + { Lex->type|= REFRESH_BINARY_LOG; } + | RELAY LOGS_SYM + { Lex->type|= REFRESH_RELAY_LOG; } | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE_FREE; } | HOSTS_SYM @@ -11436,6 +11452,7 @@ keyword_sp: | ENUM {} | ENGINE_SYM {} | ENGINES_SYM {} + | ERROR_SYM {} | ERRORS {} | ESCAPE_SYM {} | EVENT_SYM {} @@ -11560,6 +11577,7 @@ keyword_sp: | REDO_BUFFER_SIZE_SYM {} | REDOFILE_SYM {} | REDUNDANT_SYM {} + | RELAY {} | RELAYLOG_SYM {} | RELAY_LOG_FILE_SYM {} | RELAY_LOG_POS_SYM {} From 571843804c1b22e7ff641f5dfe223958c4af70fc Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 14 Dec 2009 12:04:55 +0100 Subject: [PATCH 22/69] WL#5151: Conversion between different types when replicating Row-based replication requires the types of columns on the master and slave to be approximately the same (some safe conversions between strings are allowed), but does not allow safe conversions between fields of similar types such as TINYINT and INT. This patch implement type conversions between similar fields on the master and slave. The conversions are controlled using a new variable SLAVE_TYPE_CONVERSIONS of type SET('ALL_LOSSY','ALL_NON_LOSSY'). Non-lossy conversions are any conversions that do not run the risk of losing any information, while lossy conversions can potentially truncate the value. The column definitions are checked to decide if the conversion is acceptable. If neither conversion is enabled, it is required that the definitions of the columns are identical on master and slave. Conversion is done by creating an internal conversion table, unpacking the master data into it, and then copy the data to the real table on the slave. .bzrignore: New files added client/Makefile.am: New files added client/mysqlbinlog.cc: Functions in rpl_utility.cc is now needed by mysqlbinlog.cc. libmysqld/Makefile.am: New files added mysql-test/extra/rpl_tests/check_type.inc: Test include file to check a single type conversion. mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test: Switching to use INT instead of TEXT for column that should not have matching types. mysql-test/extra/rpl_tests/rpl_row_basic.test: Adding code to enable type conversions for BIT tests since InnoDB cannot handle them properly due to incorrect information stored as metadata. mysql-test/extra/rpl_tests/type_conversions.test: Test file to check a set of type conversions with current settings of slave_type_conversions. mysql-test/suite/rpl/t/rpl_typeconv.test: Test file to test conversions from master to slave with all possible values for slave_type_conversions. The test also checks that the slave_type_conversions variable works as expected. sql/field.cc: Changing definition of compatible_field_size to both check if two field with identical base types are compatible and give an order between them if they are compatible. This only implement checking on the slave, so it will not affect replication from an old master to a new slave. sql/field.h: Changing prototypes for functions: - compatible_field_size() - init_for_tmp_table() - row_pack_length() sql/log_event.cc: Changing compability checks to build a conversion table if the fields are compatible, but does not have the same base type. sql/log_event_old.cc: Changing compability checks to build a conversion table if the fields are compatible, but does not have the same base type. sql/mysql_priv.h: Adding global option variable for SLAVE_TYPE_CONVERSIONS sql/mysqld.cc: Adding SLAVE_TYPE_CONVERSIONS global server variable. sql/rpl_record.cc: Changing unpack_row to use the conversion table if present. sql/rpl_rli.h: Removing function get_tabledef and replacing it with get_table_data(). This function retrieve data for table opened for replication, not just table definition. sql/rpl_utility.cc: Function table_def::compatible_with is changed to compare table on master and slave for compatibility and generate a conversions table if they are compatible. Computing real type of fields from metadata for ENUM and SET types. Computing pack_length correctly for ENUM, SET, and BLOB types. Adding optimization to not check compatibility if no slave type conversions are enabled. sql/rpl_utility.h: Changing prototypes since implementation has changed. Modifying table_def::type() to return real type instead of stored type. sql/set_var.cc: Adding SLAVE_TYPE_CONVERSIONS variable. sql/set_var.h: Adding SLAVE_TYPE_CONVERSIONS variable. sql/share/errmsg.txt: Adding error messages for slave type conversions. sql/sql_class.h: Adding SLAVE_TYPE_CONVERSIONS variable. sql/sql_select.cc: Correcting create_virtual_tmp_table() to compute null bit positions correctly in the presence of bit fields. --- .bzrignore | 2 + client/Makefile.am | 3 +- client/mysqlbinlog.cc | 2 +- libmysqld/Makefile.am | 2 +- mysql-test/extra/rpl_tests/check_type.inc | 52 + .../extra/rpl_tests/rpl_extraSlave_Col.test | 7 +- mysql-test/extra/rpl_tests/rpl_row_basic.test | 39 +- .../extra/rpl_tests/type_conversions.test | 710 ++++++++++++++ mysql-test/suite/rpl/r/rpl_bug31076.result | 3 + mysql-test/suite/rpl/r/rpl_colSize.result | 3 + .../suite/rpl/r/rpl_extraCol_innodb.result | 69 +- .../suite/rpl/r/rpl_extraCol_myisam.result | 69 +- .../rpl/r/rpl_extraColmaster_innodb.result | 48 +- .../rpl/r/rpl_extraColmaster_myisam.result | 48 +- .../suite/rpl/r/rpl_row_basic_2myisam.result | 12 +- .../suite/rpl/r/rpl_row_basic_3innodb.result | 18 +- mysql-test/suite/rpl/r/rpl_row_colSize.result | 104 +- .../rpl/r/rpl_row_tabledefs_2myisam.result | 12 +- .../rpl/r/rpl_row_tabledefs_3innodb.result | 12 +- mysql-test/suite/rpl/r/rpl_typeconv.result | 466 +++++++++ mysql-test/suite/rpl/t/rpl_bug31076.test | 6 + mysql-test/suite/rpl/t/rpl_colSize.test | 5 + .../suite/rpl/t/rpl_row_basic_3innodb.test | 2 + mysql-test/suite/rpl/t/rpl_typeconv.test | 69 ++ sql/field.cc | 267 ++++-- sql/field.h | 45 +- sql/log_event.cc | 23 +- sql/log_event_old.cc | 22 +- sql/mysql_priv.h | 1 + sql/mysqld.cc | 23 + sql/rpl_record.cc | 63 +- sql/rpl_rli.h | 20 +- sql/rpl_utility.cc | 886 +++++++++++++++++- sql/rpl_utility.h | 186 ++-- sql/set_var.cc | 34 +- sql/set_var.h | 1 + sql/share/errmsg.txt | 5 + sql/sql_class.h | 6 + sql/sql_select.cc | 12 + 39 files changed, 2893 insertions(+), 464 deletions(-) create mode 100644 mysql-test/extra/rpl_tests/check_type.inc create mode 100644 mysql-test/extra/rpl_tests/type_conversions.test create mode 100644 mysql-test/suite/rpl/r/rpl_typeconv.result create mode 100644 mysql-test/suite/rpl/t/rpl_typeconv.test diff --git a/.bzrignore b/.bzrignore index e1e2083e2d2..c87963acb3e 100644 --- a/.bzrignore +++ b/.bzrignore @@ -392,6 +392,7 @@ client/rpl_record_old.h client/rpl_tblmap.h client/rpl_tblmap.cc client/rpl_utility.h +client/rpl_utility.cc client/select_test client/sql_string.cpp client/ssl_test @@ -1142,6 +1143,7 @@ libmysqld/rpl_filter.cc libmysqld/rpl_injector.cc libmysqld/rpl_record.cc libmysqld/rpl_record_old.cc +libmysqld/rpl_utility.cc libmysqld/scheduler.cc libmysqld/set_var.cc libmysqld/simple-test diff --git a/client/Makefile.am b/client/Makefile.am index ccd0d8aada0..14343bc60c3 100644 --- a/client/Makefile.am +++ b/client/Makefile.am @@ -104,9 +104,10 @@ DEFS = -DMYSQL_CLIENT_NO_THREADS \ -DMYSQL_DATADIR="\"$(localstatedir)\"" sql_src=log_event.h mysql_priv.h rpl_constants.h \ - rpl_utility.h rpl_tblmap.h rpl_tblmap.cc \ + rpl_tblmap.h rpl_tblmap.cc \ log_event.cc my_decimal.h my_decimal.cc \ log_event_old.h log_event_old.cc \ + rpl_utility.h rpl_utility.cc \ rpl_record_old.h rpl_record_old.cc strings_src=decimal.c diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index ebe34231238..97b991f9084 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -2108,4 +2108,4 @@ int main(int argc, char** argv) #include "my_decimal.cc" #include "log_event.cc" #include "log_event_old.cc" - +#include "rpl_utility.cc" diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index 16c45816bbf..83fd091db00 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -55,7 +55,7 @@ sqlsources = derror.cc field.cc field_conv.cc strfunc.cc filesort.cc \ item_geofunc.cc item_subselect.cc item_row.cc\ item_xmlfunc.cc \ key.cc lock.cc log.cc sql_state.c \ - log_event.cc rpl_record.cc \ + log_event.cc rpl_record.cc rpl_utility.cc \ log_event_old.cc rpl_record_old.cc \ protocol.cc net_serv.cc opt_range.cc \ opt_sum.cc procedure.cc records.cc sql_acl.cc \ diff --git a/mysql-test/extra/rpl_tests/check_type.inc b/mysql-test/extra/rpl_tests/check_type.inc new file mode 100644 index 00000000000..63491d81da4 --- /dev/null +++ b/mysql-test/extra/rpl_tests/check_type.inc @@ -0,0 +1,52 @@ +# Helper file to perform one insert of a value into a table with +# different types on master and slave. The file will insert the +# result into the type_conversions table *on the slave* to get a +# summary of failing and succeeding tests. + +# Input: +# $source_type Type on the master +# $target_type Type on the slave +# $source_value Value on the master (inserted into the table) +# $target_value Value on the slave (expected value in the table +# on the slave) +# $can_convert True if conversion shall work, false if it +# shall generate an error + + +connection master; +disable_warnings; +DROP TABLE IF EXISTS t1; +enable_warnings; +eval CREATE TABLE t1 (a $source_type); +sync_slave_with_master; +eval ALTER TABLE t1 MODIFY a $target_type; + +connection master; +eval INSERT INTO t1 VALUES($source_value); +if ($can_convert) { + sync_slave_with_master; + eval SELECT a = $target_value into @compare FROM t1; + eval INSERT INTO type_conversions SET + Source = "$source_type", + Target = "$target_type", + Flags = @@slave_type_conversions, + On_Master = $source_value, + Expected = $target_value, + Compare = @compare; + UPDATE type_conversions + SET On_Slave = (SELECT a FROM t1) + WHERE TestNo = LAST_INSERT_ID(); +} +if (!$can_convert) { + connection slave; + wait_for_slave_to_stop; + let $error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); + eval INSERT INTO type_conversions SET + Source = "$source_type", + Target = "$target_type", + Flags = @@slave_type_conversions, + On_Master = $source_value, + Error = "$error"; + SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1; + START SLAVE; +} diff --git a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test index a7b02065144..98aac8a0e58 100644 --- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test +++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test @@ -36,6 +36,9 @@ sync_slave_with_master; STOP SLAVE; RESET SLAVE; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; + eval CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(4) DEFAULT 'TEST') @@ -62,6 +65,8 @@ SELECT * FROM t1 ORDER BY a; sync_slave_with_master; SELECT * FROM t1 ORDER BY a; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; + --echo *** Drop t1 *** connection master; DROP TABLE t1; @@ -495,7 +500,7 @@ sync_slave_with_master; --echo *** Create t11 on slave *** STOP SLAVE; RESET SLAVE; -eval CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +eval CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=$engine_type; --echo *** Create t11 on Master *** diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test index 0ba27c69a55..a45527848be 100644 --- a/mysql-test/extra/rpl_tests/rpl_row_basic.test +++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test @@ -6,6 +6,7 @@ # First we test tables with only an index. # +connection master; eval CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)$extra_index_t1) ENGINE = $type ; SELECT * FROM t1; sync_slave_with_master; @@ -156,6 +157,12 @@ SELECT * FROM t5,t2,t3 WHERE t5.C2='Q' AND t2.c12='R' AND t3.C3 ='S' ORDER BY t5 # Testing special column types # +if (`select char_length('$bit_field_special') > 0`) { + SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; + connection slave; + eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special'; +} + connection master; eval CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = $type ; @@ -164,6 +171,10 @@ SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; sync_slave_with_master; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; +if (`select char_length('$bit_field_special') > 0`) { + SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; +} + # # Testing conflicting operations # @@ -350,6 +361,10 @@ eval CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = $type ; +connection slave; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; + --echo [expecting slave to replicate correctly] connection master; INSERT INTO t1 VALUES (1, "", 1); @@ -370,17 +385,9 @@ let $diff_table_1=master:test.t2; let $diff_table_2=slave:test.t2; source include/diff_tables.inc; ---echo [expecting slave to stop] -connection master; -INSERT INTO t3 VALUES (1, "", 1); -INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); - connection slave; -source include/wait_for_slave_sql_to_stop.inc; -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; + connection master; RESET MASTER; connection slave; @@ -600,7 +607,15 @@ sync_slave_with_master; connection master; +# Since t1 contain a bit field, we have to do this trick to handle InnoDB +if (`select char_length('$bit_field_special') > 0`) { + SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; + connection slave; + eval SET GLOBAL SLAVE_TYPE_CONVERSIONS = '$bit_field_special'; +} + --disable_warnings +connection master; eval CREATE TABLE t1 (a bit) ENGINE=$type; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); @@ -645,6 +660,10 @@ UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; sync_slave_with_master; +if (`select char_length('$bit_field_special') > 0`) { + SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; +} + let $diff_table_1=master:test.t1; let $diff_table_2=slave:test.t1; source include/diff_tables.inc; diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test new file mode 100644 index 00000000000..2be1f6c0bec --- /dev/null +++ b/mysql-test/extra/rpl_tests/type_conversions.test @@ -0,0 +1,710 @@ +# File containing different lossy and non-lossy type conversions. + +# Integral conversion testing, we do not reduce the test using +# transitivity of conversions since the implementation is not using a +# transitivity strategy. Instead we do an exhaustive testing. + +disable_query_log; +connection slave; +--let $conv = `select @@slave_type_conversions` +--echo **** Running tests with @@SLAVE_TYPE_CONVERSIONS = '$conv' **** + +let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; +let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; + +let $source_type = BIT(1); +let $target_type = BIT(1); +let $source_value = b'1'; +let $target_value = b'1'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = DATE; +let $target_type = DATE; +let $source_value = '2009-11-21'; +let $target_value = '2009-11-21'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = ENUM('master','slave'); +let $target_type = ENUM('master','slave'); +let $source_value = 'master'; +let $target_value = 'master'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = CHAR(10); +let $target_type = ENUM('master','slave'); +let $source_value = 'master'; +let $target_value = 'master'; +let $can_convert = 0; +source extra/rpl_tests/check_type.inc; + +let $source_type = CHAR(10); +let $target_type = SET('master','slave'); +let $source_value = 'master'; +let $target_value = 'master'; +let $can_convert = 0; +source extra/rpl_tests/check_type.inc; + +let $source_type = ENUM('master','slave'); +let $target_type = CHAR(10); +let $source_value = 'master'; +let $target_value = 'master'; +let $can_convert = 0; +source extra/rpl_tests/check_type.inc; + +let $source_type = SET('master','slave'); +let $target_type = CHAR(10); +let $source_value = 'master'; +let $target_value = 'master'; +let $can_convert = 0; +source extra/rpl_tests/check_type.inc; + +let $source_type = SET('master','slave'); +let $target_type = SET('master','slave'); +let $source_value = ''; +let $target_value = ''; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = SET('master','slave'); +let $target_type = SET('master','slave'); +let $source_value = 'master,slave'; +let $target_value = 'master,slave'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = TINYINT; +let $target_type = TINYINT; +let $source_value = 1; +let $target_value = 1; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = TINYINT; +let $target_type = SMALLINT; +let $source_value = 1; +let $target_value = 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYINT; +let $target_type= MEDIUMINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYINT; +let $target_type= INT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYINT; +let $target_type= BIGINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= TINYINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= TINYINT; +let $source_value= 1 << 9; +let $target_value= (1 << 7) - 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= TINYINT UNSIGNED; +let $source_value= 1 << 9; +let $target_value= (1 << 8) - 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= SMALLINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= MEDIUMINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= INT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= SMALLINT; +let $target_type= BIGINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= TINYINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= TINYINT; +let $source_value= 1 << 20; +let $target_value= (1 << 7) - 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= TINYINT UNSIGNED; +let $source_value= 1 << 20; +let $target_value= (1 << 8) - 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= SMALLINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= MEDIUMINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= INT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMINT; +let $target_type= BIGINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= TINYINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= TINYINT; +let $source_value= (1 << 30); +let $target_value= (1 << 7) - 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= TINYINT UNSIGNED; +let $source_value= (1 << 30); +let $target_value= (1 << 8) - 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= SMALLINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= MEDIUMINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= INT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= INT; +let $target_type= BIGINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIGINT; +let $target_type= TINYINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIGINT; +let $target_type= SMALLINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIGINT; +let $target_type= MEDIUMINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIGINT; +let $target_type= INT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIGINT; +let $target_type= BIGINT; +let $source_value= 1; +let $target_value= 1; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= CHAR(20); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= CHAR(30); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= CHAR(10); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnood'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= VARCHAR(20); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= VARCHAR(30); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= VARCHAR(10); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnood'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= TINYTEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= TEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= MEDIUMTEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= CHAR(20); +let $target_type= LONGTEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= VARCHAR(20); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= VARCHAR(30); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= VARCHAR(10); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnood'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= CHAR(30); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= CHAR(10); +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnood'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= TINYTEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= TEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= MEDIUMTEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(20); +let $target_type= LONGTEXT; +let $source_value= 'Smoothnoodlemaps'; +let $target_value= 'Smoothnoodlemaps'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $blob = `select repeat('abcd', 125)`; +let $truncated_blob = `select left('$blob', 255)`; + +let $source_type= VARCHAR(500); +let $target_type= VARCHAR(500); +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(500); +let $target_type= VARCHAR(510); +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(500); +let $target_type= VARCHAR(255); +let $source_value= '$blob'; +let $target_value= '$truncated_blob'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(500); +let $target_type= TINYTEXT; +let $source_value= '$blob'; +let $target_value= '$truncated_blob'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(500); +let $target_type= TEXT; +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(500); +let $target_type= MEDIUMTEXT; +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= VARCHAR(500); +let $target_type= LONGTEXT; +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $tiny_blob = `select repeat('tiny blob ', 25)`; +let $truncated_tiny_blob = `select left('$tiny_blob', 254)`; + +let $source_type= TINYTEXT; +let $target_type= VARCHAR(500); +let $source_value= '$tiny_blob'; +let $target_value= '$tiny_blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TEXT; +let $target_type= VARCHAR(500); +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMTEXT; +let $target_type= VARCHAR(500); +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= LONGTEXT; +let $target_type= VARCHAR(500); +let $source_value= '$blob'; +let $target_value= '$blob'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYTEXT; +let $target_type= CHAR(255); +let $source_value= '$tiny_blob'; +let $target_value= '$tiny_blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYTEXT; +let $target_type= CHAR(250); +let $source_value= '$tiny_blob'; +let $target_value= left('$tiny_blob', 250); +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TEXT; +let $target_type= CHAR(255); +let $source_value= '$blob'; +let $target_value= left('$blob', 255); +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMTEXT; +let $target_type= CHAR(255); +let $source_value= '$blob'; +let $target_value= left('$blob', 255); +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= LONGTEXT; +let $target_type= CHAR(255); +let $source_value= '$blob'; +let $target_value= left('$blob', 255); +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYTEXT; +let $target_type= TINYTEXT; +let $source_value= '$tiny_blob'; +let $target_value= '$tiny_blob'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYTEXT; +let $target_type= TEXT; +let $source_value= '$tiny_blob'; +let $target_value= '$tiny_blob'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TEXT; +let $target_type= TINYTEXT; +let $source_value= '$blob'; +let $target_value= left('$blob',255); +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(10,5); +let $source_value= 3.14159; +let $target_value= 3.14159; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(10,6); +let $source_value= 3.14159; +let $target_value= 3.141590; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(11,5); +let $source_value= 3.14159; +let $target_value= 3.14159; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(11,6); +let $source_value= 3.14159; +let $target_value= 3.141590; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(10,4); +let $source_value= 3.14159; +let $target_value= 3.1416; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(9,5); +let $source_value= 3.14159; +let $target_value= 3.14159; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DECIMAL(9,4); +let $source_value= 3.14159; +let $target_value= 3.1416; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= FLOAT; +let $target_type= DECIMAL(10,5); +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DOUBLE; +let $target_type= DECIMAL(10,5); +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= FLOAT; +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DECIMAL(10,5); +let $target_type= DOUBLE; +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= FLOAT; +let $target_type= FLOAT; +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= DOUBLE; +let $target_type= DOUBLE; +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= FLOAT; +let $target_type= DOUBLE; +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= DOUBLE; +let $target_type= FLOAT; +let $source_value= 3.15625; +let $target_value= 3.15625; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIT(5); +let $target_type= BIT(5); +let $source_value= b'11001'; +let $target_value= b'11001'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIT(5); +let $target_type= BIT(6); +let $source_value= b'11001'; +let $target_value= b'11001'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIT(6); +let $target_type= BIT(5); +let $source_value= b'111001'; +let $target_value= b'11111'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIT(5); +let $target_type= BIT(12); +let $source_value= b'11001'; +let $target_value= b'11001'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BIT(12); +let $target_type= BIT(5); +let $source_value= b'101100111000'; +let $target_value= b'11111'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +disable_warnings; +source include/reset_master_and_slave.inc; +enable_warnings; +enable_query_log; \ No newline at end of file diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result index fd66ca85d57..76bce39fc43 100644 --- a/mysql-test/suite/rpl/r/rpl_bug31076.result +++ b/mysql-test/suite/rpl/r/rpl_bug31076.result @@ -4,6 +4,8 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE DATABASE track; USE track; CREATE TABLE `visits` ( @@ -65,5 +67,6 @@ visits_id myid src ip cc org ref time host entry visit_exit user_id visit_start SELECT * FROM visits_events; event_id visit_id timestamp src data visits_events_id 20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207 +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; DROP DATABASE track; End of 5.1 tests diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result index 91456742833..ae1ac3c7fed 100644 --- a/mysql-test/suite/rpl/r/rpl_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_colSize.result @@ -9,6 +9,8 @@ DROP TABLE IF EXISTS t1; *** Create "wider" table on slave *** STOP SLAVE; RESET SLAVE; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 ( a float (47), b double (143,9), @@ -177,3 +179,4 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 *** Cleanup *** DROP TABLE t1; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result index e2ec78e7adc..7107461b5f7 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result @@ -9,6 +9,8 @@ call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); *** On Slave *** STOP SLAVE; RESET SLAVE; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(4) DEFAULT 'TEST') @@ -32,6 +34,7 @@ a b c d e 1 2 TEXAS 2 TEST 2 1 AUSTIN 2 TEST 3 4 QA 2 TEST +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; *** Drop t1 *** DROP TABLE t1; *** Create t2 on slave *** @@ -73,8 +76,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -91,8 +94,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -140,8 +143,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -158,8 +161,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -202,8 +205,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -220,8 +223,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -264,8 +267,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +Last_Errno 1641 +Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -282,8 +285,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +Last_SQL_Errno 1641 +Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -325,8 +328,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_Errno 1641 +Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -343,8 +346,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -493,8 +496,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -511,8 +514,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -520,7 +523,7 @@ DROP TABLE t10; *** Create t11 on slave *** STOP SLAVE; RESET SLAVE; -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB'; *** Create t11 on Master *** CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) @@ -554,8 +557,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -572,8 +575,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -944,8 +947,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -962,8 +965,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result index ed5b4eac27d..7e78243a60c 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result @@ -9,6 +9,8 @@ call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); *** On Slave *** STOP SLAVE; RESET SLAVE; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(4) DEFAULT 'TEST') @@ -32,6 +34,7 @@ a b c d e 1 2 TEXAS 2 TEST 2 1 AUSTIN 2 TEST 3 4 QA 2 TEST +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; *** Drop t1 *** DROP TABLE t1; *** Create t2 on slave *** @@ -73,8 +76,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -91,8 +94,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -140,8 +143,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -158,8 +161,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -202,8 +205,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -220,8 +223,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -264,8 +267,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +Last_Errno 1641 +Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -282,8 +285,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +Last_SQL_Errno 1641 +Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -325,8 +328,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_Errno 1641 +Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -343,8 +346,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -493,8 +496,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -511,8 +514,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -520,7 +523,7 @@ DROP TABLE t10; *** Create t11 on slave *** STOP SLAVE; RESET SLAVE; -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM'; *** Create t11 on Master *** CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) @@ -554,8 +557,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -572,8 +575,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -944,8 +947,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -962,8 +965,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index ad67f96db71..65fdabaa37c 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -563,8 +563,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -581,8 +581,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -638,8 +638,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -656,8 +656,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1704,8 +1704,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -1722,8 +1722,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1779,8 +1779,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -1797,8 +1797,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2845,8 +2845,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -2863,8 +2863,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2920,8 +2920,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -2938,8 +2938,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index 8859a8e24e3..2aa36e3abd2 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -563,8 +563,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -581,8 +581,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -638,8 +638,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -656,8 +656,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1704,8 +1704,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -1722,8 +1722,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -1779,8 +1779,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -1797,8 +1797,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2845,8 +2845,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -2863,8 +2863,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -2920,8 +2920,8 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -2938,8 +2938,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result index a980092ac37..9c8f87af5af 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result @@ -476,6 +476,8 @@ ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'MYISAM' ; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -484,11 +486,7 @@ Comparing tables master:test.t1 and slave:test.t1 INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); Comparing tables master:test.t2 and slave:test.t2 -[expecting slave to stop] -INSERT INTO t3 VALUES (1, "", 1); -INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -501,7 +499,7 @@ Comparing tables master:test.t4 and slave:test.t4 INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)' RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -510,7 +508,7 @@ START SLAVE; INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)' RESET MASTER; STOP SLAVE; RESET SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result index ea0c322fe6d..4cf4c9fb27d 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result @@ -354,6 +354,8 @@ X Q 5 7 R 49 X Y 2 S 1 X Q 5 7 R 49 X Z 2 S 2 X Q 5 9 R 81 X Y 2 S 1 X Q 5 9 R 81 X Z 2 S 2 +SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY'; CREATE TABLE t4 (C1 CHAR(1) PRIMARY KEY, B1 BIT(1), B2 BIT(1) NOT NULL DEFAULT 0, C2 CHAR(1) NOT NULL DEFAULT 'A') ENGINE = 'INNODB' ; INSERT INTO t4 SET C1 = 1; SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; @@ -362,6 +364,7 @@ C1 HEX(B1) HEX(B2) SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1; C1 HEX(B1) HEX(B2) 1 NULL 0 +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'INNODB' ; --- on slave: original values --- INSERT INTO t7 VALUES (1,3), (2,6), (3,9); @@ -476,6 +479,8 @@ ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'INNODB' ; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -484,11 +489,7 @@ Comparing tables master:test.t1 and slave:test.t1 INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); Comparing tables master:test.t2 and slave:test.t2 -[expecting slave to stop] -INSERT INTO t3 VALUES (1, "", 1); -INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -501,7 +502,7 @@ Comparing tables master:test.t4 and slave:test.t4 INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)' RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -510,7 +511,7 @@ START SLAVE; INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)' RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -597,6 +598,8 @@ UPDATE t1 SET a = 0 WHERE a < 4; UPDATE t1 SET a = 8 WHERE a < 5; Comparing tables master:test.t1 and slave:test.t1 drop table t1; +SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY'; CREATE TABLE t1 (a bit) ENGINE='INNODB' ; INSERT IGNORE INTO t1 VALUES (NULL); INSERT INTO t1 ( a ) VALUES ( 0 ); @@ -637,5 +640,6 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0; UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2; INSERT INTO t1 ( a ) VALUES ( 1 ); UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; Comparing tables master:test.t1 and slave:test.t1 drop table t1; diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 6d002a722f1..29e96936c87 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -37,8 +37,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -55,8 +55,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -91,8 +91,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -109,8 +109,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -145,8 +145,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -163,8 +163,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -200,8 +200,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -218,8 +218,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -255,8 +255,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(8)' to type 'bit(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -273,8 +273,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(8)' to type 'bit(5)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -309,8 +309,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(5)' to type 'bit(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -327,8 +327,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(5)' to type 'bit(11)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -364,8 +364,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -382,8 +382,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -419,8 +419,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -437,8 +437,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -505,8 +505,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -523,8 +523,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -560,8 +560,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -578,8 +578,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -614,8 +614,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -632,8 +632,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -668,8 +668,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -686,8 +686,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -723,8 +723,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -741,8 +741,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob' SELECT COUNT(*) FROM t1; COUNT(*) 0 diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index a6a2181cd2a..7e9ccdc7c86 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -216,7 +216,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 +Last_Errno 1641 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -234,7 +234,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1535 +Last_SQL_Errno 1641 Last_SQL_Error SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -259,7 +259,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 +Last_Errno 1641 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -277,7 +277,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1535 +Last_SQL_Errno 1641 Last_SQL_Error SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -302,7 +302,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 +Last_Errno 1641 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -320,7 +320,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1535 +Last_SQL_Errno 1641 Last_SQL_Error SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index 02e8c074354..93d33d6aadb 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -216,7 +216,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 +Last_Errno 1641 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -234,7 +234,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1535 +Last_SQL_Errno 1641 Last_SQL_Error SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -259,7 +259,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 +Last_Errno 1641 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -277,7 +277,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1535 +Last_SQL_Errno 1641 Last_SQL_Error SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; @@ -302,7 +302,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 +Last_Errno 1641 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -320,7 +320,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1535 +Last_SQL_Errno 1641 Last_SQL_Error SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result new file mode 100644 index 00000000000..716956cf2cf --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -0,0 +1,466 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +set @saved_slave_type_conversions = @@global.slave_type_conversions; +CREATE TABLE type_conversions ( +TestNo INT AUTO_INCREMENT PRIMARY KEY, +Source TEXT, +Target TEXT, +Flags TEXT, +On_Master TEXT, +On_Slave TEXT, +Expected TEXT, +Compare INT, +Error TEXT); +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions + +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions + +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_NON_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_LOSSY,ALL_NON_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT'; +ERROR 42000: Variable 'slave_type_conversions' can't be set to the value of 'NONEXISTING_BIT' +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_LOSSY,ALL_NON_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' **** +**** Resetting master and slave **** +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/start_slave.inc +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' **** +**** Resetting master and slave **** +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/start_slave.inc +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' **** +**** Resetting master and slave **** +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/start_slave.inc +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' **** +**** Resetting master and slave **** +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/start_slave.inc +**** Result of conversions **** +Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave +BIT(1) BIT(1) +DATE DATE +ENUM('master',' ENUM('master',' +CHAR(10) ENUM('master',' +CHAR(10) SET('master','s +ENUM('master',' CHAR(10) +SET('master','s CHAR(10) +SET('master','s SET('master','s +SET('master','s SET('master','s +TINYINT TINYINT +TINYINT SMALLINT +TINYINT MEDIUMINT +TINYINT INT +TINYINT BIGINT +SMALLINT TINYINT +SMALLINT TINYINT +SMALLINT TINYINT UNSIGNE +SMALLINT SMALLINT +SMALLINT MEDIUMINT +SMALLINT INT +SMALLINT BIGINT +MEDIUMINT TINYINT +MEDIUMINT TINYINT +MEDIUMINT TINYINT UNSIGNE +MEDIUMINT SMALLINT +MEDIUMINT MEDIUMINT +MEDIUMINT INT +MEDIUMINT BIGINT +INT TINYINT +INT TINYINT +INT TINYINT UNSIGNE +INT SMALLINT +INT MEDIUMINT +INT INT +INT BIGINT +BIGINT TINYINT +BIGINT SMALLINT +BIGINT MEDIUMINT +BIGINT INT +BIGINT BIGINT +CHAR(20) CHAR(20) +CHAR(20) CHAR(30) +CHAR(20) CHAR(10) +CHAR(20) VARCHAR(20) +CHAR(20) VARCHAR(30) +CHAR(20) VARCHAR(10) +CHAR(20) TINYTEXT +CHAR(20) TEXT +CHAR(20) MEDIUMTEXT +CHAR(20) LONGTEXT +VARCHAR(20) VARCHAR(20) +VARCHAR(20) VARCHAR(30) +VARCHAR(20) VARCHAR(10) +VARCHAR(20) CHAR(30) +VARCHAR(20) CHAR(10) +VARCHAR(20) TINYTEXT +VARCHAR(20) TEXT +VARCHAR(20) MEDIUMTEXT +VARCHAR(20) LONGTEXT +VARCHAR(500) VARCHAR(500) +VARCHAR(500) VARCHAR(510) +VARCHAR(500) VARCHAR(255) +VARCHAR(500) TINYTEXT +VARCHAR(500) TEXT +VARCHAR(500) MEDIUMTEXT +VARCHAR(500) LONGTEXT +TINYTEXT VARCHAR(500) +TEXT VARCHAR(500) +MEDIUMTEXT VARCHAR(500) +LONGTEXT VARCHAR(500) +TINYTEXT CHAR(255) +TINYTEXT CHAR(250) +TEXT CHAR(255) +MEDIUMTEXT CHAR(255) +LONGTEXT CHAR(255) +TINYTEXT TINYTEXT +TINYTEXT TEXT +TEXT TINYTEXT +DECIMAL(10,5) DECIMAL(10,5) +DECIMAL(10,5) DECIMAL(10,6) +DECIMAL(10,5) DECIMAL(11,5) +DECIMAL(10,5) DECIMAL(11,6) +DECIMAL(10,5) DECIMAL(10,4) +DECIMAL(10,5) DECIMAL(9,5) +DECIMAL(10,5) DECIMAL(9,4) +FLOAT DECIMAL(10,5) +DOUBLE DECIMAL(10,5) +DECIMAL(10,5) FLOAT +DECIMAL(10,5) DOUBLE +FLOAT FLOAT +DOUBLE DOUBLE +FLOAT DOUBLE +DOUBLE FLOAT +BIT(5) BIT(5) +BIT(5) BIT(6) +BIT(6) BIT(5) +BIT(5) BIT(12) +BIT(12) BIT(5) +BIT(1) BIT(1) ALL_NON_LOSSY +DATE DATE ALL_NON_LOSSY +ENUM('master',' ENUM('master',' ALL_NON_LOSSY +CHAR(10) ENUM('master',' ALL_NON_LOSSY +CHAR(10) SET('master','s ALL_NON_LOSSY +ENUM('master',' CHAR(10) ALL_NON_LOSSY +SET('master','s CHAR(10) ALL_NON_LOSSY +SET('master','s SET('master','s ALL_NON_LOSSY +SET('master','s SET('master','s ALL_NON_LOSSY +TINYINT TINYINT ALL_NON_LOSSY +TINYINT SMALLINT ALL_NON_LOSSY +TINYINT MEDIUMINT ALL_NON_LOSSY +TINYINT INT ALL_NON_LOSSY +TINYINT BIGINT ALL_NON_LOSSY +SMALLINT TINYINT ALL_NON_LOSSY +SMALLINT TINYINT ALL_NON_LOSSY +SMALLINT TINYINT UNSIGNE ALL_NON_LOSSY +SMALLINT SMALLINT ALL_NON_LOSSY +SMALLINT MEDIUMINT ALL_NON_LOSSY +SMALLINT INT ALL_NON_LOSSY +SMALLINT BIGINT ALL_NON_LOSSY +MEDIUMINT TINYINT ALL_NON_LOSSY +MEDIUMINT TINYINT ALL_NON_LOSSY +MEDIUMINT TINYINT UNSIGNE ALL_NON_LOSSY +MEDIUMINT SMALLINT ALL_NON_LOSSY +MEDIUMINT MEDIUMINT ALL_NON_LOSSY +MEDIUMINT INT ALL_NON_LOSSY +MEDIUMINT BIGINT ALL_NON_LOSSY +INT TINYINT ALL_NON_LOSSY +INT TINYINT ALL_NON_LOSSY +INT TINYINT UNSIGNE ALL_NON_LOSSY +INT SMALLINT ALL_NON_LOSSY +INT MEDIUMINT ALL_NON_LOSSY +INT INT ALL_NON_LOSSY +INT BIGINT ALL_NON_LOSSY +BIGINT TINYINT ALL_NON_LOSSY +BIGINT SMALLINT ALL_NON_LOSSY +BIGINT MEDIUMINT ALL_NON_LOSSY +BIGINT INT ALL_NON_LOSSY +BIGINT BIGINT ALL_NON_LOSSY +CHAR(20) CHAR(20) ALL_NON_LOSSY +CHAR(20) CHAR(30) ALL_NON_LOSSY +CHAR(20) CHAR(10) ALL_NON_LOSSY +CHAR(20) VARCHAR(20) ALL_NON_LOSSY +CHAR(20) VARCHAR(30) ALL_NON_LOSSY +CHAR(20) VARCHAR(10) ALL_NON_LOSSY +CHAR(20) TINYTEXT ALL_NON_LOSSY +CHAR(20) TEXT ALL_NON_LOSSY +CHAR(20) MEDIUMTEXT ALL_NON_LOSSY +CHAR(20) LONGTEXT ALL_NON_LOSSY +VARCHAR(20) VARCHAR(20) ALL_NON_LOSSY +VARCHAR(20) VARCHAR(30) ALL_NON_LOSSY +VARCHAR(20) VARCHAR(10) ALL_NON_LOSSY +VARCHAR(20) CHAR(30) ALL_NON_LOSSY +VARCHAR(20) CHAR(10) ALL_NON_LOSSY +VARCHAR(20) TINYTEXT ALL_NON_LOSSY +VARCHAR(20) TEXT ALL_NON_LOSSY +VARCHAR(20) MEDIUMTEXT ALL_NON_LOSSY +VARCHAR(20) LONGTEXT ALL_NON_LOSSY +VARCHAR(500) VARCHAR(500) ALL_NON_LOSSY +VARCHAR(500) VARCHAR(510) ALL_NON_LOSSY +VARCHAR(500) VARCHAR(255) ALL_NON_LOSSY +VARCHAR(500) TINYTEXT ALL_NON_LOSSY +VARCHAR(500) TEXT ALL_NON_LOSSY +VARCHAR(500) MEDIUMTEXT ALL_NON_LOSSY +VARCHAR(500) LONGTEXT ALL_NON_LOSSY +TINYTEXT VARCHAR(500) ALL_NON_LOSSY +TEXT VARCHAR(500) ALL_NON_LOSSY +MEDIUMTEXT VARCHAR(500) ALL_NON_LOSSY +LONGTEXT VARCHAR(500) ALL_NON_LOSSY +TINYTEXT CHAR(255) ALL_NON_LOSSY +TINYTEXT CHAR(250) ALL_NON_LOSSY +TEXT CHAR(255) ALL_NON_LOSSY +MEDIUMTEXT CHAR(255) ALL_NON_LOSSY +LONGTEXT CHAR(255) ALL_NON_LOSSY +TINYTEXT TINYTEXT ALL_NON_LOSSY +TINYTEXT TEXT ALL_NON_LOSSY +TEXT TINYTEXT ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(10,5) ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(10,6) ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(11,5) ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(11,6) ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(10,4) ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(9,5) ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(9,4) ALL_NON_LOSSY +FLOAT DECIMAL(10,5) ALL_NON_LOSSY +DOUBLE DECIMAL(10,5) ALL_NON_LOSSY +DECIMAL(10,5) FLOAT ALL_NON_LOSSY +DECIMAL(10,5) DOUBLE ALL_NON_LOSSY +FLOAT FLOAT ALL_NON_LOSSY +DOUBLE DOUBLE ALL_NON_LOSSY +FLOAT DOUBLE ALL_NON_LOSSY +DOUBLE FLOAT ALL_NON_LOSSY +BIT(5) BIT(5) ALL_NON_LOSSY +BIT(5) BIT(6) ALL_NON_LOSSY +BIT(6) BIT(5) ALL_NON_LOSSY +BIT(5) BIT(12) ALL_NON_LOSSY +BIT(12) BIT(5) ALL_NON_LOSSY +BIT(1) BIT(1) ALL_LOSSY +DATE DATE ALL_LOSSY +ENUM('master',' ENUM('master',' ALL_LOSSY +CHAR(10) ENUM('master',' ALL_LOSSY +CHAR(10) SET('master','s ALL_LOSSY +ENUM('master',' CHAR(10) ALL_LOSSY +SET('master','s CHAR(10) ALL_LOSSY +SET('master','s SET('master','s ALL_LOSSY +SET('master','s SET('master','s ALL_LOSSY +TINYINT TINYINT ALL_LOSSY +TINYINT SMALLINT ALL_LOSSY +TINYINT MEDIUMINT ALL_LOSSY +TINYINT INT ALL_LOSSY +TINYINT BIGINT ALL_LOSSY +SMALLINT TINYINT ALL_LOSSY +SMALLINT TINYINT ALL_LOSSY +SMALLINT TINYINT UNSIGNE ALL_LOSSY +SMALLINT SMALLINT ALL_LOSSY +SMALLINT MEDIUMINT ALL_LOSSY +SMALLINT INT ALL_LOSSY +SMALLINT BIGINT ALL_LOSSY +MEDIUMINT TINYINT ALL_LOSSY +MEDIUMINT TINYINT ALL_LOSSY +MEDIUMINT TINYINT UNSIGNE ALL_LOSSY +MEDIUMINT SMALLINT ALL_LOSSY +MEDIUMINT MEDIUMINT ALL_LOSSY +MEDIUMINT INT ALL_LOSSY +MEDIUMINT BIGINT ALL_LOSSY +INT TINYINT ALL_LOSSY +INT TINYINT ALL_LOSSY +INT TINYINT UNSIGNE ALL_LOSSY +INT SMALLINT ALL_LOSSY +INT MEDIUMINT ALL_LOSSY +INT INT ALL_LOSSY +INT BIGINT ALL_LOSSY +BIGINT TINYINT ALL_LOSSY +BIGINT SMALLINT ALL_LOSSY +BIGINT MEDIUMINT ALL_LOSSY +BIGINT INT ALL_LOSSY +BIGINT BIGINT ALL_LOSSY +CHAR(20) CHAR(20) ALL_LOSSY +CHAR(20) CHAR(30) ALL_LOSSY +CHAR(20) CHAR(10) ALL_LOSSY +CHAR(20) VARCHAR(20) ALL_LOSSY +CHAR(20) VARCHAR(30) ALL_LOSSY +CHAR(20) VARCHAR(10) ALL_LOSSY +CHAR(20) TINYTEXT ALL_LOSSY +CHAR(20) TEXT ALL_LOSSY +CHAR(20) MEDIUMTEXT ALL_LOSSY +CHAR(20) LONGTEXT ALL_LOSSY +VARCHAR(20) VARCHAR(20) ALL_LOSSY +VARCHAR(20) VARCHAR(30) ALL_LOSSY +VARCHAR(20) VARCHAR(10) ALL_LOSSY +VARCHAR(20) CHAR(30) ALL_LOSSY +VARCHAR(20) CHAR(10) ALL_LOSSY +VARCHAR(20) TINYTEXT ALL_LOSSY +VARCHAR(20) TEXT ALL_LOSSY +VARCHAR(20) MEDIUMTEXT ALL_LOSSY +VARCHAR(20) LONGTEXT ALL_LOSSY +VARCHAR(500) VARCHAR(500) ALL_LOSSY +VARCHAR(500) VARCHAR(510) ALL_LOSSY +VARCHAR(500) VARCHAR(255) ALL_LOSSY +VARCHAR(500) TINYTEXT ALL_LOSSY +VARCHAR(500) TEXT ALL_LOSSY +VARCHAR(500) MEDIUMTEXT ALL_LOSSY +VARCHAR(500) LONGTEXT ALL_LOSSY +TINYTEXT VARCHAR(500) ALL_LOSSY +TEXT VARCHAR(500) ALL_LOSSY +MEDIUMTEXT VARCHAR(500) ALL_LOSSY +LONGTEXT VARCHAR(500) ALL_LOSSY +TINYTEXT CHAR(255) ALL_LOSSY +TINYTEXT CHAR(250) ALL_LOSSY +TEXT CHAR(255) ALL_LOSSY +MEDIUMTEXT CHAR(255) ALL_LOSSY +LONGTEXT CHAR(255) ALL_LOSSY +TINYTEXT TINYTEXT ALL_LOSSY +TINYTEXT TEXT ALL_LOSSY +TEXT TINYTEXT ALL_LOSSY +DECIMAL(10,5) DECIMAL(10,5) ALL_LOSSY +DECIMAL(10,5) DECIMAL(10,6) ALL_LOSSY +DECIMAL(10,5) DECIMAL(11,5) ALL_LOSSY +DECIMAL(10,5) DECIMAL(11,6) ALL_LOSSY +DECIMAL(10,5) DECIMAL(10,4) ALL_LOSSY +DECIMAL(10,5) DECIMAL(9,5) ALL_LOSSY +DECIMAL(10,5) DECIMAL(9,4) ALL_LOSSY +FLOAT DECIMAL(10,5) ALL_LOSSY +DOUBLE DECIMAL(10,5) ALL_LOSSY +DECIMAL(10,5) FLOAT ALL_LOSSY +DECIMAL(10,5) DOUBLE ALL_LOSSY +FLOAT FLOAT ALL_LOSSY +DOUBLE DOUBLE ALL_LOSSY +FLOAT DOUBLE ALL_LOSSY +DOUBLE FLOAT ALL_LOSSY +BIT(5) BIT(5) ALL_LOSSY +BIT(5) BIT(6) ALL_LOSSY +BIT(6) BIT(5) ALL_LOSSY +BIT(5) BIT(12) ALL_LOSSY +BIT(12) BIT(5) ALL_LOSSY +BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY +DATE DATE ALL_LOSSY,ALL_NON_LOSSY +ENUM('master',' ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY +CHAR(10) ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY +CHAR(10) SET('master','s ALL_LOSSY,ALL_NON_LOSSY +ENUM('master',' CHAR(10) ALL_LOSSY,ALL_NON_LOSSY +SET('master','s CHAR(10) ALL_LOSSY,ALL_NON_LOSSY +SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY +SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY +TINYINT TINYINT ALL_LOSSY,ALL_NON_LOSSY +TINYINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY +TINYINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY +TINYINT INT ALL_LOSSY,ALL_NON_LOSSY +TINYINT BIGINT ALL_LOSSY,ALL_NON_LOSSY +SMALLINT TINYINT ALL_LOSSY,ALL_NON_LOSSY +SMALLINT TINYINT ALL_LOSSY,ALL_NON_LOSSY +SMALLINT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY +SMALLINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY +SMALLINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY +SMALLINT INT ALL_LOSSY,ALL_NON_LOSSY +SMALLINT BIGINT ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT TINYINT ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT TINYINT ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT INT ALL_LOSSY,ALL_NON_LOSSY +MEDIUMINT BIGINT ALL_LOSSY,ALL_NON_LOSSY +INT TINYINT ALL_LOSSY,ALL_NON_LOSSY +INT TINYINT ALL_LOSSY,ALL_NON_LOSSY +INT TINYINT UNSIGNE ALL_LOSSY,ALL_NON_LOSSY +INT SMALLINT ALL_LOSSY,ALL_NON_LOSSY +INT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY +INT INT ALL_LOSSY,ALL_NON_LOSSY +INT BIGINT ALL_LOSSY,ALL_NON_LOSSY +BIGINT TINYINT ALL_LOSSY,ALL_NON_LOSSY +BIGINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY +BIGINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY +BIGINT INT ALL_LOSSY,ALL_NON_LOSSY +BIGINT BIGINT ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) CHAR(20) ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) CHAR(30) ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) CHAR(10) ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) VARCHAR(20) ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) VARCHAR(30) ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) VARCHAR(10) ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) TEXT ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY +CHAR(20) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) VARCHAR(20) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) VARCHAR(30) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) VARCHAR(10) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) CHAR(30) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) CHAR(10) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) TEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(20) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) VARCHAR(510) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) VARCHAR(255) ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) TINYTEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) TEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) MEDIUMTEXT ALL_LOSSY,ALL_NON_LOSSY +VARCHAR(500) LONGTEXT ALL_LOSSY,ALL_NON_LOSSY +TINYTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY +TEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY +MEDIUMTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY +LONGTEXT VARCHAR(500) ALL_LOSSY,ALL_NON_LOSSY +TINYTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY +TINYTEXT CHAR(250) ALL_LOSSY,ALL_NON_LOSSY +TEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY +MEDIUMTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY +LONGTEXT CHAR(255) ALL_LOSSY,ALL_NON_LOSSY +TINYTEXT TINYTEXT ALL_LOSSY,ALL_NON_LOSSY +TINYTEXT TEXT ALL_LOSSY,ALL_NON_LOSSY +TEXT TINYTEXT ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(10,6) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(11,5) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(11,6) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(10,4) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(9,5) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DECIMAL(9,4) ALL_LOSSY,ALL_NON_LOSSY +FLOAT DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY +DOUBLE DECIMAL(10,5) ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) FLOAT ALL_LOSSY,ALL_NON_LOSSY +DECIMAL(10,5) DOUBLE ALL_LOSSY,ALL_NON_LOSSY +FLOAT FLOAT ALL_LOSSY,ALL_NON_LOSSY +DOUBLE DOUBLE ALL_LOSSY,ALL_NON_LOSSY +FLOAT DOUBLE ALL_LOSSY,ALL_NON_LOSSY +DOUBLE FLOAT ALL_LOSSY,ALL_NON_LOSSY +BIT(5) BIT(5) ALL_LOSSY,ALL_NON_LOSSY +BIT(5) BIT(6) ALL_LOSSY,ALL_NON_LOSSY +BIT(6) BIT(5) ALL_LOSSY,ALL_NON_LOSSY +BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY +BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY +DROP TABLE type_conversions; +DROP TABLE t1; +set global slave_type_conversions = @saved_slave_type_conversions; diff --git a/mysql-test/suite/rpl/t/rpl_bug31076.test b/mysql-test/suite/rpl/t/rpl_bug31076.test index 9176bafe022..1f488aae64e 100644 --- a/mysql-test/suite/rpl/t/rpl_bug31076.test +++ b/mysql-test/suite/rpl/t/rpl_bug31076.test @@ -1,5 +1,8 @@ source include/master-slave.inc; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; + CREATE DATABASE track; USE track; @@ -130,7 +133,10 @@ VALUES ('3m3l4rhs6do0sf5p1i9lr94g928a272v', '', '', INET_ATON('71.118.124.98'), SELECT * FROM visits; SELECT * FROM visits_events; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; + # Cleanup DROP DATABASE track; sync_slave_with_master; + --echo End of 5.1 tests diff --git a/mysql-test/suite/rpl/t/rpl_colSize.test b/mysql-test/suite/rpl/t/rpl_colSize.test index c20f2c3fd35..e14baaa64d5 100644 --- a/mysql-test/suite/rpl/t/rpl_colSize.test +++ b/mysql-test/suite/rpl/t/rpl_colSize.test @@ -18,6 +18,9 @@ sync_slave_with_master; STOP SLAVE; RESET SLAVE; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; + eval CREATE TABLE t1 ( a float (47), b double (143,9), @@ -217,4 +220,6 @@ connection master; DROP TABLE t1; sync_slave_with_master; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; + # END 5.1 Test Case diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test index 3786a697e3f..41cf1cc622a 100644 --- a/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test +++ b/mysql-test/suite/rpl/t/rpl_row_basic_3innodb.test @@ -2,6 +2,8 @@ -- source include/have_binlog_format_row.inc -- source include/master-slave.inc +connection slave; +let $bit_field_special = ALL_LOSSY; let $type= 'INNODB' ; let $extra_index= ; -- source extra/rpl_tests/rpl_row_basic.test diff --git a/mysql-test/suite/rpl/t/rpl_typeconv.test b/mysql-test/suite/rpl/t/rpl_typeconv.test new file mode 100644 index 00000000000..2a6a3f3b33d --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_typeconv.test @@ -0,0 +1,69 @@ +--source include/have_binlog_format_row.inc +--source include/master-slave.inc + +connection slave; +set @saved_slave_type_conversions = @@global.slave_type_conversions; +CREATE TABLE type_conversions ( + TestNo INT AUTO_INCREMENT PRIMARY KEY, + Source TEXT, + Target TEXT, + Flags TEXT, + On_Master TEXT, + On_Slave TEXT, + Expected TEXT, + Compare INT, + Error TEXT); + +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT'; +SELECT @@global.slave_type_conversions; + +# Checking strict interpretation of type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +source extra/rpl_tests/type_conversions.test; + +# Checking lossy integer type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +source extra/rpl_tests/type_conversions.test; + +# Checking non-lossy integer type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +source extra/rpl_tests/type_conversions.test; + +# Checking all type conversions +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +source extra/rpl_tests/type_conversions.test; + +connection slave; +--echo **** Result of conversions **** +disable_query_log; +SELECT RPAD(Source, 15, ' ') AS Source_Type, + RPAD(Target, 15, ' ') AS Target_Type, + RPAD(Flags, 25, ' ') AS All_Type_Conversion_Flags, + IF(Compare IS NULL AND Error IS NOT NULL, '', + IF(Compare, '', + CONCAT("'", On_Slave, "' != '", Expected, "'"))) + AS Value_On_Slave + FROM type_conversions; +enable_query_log; +DROP TABLE type_conversions; + +connection master; +DROP TABLE t1; +sync_slave_with_master; + +set global slave_type_conversions = @saved_slave_type_conversions; + diff --git a/sql/field.cc b/sql/field.cc index 0df9b0fc2e4..b6a795d34aa 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -59,6 +59,8 @@ const char field_separator=','; #define ASSERT_COLUMN_MARKED_FOR_READ DBUG_ASSERT(!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))) #define ASSERT_COLUMN_MARKED_FOR_WRITE DBUG_ASSERT(!table || (!table->write_set || bitmap_is_set(table->write_set, field_index))) +#define FLAGSTR(S,F) ((S) & (F) ? #F " " : "") + /* Rules for merging different types of fields in UNION @@ -996,6 +998,21 @@ test_if_important_data(CHARSET_INFO *cs, const char *str, const char *strend) } +/** + Template function to compare two objects. + */ +namespace { + template + int compare(A_type a, B_type b) + { + if (a < b) + return -1; + if (b < a) + return 1; + return 0; + } +} + /** Detect Item_result by given field type of UNION merge result. @@ -1367,22 +1384,46 @@ bool Field::send_binary(Protocol *protocol) /** Check to see if field size is compatible with destination. - This method is used in row-based replication to verify that the slave's - field size is less than or equal to the master's field size. The - encoded field metadata (from the master or source) is decoded and compared - to the size of this field (the slave or destination). + This method is used in row-based replication to verify that the + slave's field size is less than or equal to the master's field + size. The encoded field metadata (from the master or source) is + decoded and compared to the size of this field (the slave or + destination). + + @note + + The comparison is made so that if the source data (from the master) + is less than the target data (on the slave), -1 is returned in @c + *order_var. This implies that a conversion is + necessary, but that it is lossy and can result in truncation of the + value. + + If the source data is strictly greater than the target data, 1 is + returned in *order_var. This implies that the source + type can is contained in the target type and that a conversion is + necessary but is non-lossy. + + If no conversion is required to fit the source type in the target + type, 0 is returned in *order_var. @param field_metadata Encoded size in field metadata + @param order_var Pointer to variable where the order + between the source field and this field + will be returned. - @retval 0 if this field's size is < the source field's size - @retval 1 if this field's size is >= the source field's size + @return @c true if this field's size is compatible with the + master's field size, @c false otherwise. */ -int Field::compatible_field_size(uint field_metadata, - const Relay_log_info *rli_arg __attribute__((unused))) +bool Field::compatible_field_size(uint field_metadata, + Relay_log_info *rli_arg __attribute__((unused)), + int *order_var) { uint const source_size= pack_length_from_metadata(field_metadata); uint const destination_size= row_pack_length(); - return (source_size <= destination_size); + DBUG_PRINT("debug", ("real_type: %d, source_size: %u, destination_size: %u", + real_type(), source_size, destination_size)); + *order_var = compare(source_size, destination_size); + return true; } @@ -2907,33 +2948,15 @@ uint Field_new_decimal::pack_length_from_metadata(uint field_metadata) } -/** - Check to see if field size is compatible with destination. - - This method is used in row-based replication to verify that the slave's - field size is less than or equal to the master's field size. The - encoded field metadata (from the master or source) is decoded and compared - to the size of this field (the slave or destination). - - @param field_metadata Encoded size in field metadata - - @retval 0 if this field's size is < the source field's size - @retval 1 if this field's size is >= the source field's size -*/ -int Field_new_decimal::compatible_field_size(uint field_metadata, - const Relay_log_info * __attribute__((unused))) +bool Field_new_decimal::compatible_field_size(uint field_metadata, + Relay_log_info * __attribute__((unused)), + int *order_var) { - int compatible= 0; uint const source_precision= (field_metadata >> 8U) & 0x00ff; uint const source_decimal= field_metadata & 0x00ff; - uint const source_size= my_decimal_get_binary_size(source_precision, - source_decimal); - uint const destination_size= row_pack_length(); - compatible= (source_size <= destination_size); - if (compatible) - compatible= (source_precision <= precision) && - (source_decimal <= decimals()); - return (compatible); + int order= compare(source_precision, precision); + *order_var= order != 0 ? order : compare(source_decimal, dec); + return true; } @@ -6707,8 +6730,10 @@ check_field_for_37426(const void *param_arg) } #endif -int Field_string::compatible_field_size(uint field_metadata, - const Relay_log_info *rli_arg) +bool +Field_string::compatible_field_size(uint field_metadata, + Relay_log_info *rli_arg, + int *order_var) { #ifdef HAVE_REPLICATION const Check_field_param check_param = { this }; @@ -6716,7 +6741,7 @@ int Field_string::compatible_field_size(uint field_metadata, check_field_for_37426, &check_param)) return FALSE; // Not compatible field sizes #endif - return Field::compatible_field_size(field_metadata, rli_arg); + return Field::compatible_field_size(field_metadata, rli_arg, order_var); } @@ -6778,6 +6803,8 @@ uchar *Field_string::pack(uchar *to, const uchar *from, { uint length= min(field_length,max_length); uint local_char_length= max_length/field_charset->mbmaxlen; + DBUG_PRINT("debug", ("Packing field '%s' - length: %u ", field_name, length)); + if (length > local_char_length) local_char_length= my_charpos(field_charset, from, from+length, local_char_length); @@ -7625,6 +7652,7 @@ Field_blob::Field_blob(uchar *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg, cs), packlength(blob_pack_length) { + DBUG_ASSERT(blob_pack_length <= 4); // Only pack lengths 1-4 supported currently flags|= BLOB_FLAG; share->blob_fields++; /* TODO: why do not fill table->s->blob_field array here? */ @@ -8035,8 +8063,10 @@ int Field_blob::key_cmp(const uchar *a,const uchar *b) */ int Field_blob::do_save_field_metadata(uchar *metadata_ptr) { + DBUG_ENTER("Field_blob::do_save_field_metadata"); *metadata_ptr= pack_length_no_ptr(); - return 1; + DBUG_PRINT("debug", ("metadata: %u (pack_length_no_ptr)", *metadata_ptr)); + DBUG_RETURN(1); } @@ -8977,6 +9007,9 @@ Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, bit_ptr(bit_ptr_arg), bit_ofs(bit_ofs_arg), bit_len(len_arg & 7), bytes_in_rec(len_arg / 8) { + DBUG_ENTER("Field_bit::Field_bit"); + DBUG_PRINT("enter", ("ptr_arg: %p, null_ptr_arg: %p, len_arg: %u, bit_len: %u, bytes_in_rec: %u", + ptr_arg, null_ptr_arg, len_arg, bit_len, bytes_in_rec)); flags|= UNSIGNED_FLAG; /* Ensure that Field::eq() can distinguish between two different bit fields. @@ -8984,6 +9017,7 @@ Field_bit::Field_bit(uchar *ptr_arg, uint32 len_arg, uchar *null_ptr_arg, */ if (!null_ptr_arg) null_bit= bit_ofs_arg; + DBUG_VOID_RETURN; } @@ -9268,9 +9302,12 @@ uint Field_bit::get_key_image(uchar *buff, uint length, imagetype type_arg) */ int Field_bit::do_save_field_metadata(uchar *metadata_ptr) { + DBUG_ENTER("Field_bit::do_save_field_metadata"); + DBUG_PRINT("debug", ("bit_len: %d, bytes_in_rec: %d", + bit_len, bytes_in_rec)); *metadata_ptr= bit_len; *(metadata_ptr + 1)= bytes_in_rec; - return 2; + DBUG_RETURN(2); } @@ -9295,34 +9332,20 @@ uint Field_bit::pack_length_from_metadata(uint field_metadata) } -/** - Check to see if field size is compatible with destination. - - This method is used in row-based replication to verify that the slave's - field size is less than or equal to the master's field size. The - encoded field metadata (from the master or source) is decoded and compared - to the size of this field (the slave or destination). - - @param field_metadata Encoded size in field metadata - - @retval 0 if this field's size is < the source field's size - @retval 1 if this field's size is >= the source field's size -*/ -int Field_bit::compatible_field_size(uint field_metadata, - const Relay_log_info * __attribute__((unused))) +bool +Field_bit::compatible_field_size(uint field_metadata, + Relay_log_info * __attribute__((unused)), + int *order_var) { - int compatible= 0; - uint const source_size= pack_length_from_metadata(field_metadata); - uint const destination_size= row_pack_length(); - uint const from_bit_len= field_metadata & 0x00ff; - uint const from_len= (field_metadata >> 8U) & 0x00ff; - if ((bit_len == 0) || (from_bit_len == 0)) - compatible= (source_size <= destination_size); - else if (from_bit_len > bit_len) - compatible= (from_len < bytes_in_rec); - else - compatible= ((from_bit_len <= bit_len) && (from_len <= bytes_in_rec)); - return (compatible); + DBUG_ENTER("Field_bit::compatible_field_size"); + DBUG_ASSERT((field_metadata >> 16) == 0); + uint const from_bit_len= + 8 * (field_metadata >> 8) + (field_metadata & 0xff); + uint const to_bit_len= max_display_length(); + DBUG_PRINT("debug", ("from_bit_len: %u, to_bit_len: %u", + from_bit_len, to_bit_len)); + *order_var= compare(from_bit_len, to_bit_len); + DBUG_RETURN(TRUE); } @@ -9388,8 +9411,15 @@ const uchar * Field_bit::unpack(uchar *to, const uchar *from, uint param_data, bool low_byte_first __attribute__((unused))) { + DBUG_ENTER("Field_bit::unpack"); + DBUG_PRINT("enter", ("to: %p, from: %p, param_data: 0x%x", + to, from, param_data)); + DBUG_PRINT("debug", ("bit_ptr: %p, bit_len: %u, bit_ofs: %u", + bit_ptr, bit_len, bit_ofs)); uint const from_len= (param_data >> 8U) & 0x00ff; uint const from_bit_len= param_data & 0x00ff; + DBUG_PRINT("debug", ("from_len: %u, from_bit_len: %u", + from_len, from_bit_len)); /* If the parameter data is zero (i.e., undefined), or if the master and slave have the same sizes, then use the old unpack() method. @@ -9410,7 +9440,7 @@ Field_bit::unpack(uchar *to, const uchar *from, uint param_data, from++; } memcpy(to, from, bytes_in_rec); - return from + bytes_in_rec; + DBUG_RETURN(from + bytes_in_rec); } /* @@ -9436,7 +9466,7 @@ Field_bit::unpack(uchar *to, const uchar *from, uint param_data, bitmap_set_bit(table->write_set,field_index); store(value, new_len, system_charset_info); my_afree(value); - return from + len; + DBUG_RETURN(from + len); } @@ -9564,8 +9594,11 @@ void Create_field::create_length_to_internal_length(void) */ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, uint32 length_arg, uint32 decimals_arg, - bool maybe_null, bool is_unsigned) + bool maybe_null, bool is_unsigned, + uint pack_length) { + DBUG_ENTER("Create_field::init_for_tmp_table"); + field_name= ""; sql_type= sql_type_arg; char_length= length= length_arg;; @@ -9573,10 +9606,92 @@ void Create_field::init_for_tmp_table(enum_field_types sql_type_arg, interval= 0; charset= &my_charset_bin; geom_type= Field::GEOM_GEOMETRY; - pack_flag= (FIELDFLAG_NUMBER | - ((decimals_arg & FIELDFLAG_MAX_DEC) << FIELDFLAG_DEC_SHIFT) | - (maybe_null ? FIELDFLAG_MAYBE_NULL : 0) | - (is_unsigned ? 0 : FIELDFLAG_DECIMAL)); + + DBUG_PRINT("enter", ("sql_type: %d, length: %u, pack_length: %u", + sql_type_arg, length_arg, pack_length)); + + /* + These pack flags are crafted to get it correctly through the + branches of make_field(). + */ + switch (sql_type_arg) + { + case MYSQL_TYPE_VARCHAR: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_SET: + pack_flag= 0; + break; + + case MYSQL_TYPE_GEOMETRY: + pack_flag= FIELDFLAG_GEOM; + break; + + case MYSQL_TYPE_ENUM: + pack_flag= FIELDFLAG_INTERVAL; + break; + + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + pack_flag= FIELDFLAG_DECIMAL | FIELDFLAG_NUMBER | + (decimals_arg & FIELDFLAG_MAX_DEC) << FIELDFLAG_DEC_SHIFT; + break; + + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + pack_flag= FIELDFLAG_BLOB; + break; + + case MYSQL_TYPE_BIT: + pack_flag= FIELDFLAG_NUMBER | FIELDFLAG_TREAT_BIT_AS_CHAR; + break; + + default: + pack_flag= FIELDFLAG_NUMBER; + break; + } + + /* + Set the pack flag correctly for the blob-like types. This sets the + packtype to something that make_field can use. If the pack type is + not set correctly, the packlength will be reeeeally wierd (like + 129 or so). + */ + switch (sql_type_arg) + { + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_GEOMETRY: + // If you are going to use the above types, you have to pass a + // pack_length as parameter. Assert that is really done. + DBUG_ASSERT(pack_length != ~0U); + pack_flag|= pack_length_to_packflag(pack_length); + break; + default: + /* Nothing */ + break; + } + + pack_flag|= + (maybe_null ? FIELDFLAG_MAYBE_NULL : 0) | + (is_unsigned ? 0 : FIELDFLAG_DECIMAL); + + DBUG_PRINT("debug", ("pack_flag: %s%s%s%s%s, pack_type: %d", + FLAGSTR(pack_flag, FIELDFLAG_BINARY), + FLAGSTR(pack_flag, FIELDFLAG_NUMBER), + FLAGSTR(pack_flag, FIELDFLAG_INTERVAL), + FLAGSTR(pack_flag, FIELDFLAG_GEOM), + FLAGSTR(pack_flag, FIELDFLAG_BLOB), + f_packtype(pack_flag))); + DBUG_VOID_RETURN; } @@ -10073,6 +10188,14 @@ Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32 field_length, default: break; } + DBUG_PRINT("debug", ("field_type: %d, field_length: %u, interval: %p, pack_flag: %s%s%s%s%s", + field_type, field_length, interval, + FLAGSTR(pack_flag, FIELDFLAG_BINARY), + FLAGSTR(pack_flag, FIELDFLAG_INTERVAL), + FLAGSTR(pack_flag, FIELDFLAG_NUMBER), + FLAGSTR(pack_flag, FIELDFLAG_PACK), + FLAGSTR(pack_flag, FIELDFLAG_BLOB))); + if (f_is_alpha(pack_flag)) { if (!f_is_packed(pack_flag)) diff --git a/sql/field.h b/sql/field.h index 7a9b69eff40..cfa3e57d2a0 100644 --- a/sql/field.h +++ b/sql/field.h @@ -164,22 +164,13 @@ public: table, which is located on disk). */ virtual uint32 pack_length_in_rec() const { return pack_length(); } - virtual int compatible_field_size(uint field_metadata, - const Relay_log_info *); + virtual bool compatible_field_size(uint metadata, Relay_log_info *rli, + int *order); virtual uint pack_length_from_metadata(uint field_metadata) - { return field_metadata; } - /* - This method is used to return the size of the data in a row-based - replication row record. The default implementation of returning 0 is - designed to allow fields that do not use metadata to return TRUE (1) - from compatible_field_size() which uses this function in the comparison. - The default value for field metadata for fields that do not have - metadata is 0. Thus, 0 == 0 means the fields are compatible in size. - - Note: While most classes that override this method return pack_length(), - the classes Field_string, Field_varstring, and Field_blob return - field_length + 1, field_length, and pack_length_no_ptr() respectfully. - */ + { + DBUG_ENTER("Field::pack_length_from_metadata"); + DBUG_RETURN(field_metadata); + } virtual uint row_pack_length() { return 0; } virtual int save_field_metadata(uchar *first_byte) { return do_save_field_metadata(first_byte); } @@ -636,6 +627,13 @@ public: int store_decimal(const my_decimal *); my_decimal *val_decimal(my_decimal *); uint is_equal(Create_field *new_field); + uint row_pack_length() { return pack_length(); } + uint32 pack_length_from_metadata(uint field_metadata) { + uint32 length= pack_length(); + DBUG_PRINT("result", ("pack_length_from_metadata(%d): %u", + field_metadata, length)); + return length; + } int check_int(CHARSET_INFO *cs, const char *str, int length, const char *int_end, int error); bool get_int(CHARSET_INFO *cs, const char *from, uint len, @@ -806,8 +804,8 @@ public: uint32 pack_length() const { return (uint32) bin_size; } uint pack_length_from_metadata(uint field_metadata); uint row_pack_length() { return pack_length(); } - int compatible_field_size(uint field_metadata, - const Relay_log_info *rli); + bool compatible_field_size(uint field_metadata, Relay_log_info *rli, + int *order_var); uint is_equal(Create_field *new_field); virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data, bool low_byte_first); @@ -1501,9 +1499,9 @@ public: return row_pack_length(); return (((field_metadata >> 4) & 0x300) ^ 0x300) + (field_metadata & 0x00ff); } - int compatible_field_size(uint field_metadata, - const Relay_log_info *rli); - uint row_pack_length() { return (field_length + 1); } + bool compatible_field_size(uint field_metadata, Relay_log_info *rli, + int *order_var); + uint row_pack_length() { return field_length; } int pack_cmp(const uchar *a,const uchar *b,uint key_length, my_bool insert_or_update); int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update); @@ -1965,8 +1963,8 @@ public: uint pack_length_from_metadata(uint field_metadata); uint row_pack_length() { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); } - int compatible_field_size(uint field_metadata, - const Relay_log_info *rli); + bool compatible_field_size(uint metadata, Relay_log_info *rli, + int *order_var); void sql_type(String &str) const; virtual uchar *pack(uchar *to, const uchar *from, uint max_length, bool low_byte_first); @@ -2069,7 +2067,8 @@ public: /* Init for a tmp table field. To be extended if need be. */ void init_for_tmp_table(enum_field_types sql_type_arg, uint32 max_length, uint32 decimals, - bool maybe_null, bool is_unsigned); + bool maybe_null, bool is_unsigned, + uint pack_length = ~0U); bool init(THD *thd, char *field_name, enum_field_types type, char *length, char *decimals, uint type_modifier, Item *default_value, diff --git a/sql/log_event.cc b/sql/log_event.cc index 0e1500dac39..00919b65fa0 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -29,7 +29,6 @@ #include "rpl_rli.h" #include "rpl_mi.h" #include "rpl_filter.h" -#include "rpl_utility.h" #include "rpl_record.h" #include @@ -37,6 +36,7 @@ #include #include +#include "rpl_utility.h" #define log_cs &my_charset_latin1 @@ -7309,11 +7309,18 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) */ { + DBUG_PRINT("debug", ("Checking compability of tables to lock - tables_to_lock: %p", + rli->tables_to_lock)); RPL_TABLE_LIST *ptr= rli->tables_to_lock; for ( ; ptr ; ptr= static_cast(ptr->next_global)) { - if (ptr->m_tabledef.compatible_with(rli, ptr->table)) + TABLE *conv_table; + if (!ptr->m_tabledef.compatible_with(thd, const_cast(rli), + ptr->table, &conv_table)) { + DBUG_PRINT("debug", ("Table: %s.%s is not compatible with master", + ptr->table->s->db.str, + ptr->table->s->table_name.str)); /* We should not honour --slave-skip-errors at this point as we are having severe errors which should not be skiped. @@ -7324,12 +7331,17 @@ int Rows_log_event::do_apply_event(Relay_log_info const *rli) const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(ERR_BAD_TABLE_DEF); } + DBUG_PRINT("debug", ("Table: %s.%s is compatible with master" + " - conv_table: %p", + ptr->table->s->db.str, + ptr->table->s->table_name.str, conv_table)); + ptr->m_conv_table= conv_table; } } /* - ... and then we add all the tables to the table map and remove - them from tables to lock. + ... and then we add all the tables to the table map and but keep + them in the tables to lock list. We also invalidate the query cache for all the tables, since they will now be changed. @@ -7825,7 +7837,10 @@ int Table_map_log_event::save_field_metadata() DBUG_ENTER("Table_map_log_event::save_field_metadata"); int index= 0; for (unsigned int i= 0 ; i < m_table->s->fields ; i++) + { + DBUG_PRINT("debug", ("field_type: %d", m_coltype[i])); index+= m_table->s->field[i]->save_field_metadata(&m_field_metadata[index]); + } DBUG_RETURN(index); } #endif /* !defined(MYSQL_CLIENT) */ diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc index 3389821a718..10d1dcaa27a 100644 --- a/sql/log_event_old.cc +++ b/sql/log_event_old.cc @@ -107,14 +107,24 @@ Old_rows_log_event::do_apply_event(Old_rows_log_event *ev, const Relay_log_info RPL_TABLE_LIST *ptr= rli->tables_to_lock; for ( ; ptr ; ptr= static_cast(ptr->next_global)) { - if (ptr->m_tabledef.compatible_with(rli, ptr->table)) + TABLE *conv_table; + if (!ptr->m_tabledef.compatible_with(thd, const_cast(rli), + ptr->table, &conv_table)) { + DBUG_PRINT("debug", ("Table: %s.%s is not compatible with master", + ptr->table->s->db.str, + ptr->table->s->table_name.str)); mysql_unlock_tables(thd, thd->lock); thd->lock= 0; thd->is_slave_error= 1; const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(Old_rows_log_event::ERR_BAD_TABLE_DEF); } + DBUG_PRINT("debug", ("Table: %s.%s is compatible with master" + " - conv_table: %p", + ptr->table->s->db.str, + ptr->table->s->table_name.str, conv_table)); + ptr->m_conv_table= conv_table; } } @@ -1578,7 +1588,9 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) RPL_TABLE_LIST *ptr= rli->tables_to_lock; for ( ; ptr ; ptr= static_cast(ptr->next_global)) { - if (ptr->m_tabledef.compatible_with(rli, ptr->table)) + TABLE *conv_table; + if (ptr->m_tabledef.compatible_with(thd, const_cast(rli), + ptr->table, &conv_table)) { mysql_unlock_tables(thd, thd->lock); thd->lock= 0; @@ -1586,12 +1598,14 @@ int Old_rows_log_event::do_apply_event(Relay_log_info const *rli) const_cast(rli)->clear_tables_to_lock(); DBUG_RETURN(ERR_BAD_TABLE_DEF); } + ptr->m_conv_table= conv_table; } } /* - ... and then we add all the tables to the table map and remove - them from tables to lock. + ... and then we add all the tables to the table map but keep + them in the tables to lock list. + We also invalidate the query cache for all the tables, since they will now be changed. diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index c04b1f5ae38..522fa679e6f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1998,6 +1998,7 @@ extern my_bool opt_sql_bin_update, opt_safe_user_create, opt_no_mix_types; extern my_bool opt_safe_show_db, opt_local_infile, opt_myisam_use_mmap; extern my_bool opt_slave_compressed_protocol, use_temp_pool; extern ulong slave_exec_mode_options; +extern ulong slave_type_conversions_options; extern my_bool opt_readonly, lower_case_file_system; extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs; extern my_bool opt_secure_auth; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 896be4a7f19..c9fd9249af3 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -525,6 +525,8 @@ ulong open_files_limit, max_binlog_size, max_relay_log_size; ulong slave_net_timeout, slave_trans_retries; ulong slave_exec_mode_options; const char *slave_exec_mode_str= "STRICT"; +ulong slave_type_conversions_options; +const char *slave_type_conversions_default= ""; ulong thread_cache_size=0, thread_pool_size= 0; ulong binlog_cache_size=0; ulonglong max_binlog_cache_size=0; @@ -5690,6 +5692,7 @@ enum options_mysqld #endif /* defined(ENABLED_DEBUG_SYNC) */ OPT_OLD_MODE, OPT_SLAVE_EXEC_MODE, + OPT_SLAVE_TYPE_CONVERSIONS, OPT_GENERAL_LOG_FILE, OPT_SLOW_QUERY_LOG_FILE, OPT_IGNORE_BUILTIN_INNODB @@ -6413,6 +6416,15 @@ replicating a LOAD DATA INFILE command.", {"slave-exec-mode", OPT_SLAVE_EXEC_MODE, "Modes for how replication events should be executed. Legal values are STRICT (default) and IDEMPOTENT. In IDEMPOTENT mode, replication will not stop for operations that are idempotent. In STRICT mode, replication will stop on any unexpected difference between the master and the slave.", (uchar**) &slave_exec_mode_str, (uchar**) &slave_exec_mode_str, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, + {"slave-type-conversions", OPT_SLAVE_TYPE_CONVERSIONS, + "Set of slave type conversions that are enabled. Legal values are:" + " ALL_LOSSY to enable lossy conversions and" + " ALL_NON_LOSSY to enable non-lossy conversions." + " If the variable is assigned the empty set, no conversions are" + " allowed and it is expected that the types match exactly.", + (uchar**) &slave_type_conversions_default, + (uchar**) &slave_type_conversions_default, + 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, #endif {"slow-query-log", OPT_SLOW_LOG, "Enable|disable slow query log", (uchar**) &opt_slow_log, @@ -7671,6 +7683,11 @@ static int mysql_init_variables(void) slave_exec_mode_options= (uint) find_bit_type_or_exit(slave_exec_mode_str, &slave_exec_mode_typelib, NULL, &error); + /* Slave type conversions */ + slave_type_conversions_options= 0; + slave_type_conversions_options= + find_bit_type_or_exit(slave_type_conversions_default, &slave_type_conversions_typelib, + NULL, &error); if (error) return 1; opt_specialflag= SPECIAL_ENGLISH; @@ -7900,6 +7917,12 @@ mysqld_get_one_option(int optid, if (error) return 1; break; + case OPT_SLAVE_TYPE_CONVERSIONS: + slave_type_conversions_options= (uint) + find_bit_type_or_exit(argument, &slave_type_conversions_typelib, "", &error); + if (error) + return 1; + break; #endif case OPT_SAFEMALLOC_MEM_LIMIT: #if !defined(DBUG_OFF) && defined(SAFEMALLOC) diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index 14a80cbb4b6..ab9b21b11a8 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -104,10 +104,10 @@ pack_row(TABLE *table, MY_BITMAP const* cols, #endif pack_ptr= field->pack(pack_ptr, field->ptr + offset, field->max_data_length(), TRUE); - DBUG_PRINT("debug", ("field: %s; pack_ptr: 0x%lx;" + DBUG_PRINT("debug", ("field: %s; real_type: %d, pack_ptr: 0x%lx;" " pack_ptr':0x%lx; bytes: %d", - field->field_name, (ulong) old_pack_ptr, - (ulong) pack_ptr, + field->field_name, field->real_type(), + (ulong) old_pack_ptr, (ulong) pack_ptr, (int) (pack_ptr - old_pack_ptr))); } @@ -201,10 +201,30 @@ unpack_row(Relay_log_info const *rli, // The "current" null bits unsigned int null_bits= *null_ptr++; uint i= 0; - table_def *tabledef= ((Relay_log_info*)rli)->get_tabledef(table); + table_def *tabledef; + TABLE *conv_table; + bool table_found= rli->get_table_data(table, &tabledef, &conv_table); + DBUG_PRINT("debug", ("Table data: table_found: %d, tabldef: %p, conv_table: %p", + table_found, tabledef, conv_table)); + DBUG_ASSERT(table_found); + if (!table_found) + return HA_ERR_GENERIC; + for (field_ptr= begin_ptr ; field_ptr < end_ptr && *field_ptr ; ++field_ptr) { - Field *const f= *field_ptr; + /* + If there is a conversion table, we pick up the field pointer to + the conversion table. If the conversion table or the field + pointer is NULL, no conversions are necessary. + */ + Field *conv_field= + conv_table ? conv_table->field[field_ptr - begin_ptr] : NULL; + Field *const f= + conv_field ? conv_field : *field_ptr; + DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%d)", + conv_field ? "" : "not ", + (*field_ptr)->field_name, field_ptr - begin_ptr)); + DBUG_ASSERT(f != NULL); /* No need to bother about columns that does not exist: they have @@ -247,6 +267,39 @@ unpack_row(Relay_log_info const *rli, (int) (pack_ptr - old_pack_ptr))); } + /* + If conv_field is set, then we are doing a conversion. In this + case, we have unpacked the master data to the conversion + table, so we need to copy the value stored in the conversion + table into the final table and do the conversion at the same time. + */ + if (conv_field) + { + Copy_field copy; +#ifndef DBUG_OFF + char source_buf[MAX_FIELD_WIDTH]; + char value_buf[MAX_FIELD_WIDTH]; + String source_type(source_buf, sizeof(source_buf), system_charset_info); + String value_string(value_buf, sizeof(value_buf), system_charset_info); + conv_field->sql_type(source_type); + conv_field->val_str(&value_string); + DBUG_PRINT("debug", ("Copying field '%s' of type '%s' with value '%s'", + (*field_ptr)->field_name, + source_type.c_ptr(), value_string.c_ptr())); +#endif + copy.set(*field_ptr, f, TRUE); + (*copy.do_copy)(©); +#ifndef DBUG_OFF + char target_buf[MAX_FIELD_WIDTH]; + String target_type(target_buf, sizeof(target_buf), system_charset_info); + (*field_ptr)->sql_type(target_type); + (*field_ptr)->val_str(&value_string); + DBUG_PRINT("debug", ("Value of field '%s' of type '%s' is now '%s'", + (*field_ptr)->field_name, + target_type.c_ptr(), value_string.c_ptr())); +#endif + } + null_mask <<= 1; } i++; diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 171778d9675..7f04a3e5cdd 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -314,13 +314,21 @@ public: uint tables_to_lock_count; /* RBR: Count of tables to lock */ table_mapping m_table_map; /* RBR: Mapping table-id to table */ - inline table_def *get_tabledef(TABLE *tbl) + bool get_table_data(TABLE *table_arg, table_def **tabledef_var, TABLE **conv_table_var) const { - table_def *td= 0; - for (TABLE_LIST *ptr= tables_to_lock; ptr && !td; ptr= ptr->next_global) - if (ptr->table == tbl) - td= &((RPL_TABLE_LIST *)ptr)->m_tabledef; - return (td); + DBUG_ASSERT(tabledef_var && conv_table_var); + for (TABLE_LIST *ptr= tables_to_lock ; ptr != NULL ; ptr= ptr->next_global) + if (ptr->table == table_arg) + { + *tabledef_var= &static_cast(ptr)->m_tabledef; + *conv_table_var= static_cast(ptr)->m_conv_table; + DBUG_PRINT("debug", ("Fetching table data for table %s.%s:" + " tabledef: %p, conv_table: %p", + table_arg->s->db.str, table_arg->s->table_name.str, + *tabledef_var, *conv_table_var)); + return true; + } + return false; } /* diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index e34f8561051..f24de23bcf3 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -14,8 +14,184 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "rpl_utility.h" + +#ifndef MYSQL_CLIENT #include "rpl_rli.h" +/** + Template function to compare two objects. + */ +namespace { + template + int compare(Type a, Type b) + { + if (a < b) + return -1; + if (b < a) + return 1; + return 0; + } +} + + +/** + Max value for an unsigned integer of 'bits' bits. + + The somewhat contorted expression is to avoid overflow. + */ +uint32 uint_max(int bits) { + return (((1UL << (bits - 1)) - 1) << 1) | 1; +} + + +/** + Compute the maximum display length of a field. + + @param sql_type Type of the field + @param metadata The metadata from the master for the field. + @return Maximum length of the field in bytes. + */ +static uint32 +max_display_length_for_field(enum_field_types sql_type, unsigned int metadata) +{ + DBUG_PRINT("debug", ("sql_type: %d, metadata: 0x%x", sql_type, metadata)); + DBUG_ASSERT(metadata >> 16 == 0); + + switch (sql_type) { + case MYSQL_TYPE_NEWDECIMAL: + return metadata >> 8; + + case MYSQL_TYPE_FLOAT: + return 12; + + case MYSQL_TYPE_DOUBLE: + return 22; + + case MYSQL_TYPE_SET: + case MYSQL_TYPE_ENUM: + return metadata & 0x00ff; + + case MYSQL_TYPE_STRING: + { + uchar type= metadata >> 8; + if (type == MYSQL_TYPE_SET || type == MYSQL_TYPE_ENUM) + return metadata & 0xff; + else + /* This is taken from Field_string::unpack. */ + return (((metadata >> 4) & 0x300) ^ 0x300) + (metadata & 0x00ff); + } + + case MYSQL_TYPE_YEAR: + case MYSQL_TYPE_TINY: + return 4; + + case MYSQL_TYPE_SHORT: + return 6; + + case MYSQL_TYPE_INT24: + return 9; + + case MYSQL_TYPE_LONG: + return 11; + +#ifdef HAVE_LONG_LONG + case MYSQL_TYPE_LONGLONG: + return 20; + +#endif + case MYSQL_TYPE_NULL: + return 0; + + case MYSQL_TYPE_NEWDATE: + return 3; + + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_TIME: + return 3; + + case MYSQL_TYPE_TIMESTAMP: + return 4; + + case MYSQL_TYPE_DATETIME: + return 8; + + case MYSQL_TYPE_BIT: + { + /* + Decode the size of the bit field from the master. + from_len is the length in bytes from the master + from_bit_len is the number of extra bits stored in the master record + */ + uint from_len= (metadata >> 8U) & 0x00ff; + uint from_bit_len= metadata & 0x00ff; + DBUG_ASSERT(from_bit_len <= 7); + return 8 * from_len + from_bit_len; + } + + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_VARCHAR: + return metadata; + + /* + The actual length for these types does not really matter since + they are used to calc_pack_length, which ignores the given + length for these types. + + Since we want this to be accurate for other uses, we return the + maximum size in bytes of these BLOBs. + */ + + case MYSQL_TYPE_TINY_BLOB: + return uint_max(1 * 8); + + case MYSQL_TYPE_MEDIUM_BLOB: + return uint_max(3 * 8); + + case MYSQL_TYPE_BLOB: + /* + For the blob type, Field::real_type() lies and say that all + blobs are of type MYSQL_TYPE_BLOB. In that case, we have to look + at the length instead to decide what the max display size is. + */ + return uint_max(metadata * 8); + + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_GEOMETRY: + return uint_max(4 * 8); + + default: + return ~(uint32) 0; + } +} + + +/* + Compare the pack lengths of a source field (on the master) and a + target field (on the slave). + + @param field Target field. + @param type Source field type. + @param metadata Source field metadata. + + @retval -1 The length of the source field is smaller than the target field. + @retval 0 The length of the source and target fields are the same. + @retval 1 The length of the source field is greater than the target field. + */ +int compare_lengths(Field *field, enum_field_types source_type, uint16 metadata) +{ + DBUG_ENTER("compare_lengths"); + size_t const source_length= + max_display_length_for_field(source_type, metadata); + size_t const target_length= field->max_display_length(); + DBUG_PRINT("debug", ("source_length: %lu, source_type: %u," + " target_length: %lu, target_type: %u", + (unsigned long) source_length, source_type, + (unsigned long) target_length, field->real_type())); + int result= compare(source_length, target_length); + DBUG_PRINT("result", ("%d", result)); + DBUG_RETURN(result); +} + /********************************************************************* * table_def member definitions * *********************************************************************/ @@ -169,58 +345,698 @@ uint32 table_def::calc_field_size(uint col, uchar *master_data) const return length; } -/* + +/** + */ +void show_sql_type(enum_field_types type, uint16 metadata, String *str) +{ + DBUG_ENTER("show_sql_type"); + DBUG_PRINT("enter", ("type: %d, metadata: 0x%x", type, metadata)); + + switch (type) + { + case MYSQL_TYPE_TINY: + str->set_ascii(STRING_WITH_LEN("tinyint")); + break; + + case MYSQL_TYPE_SHORT: + str->set_ascii(STRING_WITH_LEN("smallint")); + break; + + case MYSQL_TYPE_LONG: + str->set_ascii(STRING_WITH_LEN("int")); + break; + + case MYSQL_TYPE_FLOAT: + str->set_ascii(STRING_WITH_LEN("float")); + break; + + case MYSQL_TYPE_DOUBLE: + str->set_ascii(STRING_WITH_LEN("double")); + break; + + case MYSQL_TYPE_NULL: + str->set_ascii(STRING_WITH_LEN("null")); + break; + + case MYSQL_TYPE_TIMESTAMP: + str->set_ascii(STRING_WITH_LEN("timestamp")); + break; + + case MYSQL_TYPE_LONGLONG: + str->set_ascii(STRING_WITH_LEN("bigint")); + break; + + case MYSQL_TYPE_INT24: + str->set_ascii(STRING_WITH_LEN("mediumint")); + break; + + case MYSQL_TYPE_NEWDATE: + case MYSQL_TYPE_DATE: + str->set_ascii(STRING_WITH_LEN("date")); + break; + + case MYSQL_TYPE_TIME: + str->set_ascii(STRING_WITH_LEN("time")); + break; + + case MYSQL_TYPE_DATETIME: + str->set_ascii(STRING_WITH_LEN("datetime")); + break; + + case MYSQL_TYPE_YEAR: + str->set_ascii(STRING_WITH_LEN("year")); + break; + + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_VARCHAR: + { + CHARSET_INFO *cs= str->charset(); + uint32 length= + cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), + "varchar(%u)", metadata); + str->length(length); + } + break; + + case MYSQL_TYPE_BIT: + { + CHARSET_INFO *cs= str->charset(); + int bit_length= (metadata >> 8) + (metadata & 0xFF); + uint32 length= + cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), + "bit(%d)", bit_length); + str->length(length); + } + break; + + case MYSQL_TYPE_DECIMAL: + { + CHARSET_INFO *cs= str->charset(); + uint32 length= + cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), + "decimal(%d,?)", metadata); + str->length(length); + } + break; + + case MYSQL_TYPE_NEWDECIMAL: + { + CHARSET_INFO *cs= str->charset(); + uint32 length= + cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), + "decimal(%d,%d)", metadata >> 8, metadata & 0xff); + str->length(length); + } + break; + + case MYSQL_TYPE_ENUM: + str->set_ascii(STRING_WITH_LEN("enum")); + break; + + case MYSQL_TYPE_SET: + str->set_ascii(STRING_WITH_LEN("set")); + break; + + case MYSQL_TYPE_BLOB: + /* + Field::real_type() lies regarding the actual type of a BLOB, so + it is necessary to check the pack length to figure out what kind + of blob it really is. + */ + switch (get_blob_type_from_length(metadata)) + { + case MYSQL_TYPE_TINY_BLOB: + str->set_ascii(STRING_WITH_LEN("tinyblob")); + break; + + case MYSQL_TYPE_MEDIUM_BLOB: + str->set_ascii(STRING_WITH_LEN("mediumblob")); + break; + + case MYSQL_TYPE_LONG_BLOB: + str->set_ascii(STRING_WITH_LEN("longblob")); + break; + + case MYSQL_TYPE_BLOB: + str->set_ascii(STRING_WITH_LEN("blob")); + break; + + default: + DBUG_ASSERT(0); + break; + } + break; + + case MYSQL_TYPE_STRING: + { + /* + This is taken from Field_string::unpack. + */ + CHARSET_INFO *cs= str->charset(); + uint bytes= (((metadata >> 4) & 0x300) ^ 0x300) + (metadata & 0x00ff); + uint32 length= + cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), + "char(%d)", bytes / cs->mbmaxlen); + str->length(length); + } + break; + + case MYSQL_TYPE_GEOMETRY: + str->set_ascii(STRING_WITH_LEN("geometry")); + break; + + default: + str->set_ascii(STRING_WITH_LEN("")); + } + DBUG_VOID_RETURN; +} + + +/** + Check the order variable and print errors if the order is not + acceptable according to the current settings. + */ +bool is_conversion_ok(int order, Relay_log_info *rli) +{ + DBUG_ENTER("is_conversion_ok"); + bool allow_non_lossy= + bit_is_set(slave_type_conversions_options, SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY); + bool allow_lossy= + bit_is_set(slave_type_conversions_options, SLAVE_TYPE_CONVERSIONS_ALL_LOSSY); + + DBUG_PRINT("enter", ("order: %d, flags:%s%s", order, + allow_non_lossy ? " ALL_NON_LOSSY" : "", + allow_lossy ? " ALL_LOSSY" : "")); + if (order < 0 && !allow_non_lossy) + { + /* !!! Add error message saying that non-lossy conversions need to be allowed. */ + DBUG_RETURN(false); + } + + if (order > 0 && !allow_lossy) + { + /* !!! Add error message saying that lossy conversions need to be allowed. */ + DBUG_RETURN(false); + } + + DBUG_RETURN(true); +} + + +/** + Can a type potentially be converted to another type? + + This function check if the types are convertible and what + conversion is required. + + If conversion is not possible, and error is printed. + + If conversion is possible: + + - *order will be set to -1 if source type is smaller than target + type and a non-lossy conversion can be required. This includes + the case where the field types are different but types could + actually be converted in either direction. + + - *order will be set to 0 if no conversion is required. + + - *order will be set to 1 if the source type is strictly larger + than the target type and that conversion is potentially lossy. + + @param[in] field Target field + @param[in] type Source field type + @param[in] metadata Source field metadata + @param[in] rli Relay log info (for error reporting) + @param[out] order Order between source field and target field + + @return @c true if conversion is possible according to the current + settings, @c false if conversion is not possible according to the + current setting. + */ +static bool +can_convert_field_to(Field *field, + enum_field_types source_type, uint16 metadata, + Relay_log_info *rli, int *order_var) +{ + DBUG_ENTER("can_convert_field_to"); +#ifndef DBUG_OFF + char field_type_buf[MAX_FIELD_WIDTH]; + String field_type(field_type_buf, sizeof(field_type_buf), field->charset()); + field->sql_type(field_type); + DBUG_PRINT("enter", ("field_type: %s, target_type: %d, source_type: %d, source_metadata: 0x%x", + field_type.c_ptr(), field->real_type(), source_type, metadata)); +#endif + /* + If the real type is the same, we need to check the metadata to + decide if conversions are allowed. + */ + if (field->real_type() == source_type) + { + DBUG_PRINT("debug", ("Base types are identical, doing field size comparison")); + if (field->compatible_field_size(metadata, rli, order_var)) + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + else + DBUG_RETURN(false); + } + else if (!slave_type_conversions_options) + DBUG_RETURN(false); + + /* + Here, from and to will always be different. Since the types are + different, we cannot use the compatible_field_size() function, but + have to rely on hard-coded max-sizes for fields. + */ + + DBUG_PRINT("debug", ("Base types are different, checking conversion")); + switch (source_type) // Source type (on master) + { + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_NEWDECIMAL: + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + switch (field->real_type()) + { + case MYSQL_TYPE_NEWDECIMAL: + /* + Then the other type is either FLOAT, DOUBLE, or old style + DECIMAL, so we require lossy conversion. + */ + *order_var= 1; + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + + case MYSQL_TYPE_DECIMAL: + case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_DOUBLE: + { + if (source_type == MYSQL_TYPE_NEWDECIMAL || + source_type == MYSQL_TYPE_DECIMAL) + *order_var = 1; // Always require lossy conversions + else + *order_var= compare_lengths(field, source_type, metadata); + DBUG_ASSERT(*order_var != 0); + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + } + + default: + DBUG_RETURN(false); + } + break; + + /* + The length comparison check will do the correct job of comparing + the field lengths (in bytes) of two integer types. + */ + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_INT24: + case MYSQL_TYPE_LONG: + case MYSQL_TYPE_LONGLONG: + switch (field->real_type()) + { + case MYSQL_TYPE_TINY: + case MYSQL_TYPE_SHORT: + case MYSQL_TYPE_INT24: + case MYSQL_TYPE_LONG: + case MYSQL_TYPE_LONGLONG: + *order_var= compare_lengths(field, source_type, metadata); + DBUG_ASSERT(*order_var != 0); + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + + default: + DBUG_RETURN(false); + } + break; + + /* + Since source and target type is different, and it is not possible + to convert bit types to anything else, this will return false. + */ + case MYSQL_TYPE_BIT: + DBUG_RETURN(false); + + /* + If all conversions are disabled, it is not allowed to convert + between these types. Since the TEXT vs. BINARY is distinguished by + the charset, and the charset is not replicated, we cannot + currently distinguish between , e.g., TEXT and BLOB. + */ + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_VARCHAR: + switch (field->real_type()) + { + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_STRING: + case MYSQL_TYPE_VAR_STRING: + case MYSQL_TYPE_VARCHAR: + *order_var= compare_lengths(field, source_type, metadata); + /* + Here we know that the types are different, so if the order + gives that they do not require any conversion, we still need + to have non-lossy conversion enabled to allow conversion + between different (string) types of the same length. + */ + if (*order_var == 0) + *order_var= -1; + DBUG_RETURN(is_conversion_ok(*order_var, rli)); + + default: + DBUG_RETURN(false); + } + break; + + case MYSQL_TYPE_GEOMETRY: + case MYSQL_TYPE_TIMESTAMP: + case MYSQL_TYPE_DATE: + case MYSQL_TYPE_TIME: + case MYSQL_TYPE_DATETIME: + case MYSQL_TYPE_YEAR: + case MYSQL_TYPE_NEWDATE: + case MYSQL_TYPE_NULL: + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + DBUG_RETURN(false); + } + DBUG_RETURN(false); // To keep GCC happy +} + + +/** Is the definition compatible with a table? + This function will compare the master table with an existing table + on the slave and see if they are compatible with respect to the + current settings of @c SLAVE_TYPE_CONVERSIONS. + + If the tables are compatible and conversions are required, @c + *tmp_table_var will be set to a virtual temporary table with field + pointers for the fields that require conversions. This allow simple + checking of whether a conversion are to be applied or not. + + If tables are compatible, but no conversions are necessary, @c + *tmp_table_var will be set to NULL. + + @param rli_arg[in] + Relay log info, for error reporting. + + @param table[in] + Table to compare with + + @param tmp_table_var[out] + Virtual temporary table for performing conversions, if necessary. + + @retval true Master table is compatible with slave table. + @retval false Master table is not compatible with slave table. */ -int -table_def::compatible_with(Relay_log_info const *rli_arg, TABLE *table) +bool +table_def::compatible_with(THD *thd, Relay_log_info *rli, + TABLE *table, TABLE **conv_table_var) const { /* We only check the initial columns for the tables. */ uint const cols_to_check= min(table->s->fields, size()); - int error= 0; - Relay_log_info const *rli= const_cast(rli_arg); - - TABLE_SHARE const *const tsh= table->s; + TABLE *tmp_table= NULL; for (uint col= 0 ; col < cols_to_check ; ++col) { Field *const field= table->field[col]; - if (field->type() != type(col)) + int order; + if (can_convert_field_to(field, type(col), field_metadata(col), rli, &order)) { - DBUG_ASSERT(col < size() && col < tsh->fields); - DBUG_ASSERT(tsh->db.str && tsh->table_name.str); - error= 1; - char buf[256]; - my_snprintf(buf, sizeof(buf), "Column %d type mismatch - " - "received type %d, %s.%s has type %d", - col, type(col), tsh->db.str, tsh->table_name.str, - field->type()); - rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF, - ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf); + DBUG_PRINT("debug", ("Checking column %d -" + " field '%s' can be converted - order: %d", + col, field->field_name, order)); + DBUG_ASSERT(order >= -1 && order <= 1); + + /* + If order is not 0, a conversion is required, so we need to set + up the conversion table. + */ + if (order != 0 && tmp_table == NULL) + { + /* + This will create the full table with all fields. This is + necessary to ge the correct field lengths for the record. + */ + tmp_table= create_conversion_table(thd, rli, table); + if (tmp_table == NULL) + return false; + /* + Clear all fields up to, but not including, this column. + */ + for (unsigned int i= 0; i < col; ++i) + tmp_table->field[i]= NULL; + } + + if (order == 0 && tmp_table != NULL) + tmp_table->field[col]= NULL; } - /* - Check the slave's field size against that of the master. - */ - if (!error && - !field->compatible_field_size(field_metadata(col), rli_arg)) + else { - error= 1; - char buf[256]; - my_snprintf(buf, sizeof(buf), "Column %d size mismatch - " - "master has size %d, %s.%s on slave has size %d." - " Master's column size should be <= the slave's " - "column size.", col, - field->pack_length_from_metadata(m_field_metadata[col]), - tsh->db.str, tsh->table_name.str, - field->row_pack_length()); - rli->report(ERROR_LEVEL, ER_BINLOG_ROW_WRONG_TABLE_DEF, - ER(ER_BINLOG_ROW_WRONG_TABLE_DEF), buf); + DBUG_PRINT("debug", ("Checking column %d -" + " field '%s' can not be converted", + col, field->field_name)); + DBUG_ASSERT(col < size() && col < table->s->fields); + DBUG_ASSERT(table->s->db.str && table->s->table_name.str); + const char *db_name= table->s->db.str; + const char *tbl_name= table->s->table_name.str; + char source_buf[MAX_FIELD_WIDTH]; + char target_buf[MAX_FIELD_WIDTH]; + String source_type(source_buf, sizeof(source_buf), field->charset()); + String target_type(target_buf, sizeof(target_buf), field->charset()); + show_sql_type(type(col), field_metadata(col), &source_type); + field->sql_type(target_type); + rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED, + ER(ER_SLAVE_CONVERSION_FAILED), + col, db_name, tbl_name, + source_type.c_ptr(), target_type.c_ptr()); + return false; } } - return error; +#ifndef DBUG_OFF + if (tmp_table) + { + for (unsigned int col= 0; col < tmp_table->s->fields; ++col) + if (tmp_table->field[col]) + { + char source_buf[MAX_FIELD_WIDTH]; + char target_buf[MAX_FIELD_WIDTH]; + String source_type(source_buf, sizeof(source_buf), table->field[col]->charset()); + String target_type(target_buf, sizeof(target_buf), table->field[col]->charset()); + tmp_table->field[col]->sql_type(source_type); + table->field[col]->sql_type(target_type); + DBUG_PRINT("debug", ("Field %s - conversion required." + " Source type: '%s', Target type: '%s'", + tmp_table->field[col]->field_name, + source_type.c_ptr(), target_type.c_ptr())); + } + } +#endif + + *conv_table_var= tmp_table; + return true; } + +/** + Create a conversion table. + + If the function is unable to create the conversion table, an error + will be printed and NULL will be returned. + + @return Pointer to conversion table, or NULL if unable to create + conversion table. + */ + +TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *target_table) const +{ + DBUG_ENTER("table_def::create_conversion_table"); + + List field_list; + + for (uint col= 0 ; col < size() ; ++col) + { + Create_field *field_def= + (Create_field*) alloc_root(thd->mem_root, sizeof(Create_field)); + if (field_list.push_back(field_def)) + DBUG_RETURN(NULL); + + uint decimals= 0; + TYPELIB* interval= NULL; + uint pack_length= 0; + uint32 max_length= + max_display_length_for_field(type(col), field_metadata(col)); + + switch(type(col)) + { + int precision; + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_SET: + interval= static_cast(target_table->field[col])->typelib; + pack_length= field_metadata(col) & 0x00ff; + break; + + case MYSQL_TYPE_NEWDECIMAL: + /* + The display length of a DECIMAL type is not the same as the + length that should be supplied to make_field, so we correct + the length here. + */ + precision= field_metadata(col) >> 8; + decimals= field_metadata(col) & 0x00ff; + max_length= + my_decimal_precision_to_length(precision, decimals, FALSE); + break; + + case MYSQL_TYPE_DECIMAL: + precision= field_metadata(col); + decimals= static_cast(target_table->field[col])->dec; + max_length= field_metadata(col); + break; + + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_GEOMETRY: + pack_length= field_metadata(col) & 0x00ff; + break; + + default: + break; + } + + DBUG_PRINT("debug", ("sql_type: %d, target_field: '%s', max_length: %d, decimals: %d," + " maybe_null: %d, unsigned_flag: %d, pack_length: %u", + type(col), target_table->field[col]->field_name, + max_length, decimals, TRUE, FALSE, pack_length)); + field_def->init_for_tmp_table(type(col), + max_length, + decimals, + maybe_null(col), // maybe_null + FALSE, // unsigned_flag + pack_length); + field_def->charset= target_table->field[col]->charset(); + field_def->interval= interval; + } + + TABLE *conv_table= create_virtual_tmp_table(thd, field_list); + if (conv_table == NULL) + rli->report(ERROR_LEVEL, ER_SLAVE_CANT_CREATE_CONVERSION, + ER(ER_SLAVE_CANT_CREATE_CONVERSION), + target_table->s->db.str, + target_table->s->table_name.str); + DBUG_RETURN(conv_table); +} + +#endif /* MYSQL_CLIENT */ + +table_def::table_def(unsigned char *types, ulong size, + uchar *field_metadata, int metadata_size, + uchar *null_bitmap) + : m_size(size), m_type(0), m_field_metadata_size(metadata_size), + m_field_metadata(0), m_null_bits(0), m_memory(NULL) +{ + m_memory= (uchar *)my_multi_malloc(MYF(MY_WME), + &m_type, size, + &m_field_metadata, + size * sizeof(uint16), + &m_null_bits, (size + 7) / 8, + NULL); + + bzero(m_field_metadata, size * sizeof(uint16)); + + if (m_type) + memcpy(m_type, types, size); + else + m_size= 0; + /* + Extract the data from the table map into the field metadata array + iff there is field metadata. The variable metadata_size will be + 0 if we are replicating from an older version server since no field + metadata was written to the table map. This can also happen if + there were no fields in the master that needed extra metadata. + */ + if (m_size && metadata_size) + { + int index= 0; + for (unsigned int i= 0; i < m_size; i++) + { + switch (m_type[i]) { + case MYSQL_TYPE_TINY_BLOB: + case MYSQL_TYPE_BLOB: + case MYSQL_TYPE_MEDIUM_BLOB: + case MYSQL_TYPE_LONG_BLOB: + case MYSQL_TYPE_DOUBLE: + case MYSQL_TYPE_FLOAT: + { + /* + These types store a single byte. + */ + m_field_metadata[i]= field_metadata[index]; + index++; + break; + } + case MYSQL_TYPE_SET: + case MYSQL_TYPE_ENUM: + case MYSQL_TYPE_STRING: + { + uint16 x= field_metadata[index++] << 8U; // real_type + x+= field_metadata[index++]; // pack or field length + m_field_metadata[i]= x; + break; + } + case MYSQL_TYPE_BIT: + { + uint16 x= field_metadata[index++]; + x = x + (field_metadata[index++] << 8U); + m_field_metadata[i]= x; + break; + } + case MYSQL_TYPE_VARCHAR: + { + /* + These types store two bytes. + */ + char *ptr= (char *)&field_metadata[index]; + m_field_metadata[i]= uint2korr(ptr); + index= index + 2; + break; + } + case MYSQL_TYPE_NEWDECIMAL: + { + uint16 x= field_metadata[index++] << 8U; // precision + x+= field_metadata[index++]; // decimals + m_field_metadata[i]= x; + break; + } + default: + m_field_metadata[i]= 0; + break; + } + } + } + if (m_size && null_bitmap) + memcpy(m_null_bits, null_bitmap, (m_size + 7) / 8); +} + + +table_def::~table_def() +{ + my_free(m_memory, MYF(0)); +#ifndef DBUG_OFF + m_type= 0; + m_size= 0; +#endif +} + diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 1f4ca246ff1..97ee668c82d 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -21,6 +21,7 @@ #endif #include "mysql_priv.h" +#include "mysql_com.h" class Relay_log_info; @@ -43,116 +44,19 @@ class Relay_log_info; class table_def { public: - /** - Convenience declaration of the type of the field type data in a - table map event. - */ - typedef unsigned char field_type; - /** Constructor. - @param types Array of types + @param types Array of types, each stored as a byte @param size Number of elements in array 'types' @param field_metadata Array of extra information about fields @param metadata_size Size of the field_metadata array @param null_bitmap The bitmap of fields that can be null */ - table_def(field_type *types, ulong size, uchar *field_metadata, - int metadata_size, uchar *null_bitmap) - : m_size(size), m_type(0), m_field_metadata_size(metadata_size), - m_field_metadata(0), m_null_bits(0), m_memory(NULL) - { - m_memory= (uchar *)my_multi_malloc(MYF(MY_WME), - &m_type, size, - &m_field_metadata, - size * sizeof(uint16), - &m_null_bits, (size + 7) / 8, - NULL); + table_def(unsigned char *types, ulong size, uchar *field_metadata, + int metadata_size, uchar *null_bitmap); - bzero(m_field_metadata, size * sizeof(uint16)); - - if (m_type) - memcpy(m_type, types, size); - else - m_size= 0; - /* - Extract the data from the table map into the field metadata array - iff there is field metadata. The variable metadata_size will be - 0 if we are replicating from an older version server since no field - metadata was written to the table map. This can also happen if - there were no fields in the master that needed extra metadata. - */ - if (m_size && metadata_size) - { - int index= 0; - for (unsigned int i= 0; i < m_size; i++) - { - switch (m_type[i]) { - case MYSQL_TYPE_TINY_BLOB: - case MYSQL_TYPE_BLOB: - case MYSQL_TYPE_MEDIUM_BLOB: - case MYSQL_TYPE_LONG_BLOB: - case MYSQL_TYPE_DOUBLE: - case MYSQL_TYPE_FLOAT: - { - /* - These types store a single byte. - */ - m_field_metadata[i]= field_metadata[index]; - index++; - break; - } - case MYSQL_TYPE_SET: - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_STRING: - { - uint16 x= field_metadata[index++] << 8U; // real_type - x+= field_metadata[index++]; // pack or field length - m_field_metadata[i]= x; - break; - } - case MYSQL_TYPE_BIT: - { - uint16 x= field_metadata[index++]; - x = x + (field_metadata[index++] << 8U); - m_field_metadata[i]= x; - break; - } - case MYSQL_TYPE_VARCHAR: - { - /* - These types store two bytes. - */ - char *ptr= (char *)&field_metadata[index]; - m_field_metadata[i]= uint2korr(ptr); - index= index + 2; - break; - } - case MYSQL_TYPE_NEWDECIMAL: - { - uint16 x= field_metadata[index++] << 8U; // precision - x+= field_metadata[index++]; // decimals - m_field_metadata[i]= x; - break; - } - default: - m_field_metadata[i]= 0; - break; - } - } - } - if (m_size && null_bitmap) - memcpy(m_null_bits, null_bitmap, (m_size + 7) / 8); - } - - ~table_def() { - my_free(m_memory, MYF(0)); -#ifndef DBUG_OFF - m_type= 0; - m_size= 0; -#endif - } + ~table_def(); /** Return the number of fields there is type data for. @@ -171,10 +75,40 @@ public: index. Currently, only the type identifier is returned. */ - field_type type(ulong index) const + enum_field_types type(ulong index) const { DBUG_ASSERT(index < m_size); - return m_type[index]; + /* + If the source type is MYSQL_TYPE_STRING, it can in reality be + either MYSQL_TYPE_STRING, MYSQL_TYPE_ENUM, or MYSQL_TYPE_SET, so + we might need to modify the type to get the real type. + */ + enum_field_types source_type= static_cast(m_type[index]); + uint16 source_metadata= m_field_metadata[index]; + switch (source_type) + { + case MYSQL_TYPE_STRING: + { + int real_type= source_metadata >> 8; + if (real_type == MYSQL_TYPE_ENUM || real_type == MYSQL_TYPE_SET) + source_type= static_cast(real_type); + break; + } + + /* + This type has not been used since before row-based replication, + so we can safely assume that it really is MYSQL_TYPE_NEWDATE. + */ + case MYSQL_TYPE_DATE: + source_type= MYSQL_TYPE_NEWDATE; + break; + + default: + /* Do nothing */ + break; + } + + return source_type; } @@ -226,23 +160,58 @@ public: with it. A table definition is compatible with a table if: - - the columns types of the table definition is a (not - necessarily proper) prefix of the column type of the table, or - - the other way around + - The columns types of the table definition is a (not + necessarily proper) prefix of the column type of the table. + - The other way around. + + - Each column on the master that also exists on the slave can be + converted according to the current settings of @c + SLAVE_TYPE_CONVERSIONS. + + @param thd @param rli Pointer to relay log info @param table Pointer to table to compare with. + @param[out] tmp_table_var Pointer to temporary table for holding + conversion table. + @retval 1 if the table definition is not compatible with @c table @retval 0 if the table definition is compatible with @c table */ #ifndef MYSQL_CLIENT - int compatible_with(Relay_log_info const *rli, TABLE *table) const; + bool compatible_with(THD *thd, Relay_log_info *rli, TABLE *table, + TABLE **conv_table_var) const; + + /** + Create a virtual in-memory temporary table structure. + + The table structure has records and field array so that a row can + be unpacked into the record for further processing. + + In the virtual table, each field that requires conversion will + have a non-NULL value, while fields that do not require + conversion will have a NULL value. + + Some information that is missing in the events, such as the + character set for string types, are taken from the table that the + field is going to be pushed into, so the target table that the data + eventually need to be pushed into need to be supplied. + + @param thd Thread to allocate memory from. + @param rli Relay log info structure, for error reporting. + @param target_table Target table for fields. + + @return A pointer to a temporary table with memory allocated in the + thread's memroot, NULL if the table could not be created + */ + TABLE *create_conversion_table(THD *thd, Relay_log_info *rli, TABLE *target_table) const; #endif + private: ulong m_size; // Number of elements in the types array - field_type *m_type; // Array of type descriptors + unsigned char *m_type; // Array of type descriptors uint m_field_metadata_size; uint16 *m_field_metadata; uchar *m_null_bits; @@ -260,6 +229,7 @@ struct RPL_TABLE_LIST { bool m_tabledef_valid; table_def m_tabledef; + TABLE *m_conv_table; }; diff --git a/sql/set_var.cc b/sql/set_var.cc index b80bdde9670..624205f3a2e 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -92,6 +92,33 @@ TYPELIB delay_key_write_typelib= delay_key_write_type_names, NULL }; +/** + SLAVE_TYPE_CONVERSIONS variable. + + Definition is equivalent to + @code + SET('ALL_NON_LOSSY', 'ALL_LOSSY') + @endcode + */ +const char *slave_type_conversions_type_name[]= { + "ALL_LOSSY", + "ALL_NON_LOSSY", + NullS +}; + +unsigned int slave_type_conversions_type_length[]= { + sizeof("ALL_LOSSY")-1, + sizeof("ALL_NON_LOSSY")-1, + 0 +}; + +TYPELIB slave_type_conversions_typelib= +{ + array_elements(slave_type_conversions_type_name)-1, "", + slave_type_conversions_type_name, + slave_type_conversions_type_length +}; + const char *slave_exec_mode_names[]= { "STRICT", "IDEMPOTENT", NullS }; static const unsigned int slave_exec_mode_names_len[]= @@ -580,6 +607,12 @@ static sys_var_set_slave_mode slave_exec_mode(&vars, &slave_exec_mode_options, &slave_exec_mode_typelib, 0); +static sys_var_set slave_type_conversions(&vars, + "slave_type_conversions", + &slave_type_conversions_options, + &slave_type_conversions_typelib, + 0); + static sys_var_long_ptr sys_slow_launch_time(&vars, "slow_launch_time", &slow_launch_time); static sys_var_thd_ulong sys_sort_buffer(&vars, "sort_buffer_size", @@ -1261,7 +1294,6 @@ bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) { return result; } - bool sys_var_thd_binlog_format::is_readonly() const { /* diff --git a/sql/set_var.h b/sql/set_var.h index fa747107870..31060fa870a 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -32,6 +32,7 @@ typedef struct my_locale_st MY_LOCALE; extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib, optimizer_switch_typelib, slave_exec_mode_typelib; +extern TYPELIB slave_type_conversions_typelib; typedef int (*sys_check_func)(THD *, set_var *); typedef bool (*sys_update_func)(THD *, set_var *); diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index a17ad94ba82..f981b03a538 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6213,3 +6213,8 @@ ER_DEBUG_SYNC_TIMEOUT ER_DEBUG_SYNC_HIT_LIMIT eng "debug sync point hit limit reached" ger "Debug Sync Point Hit Limit erreicht" + +ER_SLAVE_CONVERSION_FAILED + eng "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'" +ER_SLAVE_CANT_CREATE_CONVERSION + eng "Can't create conversion table for table '%-.192s.%-.192s'" diff --git a/sql/sql_class.h b/sql/sql_class.h index 922e960c805..c3b5d05309f 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -86,6 +86,12 @@ enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON, enum enum_slave_exec_mode { SLAVE_EXEC_MODE_STRICT, SLAVE_EXEC_MODE_IDEMPOTENT, SLAVE_EXEC_MODE_LAST_BIT}; +enum enum_slave_type_conversions { + SLAVE_TYPE_CONVERSIONS_ALL_LOSSY, + SLAVE_TYPE_CONVERSIONS_ALL_NON_LOSSY, + SLAVE_TYPE_CONVERSIONS_COUNT +}; + enum enum_mark_columns { MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE}; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index c5e0bce498d..3e57d384192 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -10462,6 +10462,18 @@ TABLE *create_virtual_tmp_table(THD *thd, List &field_list) null_bit= 1; } } + if (cur_field->type() == MYSQL_TYPE_BIT && + cur_field->key_type() == HA_KEYTYPE_BIT) + { + /* This is a Field_bit since key_type is HA_KEYTYPE_BIT */ + static_cast(cur_field)->set_bit_ptr(null_pos, null_bit); + null_bit+= cur_field->field_length & 7; + if (null_bit > 7) + { + null_pos++; + null_bit-= 8; + } + } cur_field->reset(); field_pos+= cur_field->pack_length(); From e83c9f627377f05e093f092cee227da1b43d8e94 Mon Sep 17 00:00:00 2001 From: Sven Sandberg Date: Mon, 14 Dec 2009 15:33:03 +0100 Subject: [PATCH 23/69] Post-push fixes after wrong merge from 5.1->rep+2->rep+3. Problem: The test was written before BUG#45827 was fixed. The test contained code that assumed the wrong behavior, pre-BUG#45827. Then, the fix for BUG#45827 was merged from 5.1-rep+2 to 5.1-rep+3. Since the test case assumed the wrong behavior, it failed. This should have been fixed by making the test assume the correct behavior, but was fixed by updating the result file to assert failure. Fix 1: fix the test to assume correct behavior (post-BUG#45827), update result file. Fix 2: make test fail with 'die' instead of 'exit' when wrong behavior is detected. Thus, the test cannot be silenced with a wrong result file in case the behavior will change again. mysql-test/extra/rpl_tests/create_recursive_construct.inc: Replaced 'exit' by 'die' to avoid similar mysql-test/suite/binlog/r/binlog_unsafe.result: Updated result file. mysql-test/suite/binlog/t/binlog_unsafe.test: Since BUG#45827 is now fixed, we need to update the test case in two places where it expects the wrong result because of BUG#45827. --- .../rpl_tests/create_recursive_construct.inc | 22 +- .../suite/binlog/r/binlog_unsafe.result | 1964 ++++++++++++++++- mysql-test/suite/binlog/t/binlog_unsafe.test | 6 +- 3 files changed, 1945 insertions(+), 47 deletions(-) diff --git a/mysql-test/extra/rpl_tests/create_recursive_construct.inc b/mysql-test/extra/rpl_tests/create_recursive_construct.inc index 0111d10640f..628f1735726 100644 --- a/mysql-test/extra/rpl_tests/create_recursive_construct.inc +++ b/mysql-test/extra/rpl_tests/create_recursive_construct.inc @@ -296,10 +296,10 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` if (`SELECT '$n_warnings' != '$CRC_ARG_expected_number_of_warnings'`) { - --echo Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. + --echo ******** Failure! Expected $CRC_ARG_expected_number_of_warnings warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; - --exit + --die Wrong number of warnings. } # These queries are run without query log, to make result file more @@ -313,17 +313,17 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` if (`SELECT '$n_warnings' != '0'`) { - --echo Failure! Expected 0 warnings, got $n_warnings warnings. + --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; - --exit + --die Wrong number of warnings. } --let $binlog_event= query_get_value(SHOW BINLOG EVENTS, Event_type, 2) if (`SELECT '$binlog_event' != 'No such row'`) { --enable_query_log - --echo Failure! Something was written to the binlog despite SQL_LOG_BIN=0: + --echo ******** Failure! Something was written to the binlog despite SQL_LOG_BIN=0 ******** SHOW BINLOG EVENTS; - --exit + --die Binlog not empty } SET SQL_LOG_BIN = 1; @@ -333,17 +333,17 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { --eval $CRC_RET_stmt_sidef --let $n_warnings= `SHOW COUNT(*) WARNINGS` if (`SELECT '$n_warnings' != '0'`) { - --echo Failure! Expected 0 warnings, got $n_warnings warnings. + --echo ******** Failure! Expected 0 warnings, got $n_warnings warnings. ******** SHOW WARNINGS; SHOW BINLOG EVENTS; - --exit + --die Warnings printed } # The first event is format_description, the second is # Query_event('BEGIN'), and the third should be our Table_map. --let $event_type= query_get_value(SHOW BINLOG EVENTS, Event_type, 3) if (`SELECT '$event_type' != 'Table_map'`) { --enable_query_log - --echo Failure! Event number 3 was a '$event_type', not a 'Table_map'. + --echo ******** Failure! Event number 3 was a '$event_type', not a 'Table_map'. ******** # Currently, there is a bug causing some statements to be logged # partially in statement format. Hence, we don't fail here, we @@ -352,7 +352,7 @@ if (`SELECT '$CRC_RET_stmt_sidef' != ''`) { # we should instead execute: #--enable_query_log #SHOW BINLOG EVENTS; - #--exit + #--die Wrong events in binlog. # Here, we should really source # include/show_binlog_events.inc. But due to BUG#41913, that @@ -386,7 +386,7 @@ if (`SELECT '$CRC_RET_sel_retval' != ''`) { # --echo Failure! Expected 0 warnings, got $n_warnings warnings. # SHOW WARNINGS; # SHOW BINLOG EVENTS; - # --exit + # --die Wrong number of warnings. #} } diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index f6f3b8354e1..ad2abcaa011 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -71,7 +71,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -147,7 +147,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -223,7 +223,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -287,7 +287,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -355,7 +355,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -465,7 +465,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -541,7 +541,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -617,7 +617,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -681,7 +681,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -765,7 +765,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -841,7 +841,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -905,7 +905,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -973,7 +973,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -1069,7 +1069,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -1145,7 +1145,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -1209,7 +1209,7 @@ Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. -Failure! Event number 3 was a 'Query', not a 'Table_map'. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN @@ -1268,24 +1268,1924 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Invoking function func_sidef_1 invoking unsafe update of two autoinc columns. CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); RETURN 0; END; -* binlog_format = STATEMENT: expect 0 warnings. +* binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. -Failure! Expected 0 warnings, got 1 warnings. -SHOW WARNINGS; -Level Code Message +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. -SHOW BINLOG EVENTS; +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; Log_name Pos Event_type Server_id End_log_pos Info -master-bin.000001 4 Format_desc 1 107 Server ver: 5.1.42-debug-log, Binlog ver: 4 -master-bin.000001 107 Query 1 175 BEGIN -master-bin.000001 175 Table_map 1 218 table_id: 34 (test.t0) -master-bin.000001 218 Write_rows 1 253 table_id: 34 flags: STMT_END_F -master-bin.000001 253 Query 1 322 COMMIT -master-bin.000001 322 Query 1 577 use `test`; CREATE DEFINER=`root`@`localhost` FUNCTION `func_sidef_1`() RETURNS varchar(100) CHARSET latin1 -BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); RETURN 0; END -master-bin.000001 577 Query 1 645 BEGIN -master-bin.000001 645 Intvar 1 673 INSERT_ID=1 -master-bin.000001 673 Query 1 772 use `test`; INSERT INTO t1 SELECT func_sidef_1() -master-bin.000001 772 Query 1 841 COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe update of two autoinc columns. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe update of two autoinc columns. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO double_autoinc_table VALUES (NULL); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe update of two autoinc columns. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking prepared statement prep_1 invoking unsafe update of two autoinc columns. +PREPARE prep_1 FROM "INSERT INTO double_autoinc_table VALUES (NULL)"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe update of two autoinc columns. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO double_autoinc_table VALUES (NULL); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing unsafeness of UDF's ==== + +Invoking function func_retval_1 returning value from unsafe UDF. +CREATE FUNCTION func_retval_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); RETURN myfunc_int(10); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t1 VALUES (func_retval_1()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_1(); + +Invoking function func_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. +CREATE FUNCTION func_retval_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); RETURN func_retval_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 VALUES (func_retval_2()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT func_retval_2(); +DROP FUNCTION func_retval_2; + +Invoking function func_sidef_2 invoking function func_retval_1 returning value from unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_retval_1 returning value from unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_retval_1 returning value from unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 VALUES (func_retval_1()); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from function func_retval_1 returning value from unsafe UDF. +CREATE VIEW view_retval_2 AS SELECT func_retval_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking function func_retval_1 returning value from unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO t1 VALUES (func_retval_1())"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_retval_1; + +Invoking function func_sidef_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe UDF. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe UDF. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe UDF. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe UDF. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 VALUES (myfunc_int(10)); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_sidef_1 invoking unsafe UDF. +CREATE VIEW view_sidef_1 AS SELECT myfunc_int(10); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t1 SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking view view_sidef_1 invoking unsafe UDF. +CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking view view_sidef_1 invoking unsafe UDF. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_sidef_1; + +Invoking prepared statement prep_1 invoking unsafe UDF. +PREPARE prep_1 FROM "INSERT INTO t0 VALUES (myfunc_int(10))"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe UDF. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t0 VALUES (myfunc_int(10)); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing unsafeness of access to mysql.general_log ==== + +Invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT + +Invoking function func_sidef_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking unsafe use of mysql.general_log. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking unsafe use of mysql.general_log. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE VIEW view_retval_1 AS SELECT COUNT(*) FROM mysql.general_log; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t1 SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_1; + +Invoking function func_sidef_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; RETURN 0; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect 1 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_retval_1; END; +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe use of mysql.general_log. +CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t2 SELECT * FROM view_retval_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT * FROM view_retval_2; +DROP VIEW view_retval_2; + +Invoking prepared statement prep_2 invoking view view_retval_1 returning value from unsafe use of mysql.general_log. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_retval_1; + +Invoking prepared statement prep_1 invoking unsafe use of mysql.general_log. +PREPARE prep_1 FROM "INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log"; +* binlog_format = STATEMENT: expect 1 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking unsafe use of mysql.general_log. +* binlog_format = STATEMENT: expect 1 warnings. +INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +* Invoke statement so that return value is dicarded: expect no warning. +SELECT COUNT(*) FROM mysql.general_log; + +==== Testing a statement that is unsafe in many ways ==== + +Invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; RETURN 0; END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 7 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking statement that is unsafe in many ways. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 7 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; END; +* binlog_format = STATEMENT: expect 7 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 7 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking statement that is unsafe in many ways. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 7 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 7 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.double_autoinc_table) +master-bin.000001 # Table_map # # table_id: # (test.autoinc_table) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 7 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking statement that is unsafe in many ways. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 7 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking prepared statement prep_1 invoking statement that is unsafe in many ways. +PREPARE prep_1 FROM "INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1"; +* binlog_format = STATEMENT: expect 7 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking statement that is unsafe in many ways. +* binlog_format = STATEMENT: expect 7 warnings. +INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfunc_int(), NULL) FROM mysql.general_log LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +==== Testing a statement that is unsafe several times ==== + +Invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VALUES (multi_unsafe_func()); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t1 SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT func_sidef_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking function func_sidef_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP FUNCTION func_sidef_1; + +Invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VALUES (multi_unsafe_func()); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT + +Invoking function func_sidef_2 invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking procedure proc_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking procedure proc_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "CALL proc_1()"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta1 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PREPARE prep_2; +DROP PROCEDURE proc_1; + +Invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO ta0 VALUES (multi_unsafe_func()); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_1 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.trigger_table_1) +master-bin.000001 # Table_map # # table_id: # (test.ta0) +master-bin.000001 # Table_map # # table_id: # (test.ta1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking trigger trig_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger_table_1 VALUES (1); END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking prepared statement prep_2 invoking trigger trig_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP TRIGGER trig_1; + +Invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE VIEW view_sidef_1 AS SELECT multi_unsafe_func(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t1 SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. + +Invoking function func_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; RETURN 0; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT func_sidef_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP FUNCTION func_sidef_2; + +Invoking procedure proc_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect 2 warnings. +CALL proc_2(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** +SHOW BINLOG EVENTS FROM ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Query # # use `test`; INSERT INTO ta2 VALUES (47) +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Table_map # # table_id: # (test.t0) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +DROP PROCEDURE proc_2; + +Invoking trigger trig_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELECT * FROM view_sidef_1; END; +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO trigger_table_2 VALUES (1); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER trig_2; + +Invoking view view_sidef_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +CREATE VIEW view_sidef_2 AS SELECT * FROM view_sidef_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO t2 SELECT * FROM view_sidef_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP VIEW view_sidef_2; + +Invoking prepared statement prep_2 invoking view view_sidef_1 invoking statement that is unsafe several times. +PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_sidef_1"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_2; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_2; +DROP VIEW view_sidef_1; + +Invoking prepared statement prep_1 invoking statement that is unsafe several times. +PREPARE prep_1 FROM "INSERT INTO ta0 VALUES (multi_unsafe_func())"; +* binlog_format = STATEMENT: expect 2 warnings. +EXECUTE prep_1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP PREPARE prep_1; + +Invoking statement that is unsafe several times. +* binlog_format = STATEMENT: expect 2 warnings. +INSERT INTO ta0 VALUES (multi_unsafe_func()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +* SQL_LOG_BIN = 0: expect nothing logged and no warning. +* binlog_format = MIXED: expect row events in binlog and no warning. +DROP TRIGGER double_autoinc_trig; +DROP TABLE t0, t1, t2, t3, ta0, ta1, ta2, ta3, +autoinc_table, double_autoinc_table, +data_table, +trigger_table_1, trigger_table_2, trigger_table_3; +DROP FUNCTION myfunc_int; +DROP FUNCTION multi_unsafe_func; +==== Special system variables that should *not* be unsafe ==== +CREATE TABLE t1 (a VARCHAR(1000)); +CREATE TABLE autoinc_table (a INT PRIMARY KEY AUTO_INCREMENT); +INSERT INTO t1 VALUES (@@session.auto_increment_increment); +INSERT INTO t1 VALUES (@@session.auto_increment_offset); +INSERT INTO t1 VALUES (@@session.character_set_client); +INSERT INTO t1 VALUES (@@session.character_set_connection); +INSERT INTO t1 VALUES (@@session.character_set_database); +INSERT INTO t1 VALUES (@@session.character_set_server); +INSERT INTO t1 VALUES (@@session.collation_connection); +INSERT INTO t1 VALUES (@@session.collation_database); +INSERT INTO t1 VALUES (@@session.collation_server); +INSERT INTO t1 VALUES (@@session.foreign_key_checks); +INSERT INTO t1 VALUES (@@session.identity); +INSERT INTO t1 VALUES (@@session.last_insert_id); +INSERT INTO t1 VALUES (@@session.lc_time_names); +INSERT INTO t1 VALUES (@@session.pseudo_thread_id); +INSERT INTO t1 VALUES (@@session.sql_auto_is_null); +INSERT INTO t1 VALUES (@@session.timestamp); +INSERT INTO t1 VALUES (@@session.time_zone); +INSERT INTO t1 VALUES (@@session.unique_checks); +SET @my_var= 4711; +INSERT INTO t1 VALUES (@my_var); +SET insert_id= 12; +INSERT INTO autoinc_table VALUES (NULL); +The following variables *should* give a warning, despite they are replicated. +INSERT INTO t1 VALUES (@@session.sql_mode); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +INSERT INTO t1 VALUES (@@session.insert_id); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +DROP TABLE t1, autoinc_table; +CREATE TABLE t1(a INT, b INT, KEY(a), PRIMARY KEY(b)); +INSERT INTO t1 SELECT * FROM t1 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +REPLACE INTO t1 SELECT * FROM t1 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +UPDATE t1 SET a=1 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +DELETE FROM t1 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +CREATE PROCEDURE p1() +BEGIN +INSERT INTO t1 SELECT * FROM t1 LIMIT 1; +REPLACE INTO t1 SELECT * FROM t1 LIMIT 1; +UPDATE t1 SET a=1 LIMIT 1; +DELETE FROM t1 LIMIT 1; +END| +CALL p1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +DROP PROCEDURE p1; +DROP TABLE t1; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a VARCHAR(100), b VARCHAR(100)); +INSERT INTO t1 VALUES ('a','b'); +UPDATE t1 SET b = '%s%s%s%s%s%s%s%s%s%s%s%s%s%s' WHERE a = 'a' LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +DROP TABLE t1; +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1(i INT PRIMARY KEY); +CREATE TABLE t2(i INT PRIMARY KEY); +CREATE TABLE t3(i INT, ch CHAR(50)); +"Should issue message Statement may not be safe to log in statement format." +INSERT INTO t1 SELECT * FROM t2 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +CREATE FUNCTION func6() +RETURNS INT +BEGIN +INSERT INTO t1 VALUES (10); +INSERT INTO t1 VALUES (11); +INSERT INTO t1 VALUES (12); +RETURN 0; +END| +"Should issue message Statement may not be safe to log in statement format only once" +INSERT INTO t3 VALUES(func6(), UUID()); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +"Check whether SET @@SQL_LOG_BIN = 0/1 doesn't work in substatements" +CREATE FUNCTION fun_check_log_bin() RETURNS INT +BEGIN +SET @@SQL_LOG_BIN = 0; +INSERT INTO t1 VALUES(@@global.sync_binlog); +RETURN 100; +END| +"One unsafe warning should be issued in the following statement" +SELECT fun_check_log_bin(); +fun_check_log_bin() +100 +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +"SQL_LOG_BIN should be ON still" +SHOW VARIABLES LIKE "SQL_LOG_BIN"; +Variable_name Value +sql_log_bin ON +set @save_log_bin = @@SESSION.SQL_LOG_BIN; +set @@SESSION.SQL_LOG_BIN = 0; +"Should NOT have any warning message issued in the following statements" +INSERT INTO t1 SELECT * FROM t2 LIMIT 1; +DROP TABLE t1,t2; +"Should NOT have any warning message issued in the following func7() and trig" +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a CHAR(40)); +CREATE TABLE trigger_table (a CHAR(7)); +CREATE FUNCTION func7() +RETURNS INT +BEGIN +INSERT INTO t1 VALUES (@@global.sync_binlog); +INSERT INTO t1 VALUES (@@session.insert_id); +INSERT INTO t2 SELECT UUID(); +INSERT INTO t2 VALUES (@@session.sql_mode); +INSERT INTO t2 VALUES (@@global.init_slave); +RETURN 0; +END| +SHOW VARIABLES LIKE "SQL_LOG_BIN"; +Variable_name Value +sql_log_bin OFF +SELECT func7(); +func7() +0 +---- Insert from trigger ---- +CREATE TRIGGER trig +BEFORE INSERT ON trigger_table +FOR EACH ROW +BEGIN +INSERT INTO t1 VALUES (@@global.sync_binlog); +INSERT INTO t1 VALUES (@@session.insert_id); +INSERT INTO t1 VALUES (@@global.auto_increment_increment); +INSERT INTO t2 SELECT UUID(); +INSERT INTO t2 VALUES (@@session.sql_mode); +INSERT INTO t2 VALUES (@@global.init_slave); +INSERT INTO t2 VALUES (@@hostname); +END| +INSERT INTO trigger_table VALUES ('bye.'); +DROP FUNCTION fun_check_log_bin; +DROP FUNCTION func6; +DROP FUNCTION func7; +DROP TRIGGER trig; +DROP TABLE t1, t2, t3, trigger_table; +set @@SESSION.SQL_LOG_BIN = @save_log_bin; +SET @save_sql_mode = @@SESSION.SQL_MODE; +SET @@SESSION.SQL_MODE = STRICT_ALL_TABLES; +CREATE TABLE t1(i INT PRIMARY KEY); +CREATE TABLE t2(i INT PRIMARY KEY); +INSERT INTO t1 SELECT * FROM t2 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +INSERT INTO t1 VALUES(@@global.sync_binlog); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. +UPDATE t1 SET i = 999 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +DELETE FROM t1 LIMIT 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. +DROP TABLE t1, t2; +SET @@SESSION.SQL_MODE = @save_sql_mode; +SET @old_binlog_format = @@session.binlog_format; +SET binlog_format = MIXED; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +INSERT INTO t2 VALUES (1), (2); +CREATE PROCEDURE proc_insert_delayed () +BEGIN +INSERT DELAYED INTO t1 VALUES (1), (2); +END| +CREATE FUNCTION func_limit () +RETURNS INT +BEGIN +INSERT INTO t1 SELECT * FROM t2 LIMIT 1; +RETURN 1; +END| +RESET MASTER; +CALL proc_insert_delayed(); +SELECT func_limit(); +func_limit() +1 +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +SET @@session.binlog_format = @old_binlog_format; +DROP TABLE t1, t2; +DROP PROCEDURE proc_insert_delayed; +DROP FUNCTION func_limit; +CREATE TABLE t1 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE FUNCTION func_modify_t1 () +RETURNS INT +BEGIN +INSERT INTO t1 SET a = 1; +RETURN 0; +END| +# The following statement causes auto-incrementation +# of both t1 and t2. It is logged in statement format, +# so it should produce unsafe warning. +INSERT INTO t2 SET a = func_modify_t1(); +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +SET SESSION binlog_format = MIXED; +# Check if the statement is logged in row format. +INSERT INTO t2 SET a = func_modify_t1(); +SHOW BINLOG EVENTS FROM 1493; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 1493 Query 1 1561 BEGIN +master-bin.000001 1561 Table_map 1 1603 table_id: 205 (test.t2) +master-bin.000001 1603 Table_map 1 1645 table_id: 206 (test.t1) +master-bin.000001 1645 Write_rows 1 1683 table_id: 206 +master-bin.000001 1683 Write_rows 1 1721 table_id: 205 flags: STMT_END_F +master-bin.000001 1721 Query 1 1790 COMMIT +DROP TABLE t1,t2; +DROP FUNCTION func_modify_t1; +SET SESSION binlog_format = STATEMENT; +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +CREATE TABLE t3 (a INT, b INT PRIMARY KEY AUTO_INCREMENT); +create trigger tri_modify_two_tables before insert on t1 for each row begin +insert into t2(a) values(new.a); +insert into t3(a) values(new.a); +end | +# The following statement causes auto-incrementation +# of both t2 and t3. It is logged in statement format, +# so it should produce unsafe warning +INSERT INTO t1 SET a = 1; +Warnings: +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. +SET SESSION binlog_format = MIXED; +# Check if the statement is logged in row format. +INSERT INTO t1 SET a = 2; +SHOW BINLOG EVENTS FROM 2773; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 2773 Query 1 2841 BEGIN +master-bin.000001 2841 Table_map 1 2882 table_id: 208 (test.t1) +master-bin.000001 2882 Table_map 1 2924 table_id: 209 (test.t3) +master-bin.000001 2924 Table_map 1 2966 table_id: 210 (test.t2) +master-bin.000001 2966 Write_rows 1 3004 table_id: 210 +master-bin.000001 3004 Write_rows 1 3042 table_id: 209 +master-bin.000001 3042 Write_rows 1 3076 table_id: 208 flags: STMT_END_F +master-bin.000001 3076 Query 1 3145 COMMIT +DROP TABLE t1,t2,t3; +"End of tests" diff --git a/mysql-test/suite/binlog/t/binlog_unsafe.test b/mysql-test/suite/binlog/t/binlog_unsafe.test index 1d9e75d8ae7..fa26c2a1833 100644 --- a/mysql-test/suite/binlog/t/binlog_unsafe.test +++ b/mysql-test/suite/binlog/t/binlog_unsafe.test @@ -194,8 +194,7 @@ while (`SELECT $unsafe_type < 9`) { --let $value_0= --let $sel_sidef_0= --let $sel_retval_0= - # Note: we will expect 1 warning when BUG#45827 is fixed. - --let $CRC_ARG_expected_number_of_warnings= 0 + --let $CRC_ARG_expected_number_of_warnings= 1 } if (`SELECT $unsafe_type = 5`) { @@ -227,8 +226,7 @@ while (`SELECT $unsafe_type < 9`) { --let $value_0= --let $sel_sidef_0= --let $sel_retval_0= - # Note: we will expect 7 warnings when BUG#45827 is fixed. - --let $CRC_ARG_expected_number_of_warnings= 6 + --let $CRC_ARG_expected_number_of_warnings= 7 } if (`SELECT $unsafe_type = 8`) { From 870daf5c017762fb5560186737872f8635070ffe Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 14 Dec 2009 23:27:06 +0100 Subject: [PATCH 24/69] WL#5151: Conversion between different types when replicating Fixing minor error when printing SQL types from master and cleaning some code. Updating result files. --- mysql-test/suite/rpl/r/rpl_row_colSize.result | 8 ++++---- sql/rpl_utility.cc | 12 +++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index 29e96936c87..c7ee859f6f9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -256,7 +256,7 @@ Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1641 -Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(8)' to type 'bit(5)' +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -274,7 +274,7 @@ Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # Last_SQL_Errno 1641 -Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(8)' to type 'bit(5)' +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)' SELECT COUNT(*) FROM t1; COUNT(*) 0 @@ -310,7 +310,7 @@ Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno 1641 -Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(5)' to type 'bit(11)' +Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -328,7 +328,7 @@ Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # Last_SQL_Errno 1641 -Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(5)' to type 'bit(11)' +Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)' SELECT COUNT(*) FROM t1; COUNT(*) 0 diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index f24de23bcf3..9d26c133279 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -116,17 +116,11 @@ max_display_length_for_field(enum_field_types sql_type, unsigned int metadata) return 8; case MYSQL_TYPE_BIT: - { /* Decode the size of the bit field from the master. - from_len is the length in bytes from the master - from_bit_len is the number of extra bits stored in the master record */ - uint from_len= (metadata >> 8U) & 0x00ff; - uint from_bit_len= metadata & 0x00ff; - DBUG_ASSERT(from_bit_len <= 7); - return 8 * from_len + from_bit_len; - } + DBUG_ASSERT((metadata & 0xff) <= 7); + return 8 * (metadata >> 8U) + (metadata & 0x00ff); case MYSQL_TYPE_VAR_STRING: case MYSQL_TYPE_VARCHAR: @@ -422,7 +416,7 @@ void show_sql_type(enum_field_types type, uint16 metadata, String *str) case MYSQL_TYPE_BIT: { CHARSET_INFO *cs= str->charset(); - int bit_length= (metadata >> 8) + (metadata & 0xFF); + int bit_length= 8 * (metadata >> 8) + (metadata & 0xFF); uint32 length= cs->cset->snprintf(cs, (char*) str->ptr(), str->alloced_length(), "bit(%d)", bit_length); From 9e980bf79ef0c727c630e79c1bc043c48bc947ee Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Tue, 15 Dec 2009 16:11:44 +0100 Subject: [PATCH 25/69] BUG#49618: Field length stored incorrectly in binary log for InnoDB The class Field_bit_as_char stores the metadata for the field incorrecly because bytes_in_rec and bit_len are set to (field_length + 7 ) / 8 and 0 respectively, while Field_bit has the correct values field_length / 8 and field_length % 8. Solved the problem by re-computing the values for the metadata based on the field_length instead of using the bytes_in_rec and bit_len variables. To handle compatibility with old server, a table map flag was added to indicate that the bit computation is exact. If the flag is clear, the slave computes the number of bytes required to store the bit field and compares that instead, effectively allowing replication *without conversion* from any field length that require the same number of bytes to store. mysql-test/suite/rpl/t/rpl_typeconv_innodb.test: Adding test to check compatibility for bit field replication when using InnoDB. sql/field.cc: Extending compatible_field_size() with flags from table map to allow fields to check master info. sql/field.h: Extending compatible_field_size() with flags from table map to allow fields to check master info. sql/log.cc: Removing table map flags since they are not used outside table map class. sql/log_event.cc: Removing flags parameter from table map constructor since it is not used and does not have to be exposed. sql/log_event.h: Adding flag to denote that bit length for bit field type is exact and not potentially rounded to even bytes. sql/rpl_utility.cc: Adding fields to table_def to store table map flags. sql/rpl_utility.h: Removing obsolete comment and adding flags to store table map flags from master. --- .../suite/rpl/r/rpl_typeconv_innodb.result | 18 ++++++++++ mysql-test/suite/rpl/t/rpl_typeconv-slave.opt | 1 + .../suite/rpl/t/rpl_typeconv_innodb.test | 29 ++++++++++++++++ sql/field.cc | 33 ++++++++++++++++--- sql/field.h | 8 ++--- sql/log.cc | 5 +-- sql/log_event.cc | 10 +++--- sql/log_event.h | 10 +++--- sql/rpl_utility.cc | 16 ++++++--- sql/rpl_utility.h | 9 ++--- 10 files changed, 104 insertions(+), 35 deletions(-) create mode 100644 mysql-test/suite/rpl/r/rpl_typeconv_innodb.result create mode 100644 mysql-test/suite/rpl/t/rpl_typeconv-slave.opt create mode 100644 mysql-test/suite/rpl/t/rpl_typeconv_innodb.test diff --git a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result new file mode 100644 index 00000000000..0b4286c54eb --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result @@ -0,0 +1,18 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +**** Resetting master and slave **** +include/stop_slave.inc +RESET SLAVE; +RESET MASTER; +include/start_slave.inc +SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = ''; +CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (b'0', b'01', b'101'); +Comparing tables master:test.t1 and slave:test.t1 +DROP TABLE t1; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; diff --git a/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt b/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt new file mode 100644 index 00000000000..73ca7001985 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_typeconv-slave.opt @@ -0,0 +1 @@ +--innodb \ No newline at end of file diff --git a/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test b/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test new file mode 100644 index 00000000000..729a622348f --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_typeconv_innodb.test @@ -0,0 +1,29 @@ +--source include/have_binlog_format_row.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +# +# BUG#49618: Field length stored incorrectly in binary log for InnoDB +# + +source include/reset_master_and_slave.inc; + +connection slave; +SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = ''; + +connection master; +CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB; +INSERT INTO t1 VALUES (b'0', b'01', b'101'); +sync_slave_with_master; + +let $diff_table_1=master:test.t1; +let $diff_table_2=slave:test.t1; +source include/diff_tables.inc; + +connection master; +DROP TABLE t1; +sync_slave_with_master; + +connection slave; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; diff --git a/sql/field.cc b/sql/field.cc index b6a795d34aa..477cdc0a993 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -1407,6 +1407,7 @@ bool Field::send_binary(Protocol *protocol) type, 0 is returned in *order_var. @param field_metadata Encoded size in field metadata + @param mflags Flags from the table map event for the table. @param order_var Pointer to variable where the order between the source field and this field will be returned. @@ -1416,6 +1417,7 @@ bool Field::send_binary(Protocol *protocol) */ bool Field::compatible_field_size(uint field_metadata, Relay_log_info *rli_arg __attribute__((unused)), + uint16 mflags __attribute__((unused)), int *order_var) { uint const source_size= pack_length_from_metadata(field_metadata); @@ -2950,6 +2952,7 @@ uint Field_new_decimal::pack_length_from_metadata(uint field_metadata) bool Field_new_decimal::compatible_field_size(uint field_metadata, Relay_log_info * __attribute__((unused)), + uint16 mflags __attribute__((unused)), int *order_var) { uint const source_precision= (field_metadata >> 8U) & 0x00ff; @@ -6733,6 +6736,7 @@ check_field_for_37426(const void *param_arg) bool Field_string::compatible_field_size(uint field_metadata, Relay_log_info *rli_arg, + uint16 mflags __attribute__((unused)), int *order_var) { #ifdef HAVE_REPLICATION @@ -6741,7 +6745,7 @@ Field_string::compatible_field_size(uint field_metadata, check_field_for_37426, &check_param)) return FALSE; // Not compatible field sizes #endif - return Field::compatible_field_size(field_metadata, rli_arg, order_var); + return Field::compatible_field_size(field_metadata, rli_arg, mflags, order_var); } @@ -9305,8 +9309,13 @@ int Field_bit::do_save_field_metadata(uchar *metadata_ptr) DBUG_ENTER("Field_bit::do_save_field_metadata"); DBUG_PRINT("debug", ("bit_len: %d, bytes_in_rec: %d", bit_len, bytes_in_rec)); - *metadata_ptr= bit_len; - *(metadata_ptr + 1)= bytes_in_rec; + /* + Since this class and Field_bit_as_char have different ideas of + what should be stored here, we compute the values of the metadata + explicitly using the field_length. + */ + metadata_ptr[0]= field_length % 8; + metadata_ptr[1]= field_length / 8; DBUG_RETURN(2); } @@ -9335,15 +9344,29 @@ uint Field_bit::pack_length_from_metadata(uint field_metadata) bool Field_bit::compatible_field_size(uint field_metadata, Relay_log_info * __attribute__((unused)), + uint16 mflags, int *order_var) { DBUG_ENTER("Field_bit::compatible_field_size"); DBUG_ASSERT((field_metadata >> 16) == 0); - uint const from_bit_len= + uint from_bit_len= 8 * (field_metadata >> 8) + (field_metadata & 0xff); - uint const to_bit_len= max_display_length(); + uint to_bit_len= max_display_length(); DBUG_PRINT("debug", ("from_bit_len: %u, to_bit_len: %u", from_bit_len, to_bit_len)); + /* + If the bit length exact flag is clear, we are dealing with an old + master, so we allow some less strict behaviour if replicating by + moving both bit lengths to an even multiple of 8. + + We do this by computing the number of bytes to store the field + instead, and then compare the result. + */ + if (!(mflags & Table_map_log_event::TM_BIT_LEN_EXACT_F)) { + from_bit_len= (from_bit_len + 7) / 8; + to_bit_len= (to_bit_len + 7) / 8; + } + *order_var= compare(from_bit_len, to_bit_len); DBUG_RETURN(TRUE); } diff --git a/sql/field.h b/sql/field.h index cfa3e57d2a0..12ee9b46d03 100644 --- a/sql/field.h +++ b/sql/field.h @@ -165,7 +165,7 @@ public: */ virtual uint32 pack_length_in_rec() const { return pack_length(); } virtual bool compatible_field_size(uint metadata, Relay_log_info *rli, - int *order); + uint16 mflags, int *order); virtual uint pack_length_from_metadata(uint field_metadata) { DBUG_ENTER("Field::pack_length_from_metadata"); @@ -805,7 +805,7 @@ public: uint pack_length_from_metadata(uint field_metadata); uint row_pack_length() { return pack_length(); } bool compatible_field_size(uint field_metadata, Relay_log_info *rli, - int *order_var); + uint16 mflags, int *order_var); uint is_equal(Create_field *new_field); virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data, bool low_byte_first); @@ -1500,7 +1500,7 @@ public: return (((field_metadata >> 4) & 0x300) ^ 0x300) + (field_metadata & 0x00ff); } bool compatible_field_size(uint field_metadata, Relay_log_info *rli, - int *order_var); + uint16 mflags, int *order_var); uint row_pack_length() { return field_length; } int pack_cmp(const uchar *a,const uchar *b,uint key_length, my_bool insert_or_update); @@ -1964,7 +1964,7 @@ public: uint row_pack_length() { return (bytes_in_rec + ((bit_len > 0) ? 1 : 0)); } bool compatible_field_size(uint metadata, Relay_log_info *rli, - int *order_var); + uint16 mflags, int *order_var); void sql_type(String &str) const; virtual uchar *pack(uchar *to, const uchar *from, uint max_length, bool low_byte_first); diff --git a/sql/log.cc b/sql/log.cc index e8366c47863..f74b3ef858a 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3846,11 +3846,8 @@ int THD::binlog_write_table_map(TABLE *table, bool is_trans) DBUG_ASSERT(current_stmt_binlog_row_based && mysql_bin_log.is_open()); DBUG_ASSERT(table->s->table_map_id != ULONG_MAX); - Table_map_log_event::flag_set const - flags= Table_map_log_event::TM_NO_FLAGS; - Table_map_log_event - the_event(this, table, table->s->table_map_id, is_trans, flags); + the_event(this, table, table->s->table_map_id, is_trans); if (is_trans && binlog_table_maps == 0) binlog_start_trans_and_stmt(); diff --git a/sql/log_event.cc b/sql/log_event.cc index 00919b65fa0..513fb7fe7e8 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -7852,7 +7852,7 @@ int Table_map_log_event::save_field_metadata() */ #if !defined(MYSQL_CLIENT) Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, - bool is_transactional, uint16 flags) + bool is_transactional) : Log_event(thd, 0, true), m_table(tbl), m_dbnam(tbl->s->db.str), @@ -7862,7 +7862,7 @@ Table_map_log_event::Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, m_colcnt(tbl->s->fields), m_memory(NULL), m_table_id(tid), - m_flags(flags), + m_flags(TM_BIT_LEN_EXACT_F), m_data_size(0), m_field_metadata(0), m_field_metadata_size(0), @@ -8120,8 +8120,10 @@ int Table_map_log_event::do_apply_event(Relay_log_info const *rli) inside Relay_log_info::clear_tables_to_lock() by calling the table_def destructor explicitly. */ - new (&table_list->m_tabledef) table_def(m_coltype, m_colcnt, - m_field_metadata, m_field_metadata_size, m_null_bits); + new (&table_list->m_tabledef) + table_def(m_coltype, m_colcnt, + m_field_metadata, m_field_metadata_size, + m_null_bits, m_flags); table_list->m_tabledef_valid= TRUE; /* diff --git a/sql/log_event.h b/sql/log_event.h index 31d4a7480c2..673760557ca 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -3283,16 +3283,14 @@ public: /* Special constants representing sets of flags */ enum { - TM_NO_FLAGS = 0U + TM_NO_FLAGS = 0U, + TM_BIT_LEN_EXACT_F = (1U << 0) }; - void set_flags(flag_set flag) { m_flags |= flag; } - void clear_flags(flag_set flag) { m_flags &= ~flag; } flag_set get_flags(flag_set flag) const { return m_flags & flag; } #ifndef MYSQL_CLIENT - Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, - bool is_transactional, uint16 flags); + Table_map_log_event(THD *thd, TABLE *tbl, ulong tid, bool is_transactional); #endif #ifdef HAVE_REPLICATION Table_map_log_event(const char *buf, uint event_len, @@ -3305,7 +3303,7 @@ public: table_def *create_table_def() { return new table_def(m_coltype, m_colcnt, m_field_metadata, - m_field_metadata_size, m_null_bits); + m_field_metadata_size, m_null_bits, m_flags); } ulong get_table_id() const { return m_table_id; } const char *get_table_name() const { return m_tblnam; } diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 9d26c133279..6d30a8bc99f 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -510,6 +510,9 @@ void show_sql_type(enum_field_types type, uint16 metadata, String *str) /** Check the order variable and print errors if the order is not acceptable according to the current settings. + + @param order The computed order of the conversion needed. + @param rli The relay log info data structure: for error reporting. */ bool is_conversion_ok(int order, Relay_log_info *rli) { @@ -562,6 +565,7 @@ bool is_conversion_ok(int order, Relay_log_info *rli) @param[in] type Source field type @param[in] metadata Source field metadata @param[in] rli Relay log info (for error reporting) + @param[in] mflags Flags from the table map event @param[out] order Order between source field and target field @return @c true if conversion is possible according to the current @@ -571,7 +575,8 @@ bool is_conversion_ok(int order, Relay_log_info *rli) static bool can_convert_field_to(Field *field, enum_field_types source_type, uint16 metadata, - Relay_log_info *rli, int *order_var) + Relay_log_info *rli, uint16 mflags, + int *order_var) { DBUG_ENTER("can_convert_field_to"); #ifndef DBUG_OFF @@ -588,7 +593,7 @@ can_convert_field_to(Field *field, if (field->real_type() == source_type) { DBUG_PRINT("debug", ("Base types are identical, doing field size comparison")); - if (field->compatible_field_size(metadata, rli, order_var)) + if (field->compatible_field_size(metadata, rli, mflags, order_var)) DBUG_RETURN(is_conversion_ok(*order_var, rli)); else DBUG_RETURN(false); @@ -765,7 +770,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, { Field *const field= table->field[col]; int order; - if (can_convert_field_to(field, type(col), field_metadata(col), rli, &order)) + if (can_convert_field_to(field, type(col), field_metadata(col), rli, m_flags, &order)) { DBUG_PRINT("debug", ("Checking column %d -" " field '%s' can be converted - order: %d", @@ -937,9 +942,10 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * table_def::table_def(unsigned char *types, ulong size, uchar *field_metadata, int metadata_size, - uchar *null_bitmap) + uchar *null_bitmap, uint16 flags) : m_size(size), m_type(0), m_field_metadata_size(metadata_size), - m_field_metadata(0), m_null_bits(0), m_memory(NULL) + m_field_metadata(0), m_null_bits(0), m_flags(flags), + m_memory(NULL) { m_memory= (uchar *)my_multi_malloc(MYF(MY_WME), &m_type, size, diff --git a/sql/rpl_utility.h b/sql/rpl_utility.h index 97ee668c82d..4b9bf3be93f 100644 --- a/sql/rpl_utility.h +++ b/sql/rpl_utility.h @@ -33,12 +33,6 @@ class Relay_log_info; - Extract and decode table definition data from the table map event - Check if table definition in table map is compatible with table definition on slave - - Currently, the only field type data available is an array of the - type operators that are present in the table map event. - - @todo Add type operands to this structure to allow detection of - difference between, e.g., BIT(5) and BIT(10). */ class table_def @@ -54,7 +48,7 @@ public: @param null_bitmap The bitmap of fields that can be null */ table_def(unsigned char *types, ulong size, uchar *field_metadata, - int metadata_size, uchar *null_bitmap); + int metadata_size, uchar *null_bitmap, uint16 flags); ~table_def(); @@ -215,6 +209,7 @@ private: uint m_field_metadata_size; uint16 *m_field_metadata; uchar *m_null_bits; + uint16 m_flags; // Table flags uchar *m_memory; }; From f63a9d69b912983e477ff614a264c1aa99ea4b99 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Tue, 15 Dec 2009 23:13:31 +0100 Subject: [PATCH 26/69] WL#5151: Conversion between different types when replicating Fixing error codes that changed after merge. --- .../suite/rpl/r/rpl_extraCol_innodb.result | 32 +++++++++---------- .../rpl/r/rpl_extraColmaster_innodb.result | 24 +++++++------- .../rpl/r/rpl_row_tabledefs_3innodb.result | 12 +++---- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result index 657cc05b894..a9b8c2de107 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result @@ -76,7 +76,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -94,7 +94,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -145,7 +145,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -163,7 +163,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -209,7 +209,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -227,7 +227,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -273,7 +273,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -291,7 +291,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -336,7 +336,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -354,7 +354,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -474,7 +474,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Skip_Counter 0 Exec_Master_Log_Pos # @@ -492,7 +492,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -537,7 +537,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -555,7 +555,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -931,7 +931,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -949,7 +949,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Replicate_Ignore_Server_Ids Master_Server_Id 1 diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result index 23053267d77..25fb6f03832 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result @@ -567,7 +567,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -585,7 +585,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -644,7 +644,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -662,7 +662,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -1722,7 +1722,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -1740,7 +1740,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -1799,7 +1799,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -1817,7 +1817,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -2877,7 +2877,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -2895,7 +2895,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -2954,7 +2954,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -2972,7 +2972,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result index 428a2f12c46..5f0d2be9149 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result @@ -180,7 +180,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -198,7 +198,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -225,7 +225,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -243,7 +243,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -270,7 +270,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -288,7 +288,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 From 74577209ac292807550ee0c57f94a9db320941dc Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 16 Dec 2009 09:32:58 +0100 Subject: [PATCH 27/69] WL#5151: Conversion between different types when replicating Fixes to get it to compile on MacOSX. --- sql/field.cc | 9 +++++---- sql/rpl_utility.cc | 20 +++++++++----------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 477cdc0a993..1fa4b698e72 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -999,18 +999,19 @@ test_if_important_data(CHARSET_INFO *cs, const char *str, const char *strend) /** - Template function to compare two objects. + Function to compare two unsigned integers for their relative order. + Used below. In an anonymous namespace to not clash with definitions + in other files. */ namespace { - template - int compare(A_type a, B_type b) + int compare(unsigned int a, unsigned int b) { if (a < b) return -1; if (b < a) return 1; return 0; - } +} } /** diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 6d30a8bc99f..3a69c71b34c 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -19,18 +19,16 @@ #include "rpl_rli.h" /** - Template function to compare two objects. + Function to compare two size_t integers for their relative + order. Used below. */ -namespace { - template - int compare(Type a, Type b) - { - if (a < b) - return -1; - if (b < a) - return 1; - return 0; - } +int compare(size_t a, size_t b) +{ + if (a < b) + return -1; + if (b < a) + return 1; + return 0; } From 821ff8501ca6820a4acbe550ed511290dffeb2a6 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 16 Dec 2009 13:28:47 +0100 Subject: [PATCH 28/69] WL#5151: Conversion between different types when replicating Fixes to make mysqlbinlog work correctly and updates to rpl_ndb result files. sql/log_event.cc: The processing of the MYSQL_STRING_TYPE is now done in table_def::type(), so the support functions for mysqlbinlog are changed to work correctly. --- mysql-test/r/mysqlbinlog_row_innodb.result | 40 +++++------ mysql-test/r/mysqlbinlog_row_myisam.result | 8 +-- .../suite/rpl_ndb/r/rpl_ndb_extraCol.result | 69 ++++++++++--------- .../suite/rpl_ndb/r/rpl_row_basic_7ndb.result | 12 ++-- sql/log_event.cc | 64 +++++++++-------- 5 files changed, 99 insertions(+), 94 deletions(-) diff --git a/mysql-test/r/mysqlbinlog_row_innodb.result b/mysql-test/r/mysqlbinlog_row_innodb.result index 86f0b67ebb3..f11cc3221ad 100644 --- a/mysql-test/r/mysqlbinlog_row_innodb.result +++ b/mysql-test/r/mysqlbinlog_row_innodb.result @@ -2365,7 +2365,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test.t1 ### SET -### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -2458,7 +2458,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test.t1 ### SET -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -2553,7 +2553,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F ### INSERT INTO test.t1 ### SET -### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */ +### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */ ### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */ ### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */ ### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */ @@ -2580,7 +2580,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ @@ -2634,7 +2634,7 @@ BEGIN ### @79=3 /* INT meta=0 nullable=1 is_null=0 */ ### INSERT INTO test.t1 ### SET -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -2727,7 +2727,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F ### UPDATE test.t1 ### WHERE -### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -2807,7 +2807,7 @@ BEGIN ### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */ ### @79=1 /* INT meta=0 nullable=1 is_null=0 */ ### SET -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -2900,7 +2900,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F ### UPDATE test.t1 ### WHERE -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -2980,7 +2980,7 @@ BEGIN ### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */ ### @79=2 /* INT meta=0 nullable=1 is_null=0 */ ### SET -### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -3073,7 +3073,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F ### UPDATE test.t1 ### WHERE -### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */ +### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */ ### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */ ### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */ ### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */ @@ -3100,7 +3100,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ @@ -3153,7 +3153,7 @@ BEGIN ### @78=NULL /* TIMESTAMP meta=63489 nullable=1 is_null=1 */ ### @79=3 /* INT meta=0 nullable=1 is_null=0 */ ### SET -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -3246,7 +3246,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F ### UPDATE test.t1 ### WHERE -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -3326,7 +3326,7 @@ BEGIN ### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */ ### @79=4 /* INT meta=0 nullable=1 is_null=0 */ ### SET -### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */ +### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */ ### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */ ### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */ ### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */ @@ -3353,7 +3353,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ @@ -3419,7 +3419,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F ### DELETE FROM test.t1 ### WHERE -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -3512,7 +3512,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F ### DELETE FROM test.t1 ### WHERE -### @1=b'00000000' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'0000000000000000000000000000000000000000000000000000000000000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -3605,7 +3605,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F ### DELETE FROM test.t1 ### WHERE -### @1=b'00000001' /* BIT(8) meta=256 nullable=1 is_null=0 */ +### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */ ### @2=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */ ### @3=127 /* TINYINT meta=0 nullable=1 is_null=0 */ ### @4=0 /* TINYINT meta=0 nullable=1 is_null=0 */ @@ -3698,7 +3698,7 @@ BEGIN #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F ### DELETE FROM test.t1 ### WHERE -### @1=NULL /* type=16 meta=256 nullable=1 is_null=1 */ +### @1=NULL /* type=16 meta=1 nullable=1 is_null=1 */ ### @2=NULL /* type=16 meta=2048 nullable=1 is_null=1 */ ### @3=NULL /* type=1 meta=0 nullable=1 is_null=1 */ ### @4=NULL /* type=1 meta=0 nullable=1 is_null=1 */ @@ -3725,7 +3725,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ diff --git a/mysql-test/r/mysqlbinlog_row_myisam.result b/mysql-test/r/mysqlbinlog_row_myisam.result index b9366d941f8..4d1050af916 100644 --- a/mysql-test/r/mysqlbinlog_row_myisam.result +++ b/mysql-test/r/mysqlbinlog_row_myisam.result @@ -2584,7 +2584,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ @@ -3110,7 +3110,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ @@ -3365,7 +3365,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ @@ -3745,7 +3745,7 @@ BEGIN ### @25=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @26=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ ### @27=NULL /* type=246 meta=2560 nullable=1 is_null=1 */ -### @28=NULL /* type=10 meta=0 nullable=1 is_null=1 */ +### @28=NULL /* type=14 meta=0 nullable=1 is_null=1 */ ### @29=NULL /* type=12 meta=0 nullable=1 is_null=1 */ ### @30=1000000000 /* TIMESTAMP meta=0 nullable=0 is_null=0 */ ### @31=NULL /* TIMESTAMP meta=0 nullable=1 is_null=1 */ diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index f812509de6f..9d37636446e 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -9,6 +9,8 @@ call mtr.add_suppression("Slave: Unknown table 't6' Error_code: 1051"); *** On Slave *** STOP SLAVE; RESET SLAVE; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; CREATE TABLE t1 (a INT, b INT PRIMARY KEY, c CHAR(20), d FLOAT DEFAULT '2.00', e CHAR(4) DEFAULT 'TEST') @@ -32,6 +34,7 @@ a b c d e 1 2 TEXAS NULL NULL 2 1 AUSTIN NULL NULL 3 4 QA NULL NULL +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; *** Drop t1 *** DROP TABLE t1; *** Create t2 on slave *** @@ -73,8 +76,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_Errno 1641 +Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -91,8 +94,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size. +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' STOP SLAVE; RESET SLAVE; SELECT * FROM t2 ORDER BY a; @@ -140,8 +143,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -158,8 +161,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t3 *** @@ -202,8 +205,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -220,8 +223,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t4 *** @@ -264,8 +267,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +Last_Errno 1641 +Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -282,8 +285,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246 +Last_SQL_Errno 1641 +Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t5 *** @@ -325,8 +328,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_Errno 1641 +Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -343,8 +346,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3 +Last_SQL_Errno 1641 +Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3; *** Drop t6 *** DROP TABLE t6; @@ -493,8 +496,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -511,8 +514,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t10 *** @@ -520,7 +523,7 @@ DROP TABLE t10; *** Create t11 on slave *** STOP SLAVE; RESET SLAVE; -CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT, +CREATE TABLE t11 (a INT KEY, b BLOB, f INT, c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='NDB'; *** Create t11 on Master *** CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254) @@ -554,8 +557,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +Last_Errno 1641 +Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -572,8 +575,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252 +Last_SQL_Errno 1641 +Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; *** Drop t11 *** @@ -944,8 +947,8 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1535 -Last_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +Last_Errno 1641 +Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Skip_Counter 0 Exec_Master_Log_Pos # Relay_Log_Space # @@ -962,8 +965,8 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1535 -Last_SQL_Error Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2 +Last_SQL_Errno 1641 +Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** diff --git a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result index 409397cb3d1..603bb61e2d5 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_row_basic_7ndb.result @@ -476,6 +476,8 @@ ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL; CREATE TABLE t7 (i INT NOT NULL, c CHAR(255) CHARACTER SET utf8 NOT NULL, j INT NOT NULL) ENGINE = 'NDB' ; +SET @saved_slave_type_conversions = @@slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY'; [expecting slave to replicate correctly] INSERT INTO t1 VALUES (1, "", 1); INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2); @@ -484,11 +486,7 @@ Comparing tables master:test.t1 and slave:test.t1 INSERT INTO t2 VALUES (1, "", 1); INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2); Comparing tables master:test.t2 and slave:test.t2 -[expecting slave to stop] -INSERT INTO t3 VALUES (1, "", 1); -INSERT INTO t3 VALUES (2, repeat(_utf8'a', 128), 2); -Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 384, test.t3 on slave has size 49. Master's column size should be <= the slave's column size. +SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions; RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -501,7 +499,7 @@ Comparing tables master:test.t4 and slave:test.t4 INSERT INTO t5 VALUES (1, "", 1); INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t5 on slave has size 49. Master's column size should be <= the slave's column size. +Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)' RESET MASTER; STOP SLAVE; RESET SLAVE; @@ -510,7 +508,7 @@ START SLAVE; INSERT INTO t6 VALUES (1, "", 1); INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2); Last_SQL_Error -Table definition on master and slave does not match: Column 1 size mismatch - master has size 765, test.t6 on slave has size 385. Master's column size should be <= the slave's column size. +Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)' RESET MASTER; STOP SLAVE; RESET SLAVE; diff --git a/sql/log_event.cc b/sql/log_event.cc index 513fb7fe7e8..2a91591090c 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1570,37 +1570,14 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr, /* a long CHAR() field: see #37426 */ length= byte1 | (((byte0 & 0x30) ^ 0x30) << 4); type= byte0 | 0x30; - goto beg; - } - - switch (byte0) - { - case MYSQL_TYPE_SET: - case MYSQL_TYPE_ENUM: - case MYSQL_TYPE_STRING: - type= byte0; - length= byte1; - break; - - default: - - { - char tmp[5]; - my_snprintf(tmp, sizeof(tmp), "%04X", meta); - my_b_printf(file, - "!! Don't know how to handle column type=%d meta=%d (%s)", - type, meta, tmp); - return 0; - } } + else + length = meta & 0xFF; } else length= meta; } - -beg: - switch (type) { case MYSQL_TYPE_LONG: { @@ -1737,6 +1714,33 @@ beg: return 3; } + case MYSQL_TYPE_NEWDATE: + { + uint32 tmp= uint3korr(ptr); + int part; + char buf[10]; + char *pos= &buf[10]; + + /* Copied from field.cc */ + *pos--=0; // End NULL + part=(int) (tmp & 31); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= ':'; + part=(int) (tmp >> 5 & 15); + *pos--= (char) ('0'+part%10); + *pos--= (char) ('0'+part/10); + *pos--= ':'; + part=(int) (tmp >> 9); + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos--= (char) ('0'+part%10); part/=10; + *pos= (char) ('0'+part); + my_b_printf(file , "'%s'", buf); + my_snprintf(typestr, typestr_length, "DATE"); + return 3; + } + case MYSQL_TYPE_DATE: { uint i32= uint3korr(ptr); @@ -1755,7 +1759,7 @@ beg: } case MYSQL_TYPE_ENUM: - switch (length) { + switch (meta & 0xFF) { case 1: my_b_printf(file, "%d", (int) *ptr); my_snprintf(typestr, typestr_length, "ENUM(1 byte)"); @@ -1768,15 +1772,15 @@ beg: return 2; } default: - my_b_printf(file, "!! Unknown ENUM packlen=%d", length); + my_b_printf(file, "!! Unknown ENUM packlen=%d", meta & 0xFF); return 0; } break; case MYSQL_TYPE_SET: - my_b_write_bit(file, ptr , length * 8); - my_snprintf(typestr, typestr_length, "SET(%d bytes)", length); - return length; + my_b_write_bit(file, ptr , (meta & 0xFF) * 8); + my_snprintf(typestr, typestr_length, "SET(%d bytes)", meta & 0xFF); + return meta & 0xFF; case MYSQL_TYPE_BLOB: switch (meta) { From 25ecb311168dba7cdb5a07713743d5baf595a93c Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 16 Dec 2009 14:30:41 +0100 Subject: [PATCH 29/69] WL#5151: Conversion between different types when replicating Post-merge fixes to update result files. --- .../suite/rpl/r/rpl_extraCol_myisam.result | 32 ++++++------ .../rpl/r/rpl_extraColmaster_myisam.result | 24 ++++----- mysql-test/suite/rpl/r/rpl_row_colSize.result | 52 +++++++++---------- .../rpl/r/rpl_row_tabledefs_2myisam.result | 12 ++--- 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result index b495c43ae53..4075d31c915 100644 --- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result @@ -76,7 +76,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -94,7 +94,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -145,7 +145,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -163,7 +163,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -209,7 +209,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -227,7 +227,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -273,7 +273,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -291,7 +291,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -336,7 +336,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -354,7 +354,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -474,7 +474,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Skip_Counter 0 Exec_Master_Log_Pos # @@ -492,7 +492,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -537,7 +537,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -555,7 +555,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -931,7 +931,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -949,7 +949,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Replicate_Ignore_Server_Ids Master_Server_Id 1 diff --git a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result index fee0d745b2d..63f1e49239e 100644 --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result @@ -567,7 +567,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -585,7 +585,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -644,7 +644,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -662,7 +662,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -1722,7 +1722,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -1740,7 +1740,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -1799,7 +1799,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -1817,7 +1817,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -2877,7 +2877,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -2895,7 +2895,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -2954,7 +2954,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -2972,7 +2972,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)' Replicate_Ignore_Server_Ids Master_Server_Id 1 diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result index f735ac9b71f..fd9d9f76ec9 100644 --- a/mysql-test/suite/rpl/r/rpl_row_colSize.result +++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result @@ -37,7 +37,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -55,7 +55,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -93,7 +93,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -111,7 +111,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -149,7 +149,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -167,7 +167,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -206,7 +206,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float' Skip_Counter 0 Exec_Master_Log_Pos # @@ -224,7 +224,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -263,7 +263,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -281,7 +281,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -319,7 +319,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -337,7 +337,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -376,7 +376,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')' Skip_Counter 0 Exec_Master_Log_Pos # @@ -394,7 +394,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -433,7 +433,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -451,7 +451,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -521,7 +521,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')' Skip_Counter 0 Exec_Master_Log_Pos # @@ -539,7 +539,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -578,7 +578,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -596,7 +596,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -634,7 +634,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -652,7 +652,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -690,7 +690,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -708,7 +708,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -747,7 +747,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob' Skip_Counter 0 Exec_Master_Log_Pos # @@ -765,7 +765,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob' Replicate_Ignore_Server_Ids Master_Server_Id 1 diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result index 3e94789422e..99d2154f364 100644 --- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result +++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result @@ -180,7 +180,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -198,7 +198,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -225,7 +225,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -243,7 +243,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -270,7 +270,7 @@ Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Skip_Counter 0 Exec_Master_Log_Pos # @@ -288,7 +288,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno Last_IO_Error -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id 1 From 9db8801077b88d00de920788c343685b7a523c8d Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Fri, 18 Dec 2009 02:54:54 +0000 Subject: [PATCH 30/69] BUG#49259: Slave I/O thread could not register on master The slave thread changed the format of the information it used to connect to the master after patch for BUG 13963. This resulted in old master getting confused, thence rejecting the slave connection attempt. In particular, patch for BUG 13963 removed the rpl_recovery_rank variable which was, at that time, packed together with the rest of the information which the slave would use to register itself on the master. Based on this data, the master would then assert that the number of bytes received in the connection command was consistent to what it was expecting. Therefore, given that a slave, patched with the aforementioned patch, would not pack the four bytes related to the rpl_recovery_rank variable, the old master would reject the connection attempt. It would assume that the data was inconsistent (fewer bytes than it was expecting) and return an error. We fix this by faking an rpl_recovery_rank variable when registering the slave on the master. In practice this reverts a small part of patch for BUG 13963, the one related to the slave connecting to the master. sql/repl_failsafe.cc: Added bypassing of removed rpl_recovery_rank variable information in packet. This should also make more sense when old servers connect to a new master (ie, master with patch for BUG 13963). If this was not done, the new master could interpert information an old slave sends as master_id, when in fact it could be the rpl_recovery_rank data. sql/slave.cc: Faking a rpl_recovery_rank so that we can register as a slave in an old master. --- sql/repl_failsafe.cc | 11 +++++++++-- sql/slave.cc | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index cbc22406460..544063bf337 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -183,11 +183,18 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) get_object(p,si->host, "Failed to register slave: too long 'report-host'"); get_object(p,si->user, "Failed to register slave: too long 'report-user'"); get_object(p,si->password, "Failed to register slave; too long 'report-password'"); - /*6 is the total length of port and master_id*/ - if (p+6 != p_end) + if (p+10 > p_end) goto err; si->port= uint2korr(p); p += 2; + /* + We need to by pass the bytes used in the fake rpl_recovery_rank + variable. It was removed in patch for BUG#13963. But this would + make a server with that patch unable to connect to an old master. + See: BUG#49259 + */ + // si->rpl_recovery_rank= uint4korr(p); + p += 4; if (!(si->master_id= uint4korr(p))) si->master_id= server_id; si->thd= thd; diff --git a/sql/slave.cc b/sql/slave.cc index c58d9738950..a5675fc8b06 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1612,6 +1612,12 @@ int register_slave_on_master(MYSQL* mysql, Master_info *mi, pos= net_store_data(pos, (uchar*) report_user, report_user_len); pos= net_store_data(pos, (uchar*) report_password, report_password_len); int2store(pos, (uint16) report_port); pos+= 2; + /* + Fake rpl_recovery_rank, which was removed in BUG#13963, + so that this server can register itself on old servers, + see BUG#49259. + */ + int4store(pos, /* rpl_recovery_rank */ 0); pos+= 4; /* The master will fill in master_id */ int4store(pos, 0); pos+= 4; From e4de9401d647a6653dd74c02594ab1f76dee9292 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Fri, 18 Dec 2009 11:12:27 +0100 Subject: [PATCH 31/69] WL#5151: Conversion between different types when replicating The function create_virtual_tmp_table does not set db_low_byte_first in the same way as create_tmp_table does, causing copying from the virtual table to a real table to get strange values for SET types on big-endian machines. mysql-test/extra/rpl_tests/type_conversions.test: Adding tests for converting between different-sized sets. sql/sql_select.cc: Settng dh_low_byte_first for tables created with create_virtual_tmp_table. --- .../extra/rpl_tests/type_conversions.test | 28 +++++++++++++++++++ mysql-test/suite/rpl/r/rpl_typeconv.result | 16 +++++++++++ sql/sql_select.cc | 1 + 3 files changed, 45 insertions(+) diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test index 2be1f6c0bec..6e52da59201 100644 --- a/mysql-test/extra/rpl_tests/type_conversions.test +++ b/mysql-test/extra/rpl_tests/type_conversions.test @@ -75,6 +75,34 @@ let $target_value = 'master,slave'; let $can_convert = 1; source extra/rpl_tests/check_type.inc; +let $source_type = SET('0','1','2','3','4','5','6'); +let $target_type = SET('0','1','2','3','4','5','6'); +let $source_value = '5'; +let $target_value = '5'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type = SET('0','1','2','3','4','5','6'); +let $target_type = SET('0','1','2','3','4','5','6','7','8','9','10'); +let $source_value = '5'; +let $target_value = '5'; +let $can_convert = $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10'); +let $target_type = SET('0','1','2','3','4','5','6'); +let $source_value = '5'; +let $target_value = '5'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type = SET('0','1','2','3','4','5','6','7','8','9','10'); +let $target_type = SET('0','1','2','3','4','5','6'); +let $source_value = '7'; +let $target_value = ''; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + let $source_type = TINYINT; let $target_type = TINYINT; let $source_value = 1; diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result index 716956cf2cf..90451759406 100644 --- a/mysql-test/suite/rpl/r/rpl_typeconv.result +++ b/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -78,6 +78,10 @@ ENUM('master',' CHAR(10) SET('master','s CHAR(10) SET('master','s SET('master','s SET('master','s SET('master','s +SET('0','1','2' SET('0','1','2' +SET('0','1','2' SET('0','1','2' +SET('0','1','2' SET('0','1','2' +SET('0','1','2' SET('0','1','2' TINYINT TINYINT TINYINT SMALLINT TINYINT MEDIUMINT @@ -176,6 +180,10 @@ ENUM('master',' CHAR(10) ALL_NON_LOSSY SET('master','s CHAR(10) ALL_NON_LOSSY SET('master','s SET('master','s ALL_NON_LOSSY SET('master','s SET('master','s ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_NON_LOSSY TINYINT TINYINT ALL_NON_LOSSY TINYINT SMALLINT ALL_NON_LOSSY TINYINT MEDIUMINT ALL_NON_LOSSY @@ -274,6 +282,10 @@ ENUM('master',' CHAR(10) ALL_LOSSY SET('master','s CHAR(10) ALL_LOSSY SET('master','s SET('master','s ALL_LOSSY SET('master','s SET('master','s ALL_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY TINYINT TINYINT ALL_LOSSY TINYINT SMALLINT ALL_LOSSY TINYINT MEDIUMINT ALL_LOSSY @@ -372,6 +384,10 @@ ENUM('master',' CHAR(10) ALL_LOSSY,ALL_NON_LOSSY SET('master','s CHAR(10) ALL_LOSSY,ALL_NON_LOSSY SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY SET('master','s SET('master','s ALL_LOSSY,ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY +SET('0','1','2' SET('0','1','2' ALL_LOSSY,ALL_NON_LOSSY TINYINT TINYINT ALL_LOSSY,ALL_NON_LOSSY TINYINT SMALLINT ALL_LOSSY,ALL_NON_LOSSY TINYINT MEDIUMINT ALL_LOSSY,ALL_NON_LOSSY diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 3e57d384192..ef055202eae 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -10398,6 +10398,7 @@ TABLE *create_virtual_tmp_table(THD *thd, List &field_list) share->blob_field= blob_field; share->fields= field_count; share->blob_ptr_size= portable_sizeof_char_ptr; + share->db_low_byte_first=1; // True for HEAP and MyISAM setup_tmp_table_column_bitmaps(table, bitmaps); /* Create all fields and calculate the total length of record */ From 242038c61f223eed54bb2212546bcabffe7c7ba3 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Fri, 18 Dec 2009 11:15:56 +0100 Subject: [PATCH 32/69] WL#5151: Conversion between different types when replicating Post-merge fixes. Updating result files. --- .../suite/rpl_ndb/r/rpl_ndb_extraCol.result | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result index e08d21b4dcb..1887be44c0c 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result @@ -76,7 +76,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -94,7 +94,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -145,7 +145,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -163,7 +163,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -209,7 +209,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -227,7 +227,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -273,7 +273,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -291,7 +291,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -336,7 +336,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -354,7 +354,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -450,7 +450,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Skip_Counter 0 Exec_Master_Log_Pos # @@ -468,7 +468,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -513,7 +513,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -531,7 +531,7 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)' Replicate_Ignore_Server_Ids Master_Server_Id 1 @@ -907,7 +907,7 @@ Replicate_Do_Table Replicate_Ignore_Table # Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table -Last_Errno 1641 +Last_Errno 1642 Last_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' Skip_Counter 0 Exec_Master_Log_Pos # @@ -925,8 +925,10 @@ Seconds_Behind_Master # Master_SSL_Verify_Server_Cert No Last_IO_Errno # Last_IO_Error # -Last_SQL_Errno 1641 +Last_SQL_Errno 1642 Last_SQL_Error Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)' +Replicate_Ignore_Server_Ids +Master_Server_Id 1 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2; START SLAVE; ** DROP table t17 *** From 03324f6a0a177d5e31f58533ab773970f2b2f747 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Mon, 21 Dec 2009 06:18:11 +0000 Subject: [PATCH 33/69] Post-merge fix. --- mysql-test/suite/rpl/t/rpl_timezone.test | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mysql-test/suite/rpl/t/rpl_timezone.test b/mysql-test/suite/rpl/t/rpl_timezone.test index 40a2a4444b9..2c4eea4f31b 100644 --- a/mysql-test/suite/rpl/t/rpl_timezone.test +++ b/mysql-test/suite/rpl/t/rpl_timezone.test @@ -13,6 +13,10 @@ # timezone used in CONVERT_TZ is not binlogged. To debug (by Guilhem # and possibly Konstantin). +--disable_query_log +CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +--enable_query_log + --disable_ps_protocol source include/master-slave.inc; From 060e3ae739e758920e24e3166f77e565c0329bee Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Mon, 21 Dec 2009 19:50:25 +0100 Subject: [PATCH 34/69] WL#5151: Conversion between different types when replicating Bug#49836 reports that the geometry type does not work with WL#5151 applied. The GEOMETRY type inherits the blob comparison function, which read the pack length from the metadata. The GEOMETRY type does not fill in the metadata with anything sensible, so it is always zero, meaning that the pack length for the source type is considered zero, rendering it always "smaller" than the target type which has pack length 4 (without pointer). This patch fixes the problem by defining Field_geom::pack_length_from_metadata() to always use the same as Field_geom::row_pack_length(). --- mysql-test/extra/rpl_tests/type_conversions.test | 7 +++++++ mysql-test/suite/rpl/r/rpl_typeconv.result | 4 ++++ sql/field.h | 4 ++++ 3 files changed, 15 insertions(+) diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test index 6e52da59201..791e07c4822 100644 --- a/mysql-test/extra/rpl_tests/type_conversions.test +++ b/mysql-test/extra/rpl_tests/type_conversions.test @@ -12,6 +12,13 @@ connection slave; let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; +let $source_type = GEOMETRY; +let $target_type = GEOMETRY; +let $source_value = PointFromText('POINT(10 10)'); +let $target_value = PointFromText('POINT(10 10)'); +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + let $source_type = BIT(1); let $target_type = BIT(1); let $source_value = b'1'; diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result index 90451759406..34ec81973ae 100644 --- a/mysql-test/suite/rpl/r/rpl_typeconv.result +++ b/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -69,6 +69,7 @@ RESET MASTER; include/start_slave.inc **** Result of conversions **** Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave +GEOMETRY GEOMETRY BIT(1) BIT(1) DATE DATE ENUM('master',' ENUM('master',' @@ -171,6 +172,7 @@ BIT(5) BIT(6) BIT(6) BIT(5) BIT(5) BIT(12) BIT(12) BIT(5) +GEOMETRY GEOMETRY ALL_NON_LOSSY BIT(1) BIT(1) ALL_NON_LOSSY DATE DATE ALL_NON_LOSSY ENUM('master',' ENUM('master',' ALL_NON_LOSSY @@ -273,6 +275,7 @@ BIT(5) BIT(6) ALL_NON_LOSSY BIT(6) BIT(5) ALL_NON_LOSSY BIT(5) BIT(12) ALL_NON_LOSSY BIT(12) BIT(5) ALL_NON_LOSSY +GEOMETRY GEOMETRY ALL_LOSSY BIT(1) BIT(1) ALL_LOSSY DATE DATE ALL_LOSSY ENUM('master',' ENUM('master',' ALL_LOSSY @@ -375,6 +378,7 @@ BIT(5) BIT(6) ALL_LOSSY BIT(6) BIT(5) ALL_LOSSY BIT(5) BIT(12) ALL_LOSSY BIT(12) BIT(5) ALL_LOSSY +GEOMETRY GEOMETRY ALL_LOSSY,ALL_NON_LOSSY BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY DATE DATE ALL_LOSSY,ALL_NON_LOSSY ENUM('master',' ENUM('master',' ALL_LOSSY,ALL_NON_LOSSY diff --git a/sql/field.h b/sql/field.h index 12ee9b46d03..c6c6f04d925 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1817,6 +1817,10 @@ public: uint size_of() const { return sizeof(*this); } int reset(void) { return !maybe_null() || Field_blob::reset(); } geometry_type get_geometry_type() { return geom_type; }; + uint pack_length_from_metadata(uint field_metadata) + { + return pack_length_no_ptr(); + } }; #endif /*HAVE_SPATIAL*/ From 67cc50d2a36b7b6fbd55cffe02bec413c05365fc Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 22 Dec 2009 11:51:46 +0000 Subject: [PATCH 35/69] PB2 was showing some valgrind warnings after WL#5151 was pushed. This patch fixes these warnings and some compile time warnings. On top of that, it also fixes rpl_err_ignoredtable test failure. This test was failing because the warning suppression text was not matching the latest text. We fix this by making them match. mysql-test/suite/rpl/t/rpl_err_ignoredtable.test: Replaced the suppression text. sql/rpl_record.cc: - Fixed some compile time warnings (replaced %d --> %ld and removed unused mas mask variable. - Fixed valgrind warnings when using c_ptr(). Replaced with c_ptr_safe(). sql/rpl_utility.cc: - Fixed valgrind warnings when using c_ptr(). Replaced with c_ptr_safe(). --- mysql-test/suite/rpl/r/rpl_err_ignoredtable.result | 1 - mysql-test/suite/rpl/t/rpl_err_ignoredtable.test | 4 +++- sql/rpl_record.cc | 7 +++---- sql/rpl_utility.cc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result index 75fefdad2a2..f211d5d9a2f 100644 --- a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result +++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result @@ -4,7 +4,6 @@ reset master; reset slave; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; start slave; -CALL mtr.add_suppression("Statement may not be safe to log in statement format."); create table t1 (a int primary key); create table t4 (a int primary key); insert into t1 values (1),(1); diff --git a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test index f358c0ee356..077daba9a3a 100644 --- a/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test +++ b/mysql-test/suite/rpl/t/rpl_err_ignoredtable.test @@ -7,7 +7,9 @@ -- source include/master-slave.inc -CALL mtr.add_suppression("Statement may not be safe to log in statement format."); +-- disable_query_log +CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT."); +-- enable_query_log connection master; create table t1 (a int primary key); diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index 00f586cfdd8..c2d3ddbc353 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -222,7 +222,7 @@ unpack_row(Relay_log_info const *rli, conv_table ? conv_table->field[field_ptr - begin_ptr] : NULL; Field *const f= conv_field ? conv_field : *field_ptr; - DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%d)", + DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%ld)", conv_field ? "" : "not ", (*field_ptr)->field_name, field_ptr - begin_ptr)); DBUG_ASSERT(f != NULL); @@ -313,7 +313,7 @@ unpack_row(Relay_log_info const *rli, conv_field->val_str(&value_string); DBUG_PRINT("debug", ("Copying field '%s' of type '%s' with value '%s'", (*field_ptr)->field_name, - source_type.c_ptr(), value_string.c_ptr())); + source_type.c_ptr_safe(), value_string.c_ptr_safe())); #endif copy.set(*field_ptr, f, TRUE); (*copy.do_copy)(©); @@ -324,7 +324,7 @@ unpack_row(Relay_log_info const *rli, (*field_ptr)->val_str(&value_string); DBUG_PRINT("debug", ("Value of field '%s' of type '%s' is now '%s'", (*field_ptr)->field_name, - target_type.c_ptr(), value_string.c_ptr())); + target_type.c_ptr_safe(), value_string.c_ptr_safe())); #endif } @@ -419,7 +419,6 @@ int prepare_record(TABLE *const table, */ for (Field **field_ptr= table->field+skip; *field_ptr; ++field_ptr) { - uint32 const mask= NOT_NULL_FLAG | NO_DEFAULT_VALUE_FLAG; Field *const f= *field_ptr; if ((f->flags & NO_DEFAULT_VALUE_FLAG) && (f->real_type() != MYSQL_TYPE_ENUM)) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 3a69c71b34c..e8e22216b38 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -582,7 +582,7 @@ can_convert_field_to(Field *field, String field_type(field_type_buf, sizeof(field_type_buf), field->charset()); field->sql_type(field_type); DBUG_PRINT("enter", ("field_type: %s, target_type: %d, source_type: %d, source_metadata: 0x%x", - field_type.c_ptr(), field->real_type(), source_type, metadata)); + field_type.c_ptr_safe(), field->real_type(), source_type, metadata)); #endif /* If the real type is the same, we need to check the metadata to @@ -836,7 +836,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, DBUG_PRINT("debug", ("Field %s - conversion required." " Source type: '%s', Target type: '%s'", tmp_table->field[col]->field_name, - source_type.c_ptr(), target_type.c_ptr())); + source_type.c_ptr_safe(), target_type.c_ptr_safe())); } } #endif From 444b24eec2021c1bf802be7e037350947b654622 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 22 Dec 2009 12:31:36 +0000 Subject: [PATCH 36/69] Fixing tree_name. --- .bzr-mysql/default.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bzr-mysql/default.conf b/.bzr-mysql/default.conf index d07d0e6178d..e18f1291159 100644 --- a/.bzr-mysql/default.conf +++ b/.bzr-mysql/default.conf @@ -1,4 +1,4 @@ [MYSQL] post_commit_to = "commits@lists.mysql.com" post_push_to = "commits@lists.mysql.com" -tree_name = "mysql-5.1-rep+3" +tree_name = "mysql-5.1-rep+2-delivery1" From 4431827f2a87b0759dd8f2f8bb58a6dd7e6e334c Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Tue, 22 Dec 2009 16:37:21 +0400 Subject: [PATCH 37/69] Bug#46570 test udf fails with valgrind the value obtained by String::c_ptr() method not always has the ending zero. Particularly in this bug the dlsym() expects zero-ending string. The String::c_ptr_safe() is more correct here. per-file comments: sql/item_func.cc Bug#46570 test udf fails with valgrind c_ptr_safe() used for UDF parameters as the library expects zero-ending strings. --- sql/item_func.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 6f14e69e101..c9aaa80d7d0 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2952,7 +2952,7 @@ udf_handler::fix_fields(THD *thd, Item_result_field *func, String *res= arguments[i]->val_str(&buffers[i]); if (arguments[i]->null_value) continue; - f_args.args[i]= (char*) res->c_ptr(); + f_args.args[i]= (char*) res->c_ptr_safe(); f_args.lengths[i]= res->length(); break; } From f87816b450055e9815ced19d47a224bc58e9bfcc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 23 Dec 2009 18:43:45 +0800 Subject: [PATCH 38/69] Bug #47863 binlog_format should be writable only at transaction boundaries When @@session.binlog_format is modified inside a transaction, it can cause slave to go out of sync. To fix the problem, make the session variable 'binlog_format' read-only inside a transaction. mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result: Test result for bug#47863. mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test: Added test file to verify if the session variable 'binlog_format' is read-only inside a transaction and in sub-statements. sql/set_var.cc: Added code to make the session variable 'binlog_format' read-only inside a transaction. --- .../binlog_format_switch_inside_trans.result | 90 +++++++++++++++++ .../t/binlog_format_switch_inside_trans.test | 98 +++++++++++++++++++ sql/set_var.cc | 8 ++ sql/share/errmsg.txt | 2 + 4 files changed, 198 insertions(+) create mode 100644 mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result create mode 100644 mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test diff --git a/mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result b/mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result new file mode 100644 index 00000000000..c1e900053e4 --- /dev/null +++ b/mysql-test/suite/binlog/r/binlog_format_switch_inside_trans.result @@ -0,0 +1,90 @@ +set @save_binlog_format= @@global.binlog_format; +create table t1 (a int) engine= myisam; +create table t2 (a int) engine= innodb; +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +SET AUTOCOMMIT=1; +# Test that the session variable 'binlog_format' +# is writable outside a transaction. +set @@session.binlog_format= statement; +SELECT @@session.binlog_format; +@@session.binlog_format +STATEMENT +begin; +# Test that the session variable 'binlog_format' is read-only +# inside a transaction with no preceding updates. +set @@session.binlog_format= mixed; +ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +insert into t2 values (1); +# Test that the session variable 'binlog_format' is read-only +# inside a transaction with preceding transactional updates. +set @@session.binlog_format= row; +ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +commit; +begin; +insert into t1 values (2); +# Test that the session variable 'binlog_format' is read-only +# inside a transaction with preceding non-transactional updates. +set @@session.binlog_format= statement; +ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +commit; +# Test that the session variable 'binlog_format' is writable +# when AUTOCOMMIT=0, before a transaction has started. +set AUTOCOMMIT=0; +set @@session.binlog_format= row; +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +insert into t1 values (4); +# Test that the session variable 'binlog_format' is read-only inside an +# AUTOCOMMIT=0 transaction with preceding non-transactional updates. +set @@session.binlog_format= statement; +ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +commit; +insert into t2 values (5); +# Test that the session variable 'binlog_format' is read-only inside an +# AUTOCOMMIT=0 transaction with preceding transactional updates. +set @@session.binlog_format= row; +ERROR HY000: Cannot modify @@session.binlog_format inside a transaction +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +commit; +begin; +insert into t2 values (6); +# Test that the global variable 'binlog_format' is writable +# inside a transaction. +SELECT @@global.binlog_format; +@@global.binlog_format +ROW +set @@global.binlog_format= statement; +SELECT @@global.binlog_format; +@@global.binlog_format +STATEMENT +commit; +set @@global.binlog_format= @save_binlog_format; +create table t3(a int, b int) engine= innodb; +create table t4(a int) engine= innodb; +create table t5(a int) engine= innodb; +create trigger tr2 after insert on t3 for each row begin +insert into t4(a) values(1); +set @@session.binlog_format= statement; +insert into t4(a) values(2); +insert into t5(a) values(3); +end | +# Test that the session variable 'binlog_format' is read-only +# in sub-statements. +insert into t3(a,b) values(1,1); +ERROR HY000: Cannot change the binary logging format inside a stored function or trigger +SELECT @@session.binlog_format; +@@session.binlog_format +ROW +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; diff --git a/mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test b/mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test new file mode 100644 index 00000000000..8ae87d13a12 --- /dev/null +++ b/mysql-test/suite/binlog/t/binlog_format_switch_inside_trans.test @@ -0,0 +1,98 @@ +# +# BUG#47863 +# This test verifies if the session variable 'binlog_format' +# is read-only inside a transaction and in sub-statements. +# + +source include/have_innodb.inc; +source include/have_binlog_format_row.inc; + +set @save_binlog_format= @@global.binlog_format; +create table t1 (a int) engine= myisam; +create table t2 (a int) engine= innodb; + +SELECT @@session.binlog_format; +SET AUTOCOMMIT=1; +--echo # Test that the session variable 'binlog_format' +--echo # is writable outside a transaction. +set @@session.binlog_format= statement; +SELECT @@session.binlog_format; + +begin; +--echo # Test that the session variable 'binlog_format' is read-only +--echo # inside a transaction with no preceding updates. +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT + set @@session.binlog_format= mixed; + + insert into t2 values (1); +--echo # Test that the session variable 'binlog_format' is read-only +--echo # inside a transaction with preceding transactional updates. +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT + set @@session.binlog_format= row; +commit; + +begin; + insert into t1 values (2); +--echo # Test that the session variable 'binlog_format' is read-only +--echo # inside a transaction with preceding non-transactional updates. +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT + set @@session.binlog_format= statement; +commit; + +--echo # Test that the session variable 'binlog_format' is writable +--echo # when AUTOCOMMIT=0, before a transaction has started. +set AUTOCOMMIT=0; +set @@session.binlog_format= row; +SELECT @@session.binlog_format; + +insert into t1 values (4); +--echo # Test that the session variable 'binlog_format' is read-only inside an +--echo # AUTOCOMMIT=0 transaction with preceding non-transactional updates. +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT +set @@session.binlog_format= statement; +SELECT @@session.binlog_format; +commit; + +insert into t2 values (5); +--echo # Test that the session variable 'binlog_format' is read-only inside an +--echo # AUTOCOMMIT=0 transaction with preceding transactional updates. +--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT +set @@session.binlog_format= row; +SELECT @@session.binlog_format; +commit; + +begin; + insert into t2 values (6); +--echo # Test that the global variable 'binlog_format' is writable +--echo # inside a transaction. + SELECT @@global.binlog_format; + set @@global.binlog_format= statement; + SELECT @@global.binlog_format; +commit; + +set @@global.binlog_format= @save_binlog_format; + +create table t3(a int, b int) engine= innodb; +create table t4(a int) engine= innodb; +create table t5(a int) engine= innodb; +delimiter |; +eval create trigger tr2 after insert on t3 for each row begin + insert into t4(a) values(1); + set @@session.binlog_format= statement; + insert into t4(a) values(2); + insert into t5(a) values(3); +end | +delimiter ;| + +--echo # Test that the session variable 'binlog_format' is read-only +--echo # in sub-statements. +--error ER_STORED_FUNCTION_PREVENTS_SWITCH_BINLOG_FORMAT +insert into t3(a,b) values(1,1); +SELECT @@session.binlog_format; + +drop table t1; +drop table t2; +drop table t3; +drop table t4; +drop table t5; + diff --git a/sql/set_var.cc b/sql/set_var.cc index 16772fee3c3..b1d1c89cfe6 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1244,6 +1244,14 @@ void fix_slave_exec_mode(enum_var_type type) bool sys_var_thd_binlog_format::check(THD *thd, set_var *var) { + /* + Make the session variable 'binlog_format' read-only inside a transaction. + */ + if (thd->active_transaction() && (var->type == OPT_SESSION)) + { + my_error(ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT, MYF(0)); + return 1; + } /* All variables that affect writing to binary log (either format or turning logging on and off) use the same checking. We call the diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 4262aa82cfa..1ce306bb35e 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6249,3 +6249,5 @@ ER_DEBUG_SYNC_TIMEOUT ER_DEBUG_SYNC_HIT_LIMIT eng "debug sync point hit limit reached" ger "Debug Sync Point Hit Limit erreicht" +ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_BINLOG_FORMAT + eng "Cannot modify @@session.binlog_format inside a transaction" From dcf8e115369c4e97ae092d091365ee07e2f819ed Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 24 Dec 2009 01:07:35 +0000 Subject: [PATCH 39/69] BUG#49836: Replication of geometric fields is broken after WL#5151 Metadata for geometric fields was not being properly stored by the slave in its the table definition. This happened because MYSQL_TYPE_GEOMETRY was not included in the 'switch... case' that handles field metadata according to the field type. Therefore, it would default to 0, leading to always have a mismatch between master's field and slave fields'. We fix this by deploying the missing 'case MYSQL_TYPE_GEOMETRY:'. mysql-test/extra/rpl_tests/type_conversions.test: Added some tests for blob fields and also the particular case for replicating from/into BLOB into/from GEOMETRY. sql/field.h: As requested by Mats, reverted function added by him in changeset: http://lists.mysql.com/commits/95313 --- .../extra/rpl_tests/type_conversions.test | 139 +++++++++++++++++- mysql-test/suite/rpl/r/rpl_typeconv.result | 72 +++++++++ sql/field.h | 4 - sql/rpl_utility.cc | 1 + 4 files changed, 211 insertions(+), 5 deletions(-) diff --git a/mysql-test/extra/rpl_tests/type_conversions.test b/mysql-test/extra/rpl_tests/type_conversions.test index 791e07c4822..731eef8f41e 100644 --- a/mysql-test/extra/rpl_tests/type_conversions.test +++ b/mysql-test/extra/rpl_tests/type_conversions.test @@ -12,6 +12,142 @@ connection slave; let $if_is_lossy = `SELECT FIND_IN_SET('ALL_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; let $if_is_non_lossy = `SELECT FIND_IN_SET('ALL_NON_LOSSY', @@SLAVE_TYPE_CONVERSIONS)`; +# TINYBLOB + +let $source_type = TINYBLOB; +let $target_type = TINYBLOB; +let $source_value = 'aaa'; +let $target_value = 'aaa'; +let $can_convert = 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYBLOB; +let $target_type= BLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYBLOB; +let $target_type= MEDIUMBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= TINYBLOB; +let $target_type= LONGBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +# BLOB + +let $source_type = BLOB; +let $target_type = TINYBLOB; +let $source_value = 'aaa'; +let $target_value = 'aaa'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BLOB; +let $target_type= BLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= BLOB; +let $target_type= MEDIUMBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= BLOB; +let $target_type= LONGBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +# MEDIUMBLOB + +let $source_type = MEDIUMBLOB; +let $target_type = TINYBLOB; +let $source_value = 'aaa'; +let $target_value = 'aaa'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMBLOB; +let $target_type= BLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMBLOB; +let $target_type= MEDIUMBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= 1; +source extra/rpl_tests/check_type.inc; + +let $source_type= MEDIUMBLOB; +let $target_type= LONGBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_non_lossy; +source extra/rpl_tests/check_type.inc; + +# LONGBLOB + +let $source_type = LONGBLOB; +let $target_type = TINYBLOB; +let $source_value = 'aaa'; +let $target_value = 'aaa'; +let $can_convert = $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= LONGBLOB; +let $target_type= BLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= LONGBLOB; +let $target_type= MEDIUMBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= $if_is_lossy; +source extra/rpl_tests/check_type.inc; + +let $source_type= LONGBLOB; +let $target_type= LONGBLOB; +let $source_value= 'aaa'; +let $target_value= 'aaa'; +let $can_convert= 1; +source extra/rpl_tests/check_type.inc; + +# BUG#49836 (additional tests - GEOMETRY TYPE) + +let $source_type = GEOMETRY; +let $target_type = BLOB; +let $source_value = PointFromText('POINT(10 10)'); +let $target_value = PointFromText('POINT(10 10)'); +let $can_convert = 0; +source extra/rpl_tests/check_type.inc; + +let $source_type = BLOB; +let $target_type = GEOMETRY; +let $source_value = 'aaa'; +let $target_value = 'aaa'; +let $can_convert = 0; +source extra/rpl_tests/check_type.inc; + let $source_type = GEOMETRY; let $target_type = GEOMETRY; let $source_value = PointFromText('POINT(10 10)'); @@ -739,7 +875,8 @@ let $target_value= b'11111'; let $can_convert = $if_is_lossy; source extra/rpl_tests/check_type.inc; + disable_warnings; source include/reset_master_and_slave.inc; enable_warnings; -enable_query_log; \ No newline at end of file +enable_query_log; diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result index 34ec81973ae..89096153c14 100644 --- a/mysql-test/suite/rpl/r/rpl_typeconv.result +++ b/mysql-test/suite/rpl/r/rpl_typeconv.result @@ -69,6 +69,24 @@ RESET MASTER; include/start_slave.inc **** Result of conversions **** Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave +TINYBLOB TINYBLOB +TINYBLOB BLOB +TINYBLOB MEDIUMBLOB +TINYBLOB LONGBLOB +BLOB TINYBLOB +BLOB BLOB +BLOB MEDIUMBLOB +BLOB LONGBLOB +MEDIUMBLOB TINYBLOB +MEDIUMBLOB BLOB +MEDIUMBLOB MEDIUMBLOB +MEDIUMBLOB LONGBLOB +LONGBLOB TINYBLOB +LONGBLOB BLOB +LONGBLOB MEDIUMBLOB +LONGBLOB LONGBLOB +GEOMETRY BLOB +BLOB GEOMETRY GEOMETRY GEOMETRY BIT(1) BIT(1) DATE DATE @@ -172,6 +190,24 @@ BIT(5) BIT(6) BIT(6) BIT(5) BIT(5) BIT(12) BIT(12) BIT(5) +TINYBLOB TINYBLOB ALL_NON_LOSSY +TINYBLOB BLOB ALL_NON_LOSSY +TINYBLOB MEDIUMBLOB ALL_NON_LOSSY +TINYBLOB LONGBLOB ALL_NON_LOSSY +BLOB TINYBLOB ALL_NON_LOSSY +BLOB BLOB ALL_NON_LOSSY +BLOB MEDIUMBLOB ALL_NON_LOSSY +BLOB LONGBLOB ALL_NON_LOSSY +MEDIUMBLOB TINYBLOB ALL_NON_LOSSY +MEDIUMBLOB BLOB ALL_NON_LOSSY +MEDIUMBLOB MEDIUMBLOB ALL_NON_LOSSY +MEDIUMBLOB LONGBLOB ALL_NON_LOSSY +LONGBLOB TINYBLOB ALL_NON_LOSSY +LONGBLOB BLOB ALL_NON_LOSSY +LONGBLOB MEDIUMBLOB ALL_NON_LOSSY +LONGBLOB LONGBLOB ALL_NON_LOSSY +GEOMETRY BLOB ALL_NON_LOSSY +BLOB GEOMETRY ALL_NON_LOSSY GEOMETRY GEOMETRY ALL_NON_LOSSY BIT(1) BIT(1) ALL_NON_LOSSY DATE DATE ALL_NON_LOSSY @@ -275,6 +311,24 @@ BIT(5) BIT(6) ALL_NON_LOSSY BIT(6) BIT(5) ALL_NON_LOSSY BIT(5) BIT(12) ALL_NON_LOSSY BIT(12) BIT(5) ALL_NON_LOSSY +TINYBLOB TINYBLOB ALL_LOSSY +TINYBLOB BLOB ALL_LOSSY +TINYBLOB MEDIUMBLOB ALL_LOSSY +TINYBLOB LONGBLOB ALL_LOSSY +BLOB TINYBLOB ALL_LOSSY +BLOB BLOB ALL_LOSSY +BLOB MEDIUMBLOB ALL_LOSSY +BLOB LONGBLOB ALL_LOSSY +MEDIUMBLOB TINYBLOB ALL_LOSSY +MEDIUMBLOB BLOB ALL_LOSSY +MEDIUMBLOB MEDIUMBLOB ALL_LOSSY +MEDIUMBLOB LONGBLOB ALL_LOSSY +LONGBLOB TINYBLOB ALL_LOSSY +LONGBLOB BLOB ALL_LOSSY +LONGBLOB MEDIUMBLOB ALL_LOSSY +LONGBLOB LONGBLOB ALL_LOSSY +GEOMETRY BLOB ALL_LOSSY +BLOB GEOMETRY ALL_LOSSY GEOMETRY GEOMETRY ALL_LOSSY BIT(1) BIT(1) ALL_LOSSY DATE DATE ALL_LOSSY @@ -378,6 +432,24 @@ BIT(5) BIT(6) ALL_LOSSY BIT(6) BIT(5) ALL_LOSSY BIT(5) BIT(12) ALL_LOSSY BIT(12) BIT(5) ALL_LOSSY +TINYBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY +TINYBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY +TINYBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY +TINYBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY +BLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY +BLOB BLOB ALL_LOSSY,ALL_NON_LOSSY +BLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY +BLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY +MEDIUMBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY +MEDIUMBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY +MEDIUMBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY +MEDIUMBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY +LONGBLOB TINYBLOB ALL_LOSSY,ALL_NON_LOSSY +LONGBLOB BLOB ALL_LOSSY,ALL_NON_LOSSY +LONGBLOB MEDIUMBLOB ALL_LOSSY,ALL_NON_LOSSY +LONGBLOB LONGBLOB ALL_LOSSY,ALL_NON_LOSSY +GEOMETRY BLOB ALL_LOSSY,ALL_NON_LOSSY +BLOB GEOMETRY ALL_LOSSY,ALL_NON_LOSSY GEOMETRY GEOMETRY ALL_LOSSY,ALL_NON_LOSSY BIT(1) BIT(1) ALL_LOSSY,ALL_NON_LOSSY DATE DATE ALL_LOSSY,ALL_NON_LOSSY diff --git a/sql/field.h b/sql/field.h index 192f0c8e460..041610f5385 100644 --- a/sql/field.h +++ b/sql/field.h @@ -1817,10 +1817,6 @@ public: uint size_of() const { return sizeof(*this); } int reset(void) { return !maybe_null() || Field_blob::reset(); } geometry_type get_geometry_type() { return geom_type; }; - uint pack_length_from_metadata(uint field_metadata) - { - return pack_length_no_ptr(); - } }; #endif /*HAVE_SPATIAL*/ diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index e8e22216b38..1971077ab65 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -977,6 +977,7 @@ table_def::table_def(unsigned char *types, ulong size, case MYSQL_TYPE_LONG_BLOB: case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_FLOAT: + case MYSQL_TYPE_GEOMETRY: { /* These types store a single byte. From b71d8c00ba2b4245320e120e8847db2df3370aba Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 24 Dec 2009 11:01:39 +0800 Subject: [PATCH 40/69] Enable rpl_get_master_version_and clock and rpl_cross_version as the bug#46931 and bug#43913 have been closed. --- mysql-test/suite/rpl/t/disabled.def | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysql-test/suite/rpl/t/disabled.def b/mysql-test/suite/rpl/t/disabled.def index 446c233c8a9..a5017b1a02c 100644 --- a/mysql-test/suite/rpl/t/disabled.def +++ b/mysql-test/suite/rpl/t/disabled.def @@ -10,7 +10,5 @@ # ############################################################################## -rpl_get_master_version_and_clock: # Bug#46931 2009-10-17 joro rpl.rpl_get_master_version_and_clock fails rpl_row_create_table : Bug#45576 2009-12-01 joro rpl_row_create_table fails on PB2 -rpl_cross_version : BUG#43913 2009-10-22 luis rpl_cross_version fails with symptom in described in bug report rpl_spec_variables : BUG#47661 2009-10-27 jasonh rpl_spec_variables fails on PB2 hpux From c5f7044d1a055752c30043c425d01bc1a32634cd Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 24 Dec 2009 15:55:46 +0000 Subject: [PATCH 41/69] Valgrind warnings that have poped up ever since WL#5151 was pushed. This fixes two more warnings for tests: - rpl_row_colSize - rpl_typeconv --- sql/rpl_utility.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 1971077ab65..3d5b3baad30 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -816,7 +816,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED, ER(ER_SLAVE_CONVERSION_FAILED), col, db_name, tbl_name, - source_type.c_ptr(), target_type.c_ptr()); + source_type.c_ptr_safe(), target_type.c_ptr_safe()); return false; } } From 7e1e21982963086829fe50906350ea9ac8272d4c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 25 Dec 2009 14:12:49 +0800 Subject: [PATCH 42/69] Backport Bug #43913 rpl_cross_version can't pass on conflicts complainig clash with --slave-load-tm The 'rpl_cross_version' fails on mysql-next-mr-bugfixing as following: mysqltest: In included file "./include/setup_fake_relay_log.inc": At line 80: query 'select './$_fake_filename-fake.000001\n' into dumpfile '$_fake_relay_index'' failed: 1290: The MySQL server is running with the --secure-file-priv option so it cannot execute this statement. To fix the problem by removeing the --secure-file-priv option for adapting the update of the 'setup_fake_relay_log.inc'. --- mysql-test/suite/rpl/t/rpl_cross_version-master.opt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt index 0ea05290c11..815a8f81d32 100644 --- a/mysql-test/suite/rpl/t/rpl_cross_version-master.opt +++ b/mysql-test/suite/rpl/t/rpl_cross_version-master.opt @@ -1 +1 @@ ---replicate-same-server-id --relay-log=slave-relay-bin --secure-file-priv=$MYSQL_TMP_DIR +--replicate-same-server-id --relay-log=slave-relay-bin From 305f2e7f8a368cb1f04b75e3953a727f7c67e5ad Mon Sep 17 00:00:00 2001 From: Jorgen Loland Date: Mon, 4 Jan 2010 10:39:42 +0100 Subject: [PATCH 43/69] Bug#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery in the select list When a dependent subquery with count(distinct ) was evaluated multiple times, the Distinct_Aggregator was reused. However, the Aggregator was not reset, so when the subquery was evaluated for the next record in the outer select, old dependent info was used. The fix is to clear() the existing aggregator in Item_sum::set_aggregator(). This ensures that the aggregator is reevaluated with the new dependent information. mysql-test/r/subselect3.result: Added test case for BUG#48920 mysql-test/t/subselect3.test: Added test case for BUG#48920 sql/item_sum.cc: If an aggregator exists when Item_sum::set_aggregator() is called (i.e., set_aggregator is called in a dependent subquery), the aggregator is reset so that the aggregator is reevaluated with the dependent information from the outer record being evaluated. --- mysql-test/r/subselect3.result | 50 ++++++++++++++++++++++++++++++++++ mysql-test/t/subselect3.test | 47 ++++++++++++++++++++++++++++++++ sql/item_sum.cc | 7 +++++ 3 files changed, 104 insertions(+) diff --git a/mysql-test/r/subselect3.result b/mysql-test/r/subselect3.result index 3a0576768b2..a51cef6833d 100644 --- a/mysql-test/r/subselect3.result +++ b/mysql-test/r/subselect3.result @@ -964,3 +964,53 @@ Variable_name Value Handler_read_rnd_next 18 DROP TABLE t1,t2; End of 5.1 tests +# +# BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery +# in the select list +# + +CREATE TABLE t1 ( +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL +); + +INSERT INTO t1 VALUES (8,'v'); +INSERT INTO t1 VALUES (9,'r'); +INSERT INTO t1 VALUES (NULL,'y'); + +CREATE TABLE t2 ( +i int(11) DEFAULT NULL, +v varchar(1) DEFAULT NULL, +KEY i_key (i) +); + +INSERT INTO t2 VALUES (NULL,'r'); +INSERT INTO t2 VALUES (0,'c'); +INSERT INTO t2 VALUES (0,'o'); +INSERT INTO t2 VALUES (2,'v'); +INSERT INTO t2 VALUES (7,'c'); + +SELECT i, v, (SELECT COUNT(DISTINCT i) +FROM t1 +WHERE v = t2.v) as subsel +FROM t2; +i v subsel +NULL r 1 +0 c 0 +0 o 0 +2 v 1 +7 c 0 + +EXPLAIN EXTENDED +SELECT i, v, (SELECT COUNT(DISTINCT i) +FROM t1 +WHERE v = t2.v) as subsel +FROM t2; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1276 Field or reference 'test.t2.v' of SELECT #2 was resolved in SELECT #1 +Note 1003 select `test`.`t2`.`i` AS `i`,`test`.`t2`.`v` AS `v`,(select count(distinct `test`.`t1`.`i`) AS `COUNT(DISTINCT i)` from `test`.`t1` where (`test`.`t1`.`v` = `test`.`t2`.`v`)) AS `subsel` from `test`.`t2` +DROP TABLE t1,t2; +End of 5.6 tests diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test index fab0a462157..39c97941031 100644 --- a/mysql-test/t/subselect3.test +++ b/mysql-test/t/subselect3.test @@ -794,3 +794,50 @@ SHOW STATUS LIKE '%Handler_read_rnd_next'; DROP TABLE t1,t2; --echo End of 5.1 tests + +--echo # +--echo # BUG#48920: COUNT DISTINCT returns 1 for NULL values when in a subquery +--echo # in the select list +--echo # + +--echo +CREATE TABLE t1 ( + i int(11) DEFAULT NULL, + v varchar(1) DEFAULT NULL +); + +--echo +INSERT INTO t1 VALUES (8,'v'); +INSERT INTO t1 VALUES (9,'r'); +INSERT INTO t1 VALUES (NULL,'y'); + +--echo +CREATE TABLE t2 ( + i int(11) DEFAULT NULL, + v varchar(1) DEFAULT NULL, + KEY i_key (i) +); + +--echo +INSERT INTO t2 VALUES (NULL,'r'); +INSERT INTO t2 VALUES (0,'c'); +INSERT INTO t2 VALUES (0,'o'); +INSERT INTO t2 VALUES (2,'v'); +INSERT INTO t2 VALUES (7,'c'); + +--echo +SELECT i, v, (SELECT COUNT(DISTINCT i) + FROM t1 + WHERE v = t2.v) as subsel +FROM t2; + +--echo +EXPLAIN EXTENDED +SELECT i, v, (SELECT COUNT(DISTINCT i) + FROM t1 + WHERE v = t2.v) as subsel +FROM t2; + +DROP TABLE t1,t2; + +--echo End of 5.6 tests diff --git a/sql/item_sum.cc b/sql/item_sum.cc index c33088e0276..a61c5d59d67 100644 --- a/sql/item_sum.cc +++ b/sql/item_sum.cc @@ -578,7 +578,14 @@ int Item_sum::set_aggregator(Aggregator::Aggregator_type aggregator) { if (aggr) { + /* + Dependent subselects may be executed multiple times, making + set_aggregator to be called multiple times. The aggregator type + will be the same, but it needs to be reset so that it is + reevaluated with the new dependent data. + */ DBUG_ASSERT(aggregator == aggr->Aggrtype()); + aggr->clear(); return FALSE; } switch (aggregator) From 54b2371e92a723ee9d44c282b3b1c5b7baf50f89 Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Tue, 5 Jan 2010 16:55:23 +0000 Subject: [PATCH 44/69] BUG#50038 Deadlock on flush logs with concurrent DML and RBR In auto-commit mode, updating both trx and non-trx tables (i.e. issuing a mixed statement) causes the following sequence of events: 1 - "Flush trx changes" (MYSQL_BIN_LOG::write) - T1: 1.1 - mutex_lock (&LOCK_log) 1.2 - mutex_lock (&LOCK_prep_xids) 1.3 - increase prepared_xids 1.4 - mutex_unlock (&LOCK_prep_xids) 1.5 - mutex_unlock (&LOCK_log) 2 - "Flush non-trx changes" (MYSQL_BIN_LOG::write) - T1: 2.1 - mutex_lock (&LOCK_log) 2.2 - mutex_unlock (&LOCK_log) 3. "unlog" - T1 3.1 - mutex_lock (&LOCK_prep_xids) 3.2 - decrease prepared xids 3.3 - pthread_cond_signal(&COND_prep_xids); 3.4 - mutex_unlock (&LOCK_prep_xids) The "FLUSH logs" command produces the following sequence of events: 1 - "FLUSH logs" command (MYSQL_BIN_LOG::new_file_impl) - user thread: 1.1 - mutex_lock (&LOCK_log) 1.2 - mutex_lock (&LOCK_prep_xids) 1.3 - while (prepared_xids) pthread_cond_wait(..., &LOCK_prep_xids); 1.4 - mutex_unlock (&LOCK_prep_xids) 1.5 - mutex_unlock (&LOCK_log) A deadlock will arise if T1 flushes the trx changes and thus increases prepared_xids but before it is able to continue the execution and flush the non-trx changes, an user thread calls the "FLUSH logs" command and wait that the prepared_xids is decreased and gets to zero. However, T1 cannot proceed with the call to "Flush non-trx changes" because it will block in the mutex "LOCK_log" and by consequence cannot complete the execution and call the unlog to decrease the prepared_xids. To fix the problem, we ensure that the non-trx changes are always flushed before the trx changes. Note that if you call "Flush non-trx changes" and a concurrent "FLUSH logs" is issued, the "Flush non-trx changes" may block, but a deadlock will never happen because the prepared_xids will eventually get to zero. Bottom line, there will not be any transaction able to increase the prepared_xids because they will block in the mutex "LOCK_log" (MYSQL_BIN_LOG::write) and those that increased the prepared_xids will eventually commit and decrease the prepared_xids. --- .../suite/binlog/r/binlog_innodb.result | 4 +- .../binlog/r/binlog_mix_innodb_stat.result | 4 +- .../binlog/r/binlog_row_innodb_stat.result | 4 +- .../binlog/r/binlog_stm_innodb_stat.result | 4 +- .../rpl/r/rpl_mixed_mixing_engines.result | 112 +++++++++--------- .../suite/rpl/r/rpl_row_mixing_engines.result | 112 +++++++++--------- sql/log.cc | 3 +- 7 files changed, 122 insertions(+), 121 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_innodb.result b/mysql-test/suite/binlog/r/binlog_innodb.result index c6d7b527f4c..578df67c3c9 100644 --- a/mysql-test/suite/binlog/r/binlog_innodb.result +++ b/mysql-test/suite/binlog/r/binlog_innodb.result @@ -123,7 +123,7 @@ Binlog_cache_disk_use 0 create table t1 (a int) engine=innodb; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 1 +Binlog_cache_use 2 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 @@ -132,7 +132,7 @@ delete from t1; commit; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 2 +Binlog_cache_use 4 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 diff --git a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result index ca5067c4e1f..637be940383 100644 --- a/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result +++ b/mysql-test/suite/binlog/r/binlog_mix_innodb_stat.result @@ -9,7 +9,7 @@ drop table if exists t1; create table t1 (a int) engine=innodb; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 1 +Binlog_cache_use 2 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 @@ -18,7 +18,7 @@ delete from t1; commit; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 2 +Binlog_cache_use 4 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 diff --git a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result index ca5067c4e1f..637be940383 100644 --- a/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result +++ b/mysql-test/suite/binlog/r/binlog_row_innodb_stat.result @@ -9,7 +9,7 @@ drop table if exists t1; create table t1 (a int) engine=innodb; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 1 +Binlog_cache_use 2 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 @@ -18,7 +18,7 @@ delete from t1; commit; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 2 +Binlog_cache_use 4 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 diff --git a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result index ca5067c4e1f..637be940383 100644 --- a/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result +++ b/mysql-test/suite/binlog/r/binlog_stm_innodb_stat.result @@ -9,7 +9,7 @@ drop table if exists t1; create table t1 (a int) engine=innodb; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 1 +Binlog_cache_use 2 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 @@ -18,7 +18,7 @@ delete from t1; commit; show status like "binlog_cache_use"; Variable_name Value -Binlog_cache_use 2 +Binlog_cache_use 4 show status like "binlog_cache_disk_use"; Variable_name Value Binlog_cache_disk_use 1 diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result index dc27e4a5037..7ee633c0776 100644 --- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result @@ -425,54 +425,60 @@ master-bin.000001 # Xid # # COMMIT /* XID */ UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_5) master-bin.000001 # Table_map # # table_id: # (test.tt_6) master-bin.000001 # Write_rows # # table_id: # @@ -480,16 +486,16 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_5) master-bin.000001 # Table_map # # table_id: # (test.tt_6) master-bin.000001 # Write_rows # # table_id: # @@ -497,72 +503,60 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_5) master-bin.000001 # Table_map # # table_id: # (test.nt_6) master-bin.000001 # Write_rows # # table_id: # @@ -570,16 +564,16 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_5) master-bin.000001 # Table_map # # table_id: # (test.nt_6) master-bin.000001 # Write_rows # # table_id: # @@ -587,6 +581,12 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result index 3f2c472ffe9..c92a79d1427 100644 --- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result +++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result @@ -507,54 +507,60 @@ master-bin.000001 # Xid # # COMMIT /* XID */ UPDATE nt_3, tt_3 SET nt_3.info= "new text 25 --> 1", tt_3.info= "new text 25 --> 1" where nt_3.trans_id = tt_3.trans_id and tt_3.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_4(trans_id, stmt_id) VALUES (26, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> NT-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO nt_5(trans_id, stmt_id, info) VALUES (27, 1, fc_i_tt_5_suc(27, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_5) master-bin.000001 # Table_map # # table_id: # (test.tt_6) master-bin.000001 # Write_rows # # table_id: # @@ -562,16 +568,16 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> NT-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.nt_5) +master-bin.000001 # Table_map # # table_id: # (test.nt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.tt_5) master-bin.000001 # Table_map # # table_id: # (test.tt_6) master-bin.000001 # Write_rows # # table_id: # @@ -579,72 +585,60 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.nt_5) -master-bin.000001 # Table_map # # table_id: # (test.nt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Query # # COMMIT -e-e-e-e-e-e-e-e-e-e-e- >> NT-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- UPDATE tt_4, nt_4 SET tt_4.info= "new text 28 --> 1", nt_4.info= "new text 28 --> 1" where nt_4.trans_id = tt_4.trans_id and tt_4.trans_id = 1; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_4) -master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_4) master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_4) +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_3(trans_id, stmt_id) VALUES (29, 1); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-trig << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_3) -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_3) master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_3) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-trig << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- INSERT INTO tt_5(trans_id, stmt_id, info) VALUES (30, 1, fc_i_nt_5_suc(30, 1)); Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_5) master-bin.000001 # Table_map # # table_id: # (test.nt_6) master-bin.000001 # Write_rows # # table_id: # @@ -652,16 +646,16 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- -b-b-b-b-b-b-b-b-b-b-b- >> TN-func << -b-b-b-b-b-b-b-b-b-b-b- Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 # Query # # BEGIN -master-bin.000001 # Table_map # # table_id: # (test.tt_5) -master-bin.000001 # Table_map # # table_id: # (test.tt_6) -master-bin.000001 # Write_rows # # table_id: # -master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F -master-bin.000001 # Xid # # COMMIT /* XID */ -master-bin.000001 # Query # # BEGIN master-bin.000001 # Table_map # # table_id: # (test.nt_5) master-bin.000001 # Table_map # # table_id: # (test.nt_6) master-bin.000001 # Write_rows # # table_id: # @@ -669,6 +663,12 @@ master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.tt_5) +master-bin.000001 # Table_map # # table_id: # (test.tt_6) +master-bin.000001 # Write_rows # # table_id: # +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Xid # # COMMIT /* XID */ -e-e-e-e-e-e-e-e-e-e-e- >> TN-func << -e-e-e-e-e-e-e-e-e-e-e- diff --git a/sql/log.cc b/sql/log.cc index 55f08978b20..8781fb03031 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -5958,7 +5958,8 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid) We always commit the entire transaction when writing an XID. Also note that the return value is inverted. */ - DBUG_RETURN(!binlog_flush_trx_cache(thd, cache_mngr, &xle)); + DBUG_RETURN(!binlog_flush_stmt_cache(thd, cache_mngr) && + !binlog_flush_trx_cache(thd, cache_mngr, &xle)); } void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid) From 3701208a2e890d42aabc678a2a5d4ea539941b36 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 6 Jan 2010 13:02:42 +0300 Subject: [PATCH 45/69] Change version tag (to 5.5.99-m3). --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 26de7a637e9..346e33bf213 100644 --- a/configure.in +++ b/configure.in @@ -25,7 +25,7 @@ AC_CANONICAL_SYSTEM # # When changing major version number please also check switch statement # in client/mysqlbinlog.cc:check_master_version(). -AM_INIT_AUTOMAKE(mysql, 5.5.99) +AM_INIT_AUTOMAKE(mysql, 5.5.99-m3) AM_CONFIG_HEADER([include/config.h:config.h.in]) # Request support for automake silent-rules if available. From bcd5b9fd6144483652b6e5ba68681be441156793 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Wed, 6 Jan 2010 11:27:35 +0100 Subject: [PATCH 46/69] fixing wrong indentation in two Makefile.am, which prevented the Anjuta IDE from parsing the MySQL tree. --- libmysqld/Makefile.am | 4 ++-- sql/share/Makefile.am | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libmysqld/Makefile.am b/libmysqld/Makefile.am index c3e3086b446..2dde00ad38a 100644 --- a/libmysqld/Makefile.am +++ b/libmysqld/Makefile.am @@ -155,8 +155,8 @@ libmysqld.a: libmysqld_int.a $(INC_LIB) $(libmysqld_a_DEPENDENCIES) $(storageobj if DARWIN_MWCC mwld -lib -o $@ libmysqld_int.a `echo $(INC_LIB) | sort -u` $(storageobjects) else - -rm -f libmysqld.a - if test "$(host_os)" = "netware" ; \ + -rm -f libmysqld.a + if test "$(host_os)" = "netware" ; \ then \ $(libmysqld_a_AR) libmysqld.a $(INC_LIB) libmysqld_int.a $(storageobjects); \ else \ diff --git a/sql/share/Makefile.am b/sql/share/Makefile.am index 06b349d5de2..203dbe54254 100644 --- a/sql/share/Makefile.am +++ b/sql/share/Makefile.am @@ -43,8 +43,8 @@ install-data-local: $(DESTDIR)$(pkgdatadir)/$$lang/errmsg.sys; \ done $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/charsets - $(INSTALL_DATA) $(srcdir)/errmsg-utf8.txt \ - $(DESTDIR)$(pkgdatadir)/errmsg-utf8.txt; \ + $(INSTALL_DATA) $(srcdir)/errmsg-utf8.txt \ + $(DESTDIR)$(pkgdatadir)/errmsg-utf8.txt; \ $(INSTALL_DATA) $(srcdir)/charsets/README $(DESTDIR)$(pkgdatadir)/charsets/README $(INSTALL_DATA) $(srcdir)/charsets/*.xml $(DESTDIR)$(pkgdatadir)/charsets From 125cf0d4e8eeea135aa553f9bf810aac6bdcd52a Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Wed, 6 Jan 2010 11:54:45 +0100 Subject: [PATCH 47/69] WL#5197 "Move @@engine_condition_pushdown to @@optimizer_switch" "set engine_condition_pushdown" is deprecated, engine condition pushdown is controlled by a new "set optimizer_switch=engine_condition_pushdown=on|off". mysql-test/r/index_merge_myisam.result: @@optimizer_switch has a new flag mysql-test/r/mysqld--help-notwin.result: @@optimizer_switch has a new flag mysql-test/r/mysqld--help-win.result: @@optimizer_switch has a new flag mysql-test/r/optimizer_switch_eng_cond_pushdown1.result: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/r/optimizer_switch_eng_cond_pushdown2.result: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/suite/ndb/r/ndb_condition_pushdown.result: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/r/ndb_gis.result: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/r/ndb_index_unique.result: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/t/ndb_condition_pushdown.test: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/t/ndb_gis.test: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/ndb/t/ndb_index_unique.test: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result: Setting @@engine_condition_pushdown gives a deprecation warning now. We test that the engine_condition_pushdown flag of @@optimizer_switch, and @@engine_condition_pushdown influence each other (turning the flag on/off sets the variable on/off and vice-versa). mysql-test/suite/sys_vars/r/optimizer_switch_basic.result: @@optimizer_switch has a new flag mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test: Setting @@engine_condition_pushdown gives a deprecation warning now. We test that the engine_condition_pushdown flag of @@optimizer_switch, and @@engine_condition_pushdown influence each other (turning the flag on/off sets the variable on/off and vice-versa). mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/t/optimizer_switch_eng_cond_pushdown1.test: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). mysql-test/t/optimizer_switch_eng_cond_pushdown2.test: Check how --engine-condition-pushdown and --optimizer-switch influence each other when used together (last wins). sql/mysql_priv.h: new "engine_condition_pushdown" switch in @@optimizer_switch, on by default, like @@engine_condition_pushdown is on by default. Constants are ULL because optimizer_switch is stored in a ulonglong. sql/mysqld.cc: Making --engine-condition-pushdown and --optimizer-switch (command-line options) influence each other (last wins) sql/records.cc: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead sql/sql_select.cc: @@engine_condition_pushdown is deprecated, use @@optimizer_switch instead sql/sys_vars.cc: Setting @@engine_condition_pushdown now issues a deprecation message. The version for removal is unknown at this point so I copied it from other deprecation warnings in this file. Turning on/off the engine_condition_pushdown flag of @@optimizer_switch (with SET) turns on/off the @@engine_condition_pushdown variable, and vice-versa, thanks to fix_* functions. --- mysql-test/r/index_merge_myisam.result | 18 +-- mysql-test/r/mysqld--help-notwin.result | 10 +- mysql-test/r/mysqld--help-win.result | 10 +- ...optimizer_switch_eng_cond_pushdown1.result | 5 + ...optimizer_switch_eng_cond_pushdown2.result | 5 + .../suite/ndb/r/ndb_condition_pushdown.result | 34 ++--- mysql-test/suite/ndb/r/ndb_gis.result | 2 +- .../suite/ndb/r/ndb_index_unique.result | 6 +- .../suite/ndb/t/ndb_condition_pushdown.test | 34 ++--- mysql-test/suite/ndb/t/ndb_gis.test | 2 +- mysql-test/suite/ndb/t/ndb_index_unique.test | 6 +- .../r/engine_condition_pushdown_basic.result | 122 ++++++++++++++++++ .../sys_vars/r/optimizer_switch_basic.result | 26 ++-- .../t/engine_condition_pushdown_basic.test | 48 +++++++ ...mizer_switch_eng_cond_pushdown1-master.opt | 1 + .../optimizer_switch_eng_cond_pushdown1.test | 5 + ...mizer_switch_eng_cond_pushdown2-master.opt | 1 + .../optimizer_switch_eng_cond_pushdown2.test | 5 + sql/mysql_priv.h | 17 ++- sql/mysqld.cc | 17 +++ sql/records.cc | 3 +- sql/sql_select.cc | 6 +- sql/sys_vars.cc | 39 +++++- 23 files changed, 334 insertions(+), 88 deletions(-) create mode 100644 mysql-test/r/optimizer_switch_eng_cond_pushdown1.result create mode 100644 mysql-test/r/optimizer_switch_eng_cond_pushdown2.result create mode 100644 mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt create mode 100644 mysql-test/t/optimizer_switch_eng_cond_pushdown1.test create mode 100644 mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt create mode 100644 mysql-test/t/optimizer_switch_eng_cond_pushdown2.test diff --git a/mysql-test/r/index_merge_myisam.result b/mysql-test/r/index_merge_myisam.result index 922f7241102..1be96da5c7d 100644 --- a/mysql-test/r/index_merge_myisam.result +++ b/mysql-test/r/index_merge_myisam.result @@ -1419,19 +1419,19 @@ drop table t1; # select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set optimizer_switch='index_merge=off,index_merge_union=off'; select @@optimizer_switch; @@optimizer_switch -index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on +index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set optimizer_switch='index_merge_union=on'; select @@optimizer_switch; @@optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set optimizer_switch='default,index_merge_sort_union=off'; select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=on set optimizer_switch=4; set optimizer_switch=NULL; ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'NULL' @@ -1457,21 +1457,21 @@ set optimizer_switch=default; set optimizer_switch='index_merge=off,index_merge_union=off,default'; select @@optimizer_switch; @@optimizer_switch -index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on +index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set optimizer_switch=default; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set @@global.optimizer_switch=default; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on # # Check index_merge's @@optimizer_switch flags # select @@optimizer_switch; @@optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on create table t0 (a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t1 (a int, b int, c int, filler char(100), @@ -1581,5 +1581,5 @@ id select_type table type possible_keys key key_len ref rows Extra set optimizer_switch=default; show variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on drop table t0, t1; diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 2ba7df6b7e3..1953e014e4b 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -132,7 +132,8 @@ The following options may be given as the first argument: on that value --enable-locking Deprecated option, use --external-locking instead. --engine-condition-pushdown - Push supported query conditions to the storage engine + Push supported query conditions to the storage engine. + Deprecated, use --optimizer-switch instead. (Defaults to on; use --skip-engine-condition-pushdown to disable.) --event-scheduler[=name] Enable the event scheduler. Possible values are ON, OFF, @@ -413,8 +414,9 @@ The following options may be given as the first argument: --optimizer-switch=name optimizer_switch=option=val[,option=val...], where option is one of {index_merge, index_merge_union, - index_merge_sort_union, index_merge_intersection} and val - is one of {on, off, default} + index_merge_sort_union, index_merge_intersection, + engine_condition_pushdown} and val is one of {on, off, + default} --partition[=name] Enable or disable partition plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load). --pid-file=name Pid file used by safe_mysqld @@ -853,7 +855,7 @@ old-passwords FALSE old-style-user-limits FALSE optimizer-prune-level 1 optimizer-search-depth 62 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on partition ON plugin-dir MYSQL_LIBDIR/mysql/plugin plugin-load (No default value) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 5627716f6ec..95d3a48a6e1 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -132,7 +132,8 @@ The following options may be given as the first argument: on that value --enable-locking Deprecated option, use --external-locking instead. --engine-condition-pushdown - Push supported query conditions to the storage engine + Push supported query conditions to the storage engine. + Deprecated, use --optimizer-switch instead. (Defaults to on; use --skip-engine-condition-pushdown to disable.) --event-scheduler[=name] Enable the event scheduler. Possible values are ON, OFF, @@ -413,8 +414,9 @@ The following options may be given as the first argument: --optimizer-switch=name optimizer_switch=option=val[,option=val...], where option is one of {index_merge, index_merge_union, - index_merge_sort_union, index_merge_intersection} and val - is one of {on, off, default} + index_merge_sort_union, index_merge_intersection, + engine_condition_pushdown} and val is one of {on, off, + default} --partition[=name] Enable or disable partition plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load). --pid-file=name Pid file used by safe_mysqld @@ -857,7 +859,7 @@ old-passwords FALSE old-style-user-limits FALSE optimizer-prune-level 1 optimizer-search-depth 62 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on partition ON plugin-dir MYSQL_LIBDIR/plugin plugin-load (No default value) diff --git a/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result b/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result new file mode 100644 index 00000000000..a8313ec246c --- /dev/null +++ b/mysql-test/r/optimizer_switch_eng_cond_pushdown1.result @@ -0,0 +1,5 @@ +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on diff --git a/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result b/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result new file mode 100644 index 00000000000..d7e84c57f42 --- /dev/null +++ b/mysql-test/r/optimizer_switch_eng_cond_pushdown2.result @@ -0,0 +1,5 @@ +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off diff --git a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result index 4b6f5031fb2..f2b5b882f10 100644 --- a/mysql-test/suite/ndb/r/ndb_condition_pushdown.result +++ b/mysql-test/suite/ndb/r/ndb_condition_pushdown.result @@ -51,8 +51,8 @@ CREATE TABLE t3 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NO insert into t3 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f"); CREATE TABLE t4 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NOT NULL, attr2 bigint unsigned, attr3 tinyint unsigned, attr4 VARCHAR(10) , KEY (attr1)) ENGINE=ndbcluster; insert into t4 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f"); -set @old_ecpd = @@session.engine_condition_pushdown; -set engine_condition_pushdown = off; +set @old_optimizer_switch = @@session.optimizer_switch; +set optimizer_switch = "engine_condition_pushdown=off"; select auto from t1 where string = "aaaa" and vstring = "aaaa" and @@ -484,7 +484,7 @@ pk1 attr1 attr2 attr3 attr4 pk1 attr1 attr2 attr3 attr4 2 2 9223372036854775804 2 c 2 2 9223372036854775804 2 c 3 3 9223372036854775805 3 d 3 3 9223372036854775805 3 d 4 4 9223372036854775806 4 e 4 4 9223372036854775806 4 e -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; explain select auto from t1 where string = "aaaa" and @@ -1769,12 +1769,12 @@ id select_type table type possible_keys key key_len ref rows Extra create table t5 (a int primary key auto_increment, b tinytext not null) engine = ndb; insert into t5 (b) values ('jonas'), ('jensing'), ('johan'); -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select * from t5 where b like '%jo%' order by a; a b 1 jonas 3 johan -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; explain select * from t5 where b like '%jo%'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t5 ALL NULL NULL NULL NULL # Using where @@ -1782,7 +1782,7 @@ select * from t5 where b like '%jo%' order by a; a b 1 jonas 3 johan -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select auto from t1 where date_time like '1902-02-02 %' order by auto; auto 2 @@ -1790,7 +1790,7 @@ select auto from t1 where date_time not like '1902-02-02 %' order by auto; auto 3 4 -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; explain select auto from t1 where date_time like '1902-02-02 %'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL # Using where @@ -1808,7 +1808,7 @@ drop table t1; create table t1 (a int, b varchar(3), primary key using hash(a)) engine=ndb; insert into t1 values (1,'a'), (2,'ab'), (3,'abc'); -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select * from t1 where b like 'ab'; a b 2 ab @@ -1821,7 +1821,7 @@ a b select * from t1 where b like 'abc' or b like 'abc'; a b 3 abc -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; select * from t1 where b like 'ab'; a b 2 ab @@ -1838,7 +1838,7 @@ drop table t1; create table t1 (a int, b char(3), primary key using hash(a)) engine=ndb; insert into t1 values (1,'a'), (2,'ab'), (3,'abc'); -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select * from t1 where b like 'ab'; a b 2 ab @@ -1851,7 +1851,7 @@ a b select * from t1 where b like 'abc' or b like 'abc'; a b 3 abc -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; select * from t1 where b like 'ab'; a b 2 ab @@ -1868,11 +1868,11 @@ drop table t1; create table t1 ( fname varchar(255), lname varchar(255) ) engine=ndbcluster; insert into t1 values ("Young","Foo"); -set engine_condition_pushdown = 0; +set optimizer_switch = "engine_condition_pushdown=off"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); fname lname Young Foo -set engine_condition_pushdown = 1; +set optimizer_switch = "engine_condition_pushdown=on"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); fname lname Young Foo @@ -1880,11 +1880,11 @@ insert into t1 values ("aaa", "aaa"); insert into t1 values ("bbb", "bbb"); insert into t1 values ("ccc", "ccc"); insert into t1 values ("ddd", "ddd"); -set engine_condition_pushdown = 0; +set optimizer_switch = "engine_condition_pushdown=off"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); fname lname Young Foo -set engine_condition_pushdown = 1; +set optimizer_switch = "engine_condition_pushdown=on"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); fname lname Young Foo @@ -1896,7 +1896,7 @@ insert into t1 values (20,2,200,0+0x2222); insert into t1 values (30,3,300,0+0x3333); insert into t1 values (40,4,400,0+0x4444); insert into t1 values (50,5,500,0+0x5555); -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; select a,b,d from t1 where b in (0,1,2,5) order by b; @@ -1916,5 +1916,5 @@ a b d 50 5 21845 Warnings: Warning 4294 Scan filter is too large, discarded -set engine_condition_pushdown = @old_ecpd; +set optimizer_switch = @old_optimizer_switch; DROP TABLE t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/ndb/r/ndb_gis.result b/mysql-test/suite/ndb/r/ndb_gis.result index 54772f596c3..76a53804d8f 100644 --- a/mysql-test/suite/ndb/r/ndb_gis.result +++ b/mysql-test/suite/ndb/r/ndb_gis.result @@ -548,7 +548,7 @@ Overlaps(@horiz1, @point2) 0 DROP TABLE t1; End of 5.0 tests -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; DROP TABLE IF EXISTS t1, gis_point, gis_line, gis_polygon, gis_multi_point, gis_multi_line, gis_multi_polygon, gis_geometrycollection, gis_geometry; CREATE TABLE gis_point (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g POINT); CREATE TABLE gis_line (fid INTEGER PRIMARY KEY AUTO_INCREMENT, g LINESTRING); diff --git a/mysql-test/suite/ndb/r/ndb_index_unique.result b/mysql-test/suite/ndb/r/ndb_index_unique.result index 1fe02d4b5c7..5d0f4038211 100644 --- a/mysql-test/suite/ndb/r/ndb_index_unique.result +++ b/mysql-test/suite/ndb/r/ndb_index_unique.result @@ -181,8 +181,8 @@ a b c 5 5 NULL 8 3 NULL 9 3 NULL -set @old_ecpd = @@session.engine_condition_pushdown; -set engine_condition_pushdown = true; +set @old_optimizer_switch = @@session.optimizer_switch; +set optimizer_switch = "engine_condition_pushdown=on"; explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 range PRIMARY,b PRIMARY 4 NULL 1 Using where with pushed condition @@ -191,7 +191,7 @@ a b c 3 3 NULL 5 5 NULL 8 3 NULL -set engine_condition_pushdown = @old_ecpd; +set optimizer_switch = @old_optimizer_switch; drop table t2; CREATE TABLE t3 ( a int unsigned NOT NULL, diff --git a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test index a56c9dda01c..a6ab06eae31 100644 --- a/mysql-test/suite/ndb/t/ndb_condition_pushdown.test +++ b/mysql-test/suite/ndb/t/ndb_condition_pushdown.test @@ -68,8 +68,8 @@ CREATE TABLE t4 (pk1 int unsigned NOT NULL PRIMARY KEY, attr1 int unsigned NO insert into t4 values (0,0,0,0,"a"),(1,1,9223372036854775803,1,"b"),(2,2,9223372036854775804,2,"c"),(3,3,9223372036854775805,3,"d"),(4,4,9223372036854775806,4,"e"),(5,5,9223372036854775807,5,"f"); -set @old_ecpd = @@session.engine_condition_pushdown; -set engine_condition_pushdown = off; +set @old_optimizer_switch = @@session.optimizer_switch; +set optimizer_switch = "engine_condition_pushdown=off"; # Test all types and compare operators select auto from t1 where @@ -453,7 +453,7 @@ select * from t2,t3 where t2.attr1 < 1 and t2.attr2 = t3.attr2 and t3.attr1 < 5 select * from t4 where attr1 < 5 and attr2 > 9223372036854775803 and attr3 != 3 order by t4.pk1; select * from t3,t4 where t4.attr1 > 1 and t4.attr2 = t3.attr2 and t4.attr3 < 5 order by t4.pk1; -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; # Test all types and compare operators --replace_column 9 # @@ -1674,18 +1674,18 @@ select * from t3 left join t4 on t4.attr2 = t3.attr2 where t4.attr1 > 1 and t4.a create table t5 (a int primary key auto_increment, b tinytext not null) engine = ndb; insert into t5 (b) values ('jonas'), ('jensing'), ('johan'); -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select * from t5 where b like '%jo%' order by a; -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; --replace_column 9 # explain select * from t5 where b like '%jo%'; select * from t5 where b like '%jo%' order by a; # bug#21056 ndb pushdown equal/setValue error on datetime -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select auto from t1 where date_time like '1902-02-02 %' order by auto; select auto from t1 where date_time not like '1902-02-02 %' order by auto; -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; --replace_column 9 # explain select auto from t1 where date_time like '1902-02-02 %'; select auto from t1 where date_time like '1902-02-02 %' order by auto; @@ -1701,12 +1701,12 @@ insert into t1 values (1,'a'), (2,'ab'), (3,'abc'); # in TUP the constants 'ab' 'abc' were expected in varchar format # "like" returned error which became "false" # scan filter negates "or" which exposes the bug -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select * from t1 where b like 'ab'; select * from t1 where b like 'ab' or b like 'ab'; select * from t1 where b like 'abc'; select * from t1 where b like 'abc' or b like 'abc'; -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; select * from t1 where b like 'ab'; select * from t1 where b like 'ab' or b like 'ab'; select * from t1 where b like 'abc'; @@ -1719,12 +1719,12 @@ engine=ndb; insert into t1 values (1,'a'), (2,'ab'), (3,'abc'); # test that incorrect MySQL behaviour is preserved # 'ab ' LIKE 'ab' is true in MySQL -set engine_condition_pushdown = off; +set optimizer_switch = "engine_condition_pushdown=off"; select * from t1 where b like 'ab'; select * from t1 where b like 'ab' or b like 'ab'; select * from t1 where b like 'abc'; select * from t1 where b like 'abc' or b like 'abc'; -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; select * from t1 where b like 'ab'; select * from t1 where b like 'ab' or b like 'ab'; select * from t1 where b like 'abc'; @@ -1736,9 +1736,9 @@ create table t1 ( fname varchar(255), lname varchar(255) ) engine=ndbcluster; insert into t1 values ("Young","Foo"); -set engine_condition_pushdown = 0; +set optimizer_switch = "engine_condition_pushdown=off"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); -set engine_condition_pushdown = 1; +set optimizer_switch = "engine_condition_pushdown=on"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); # make sure optimizer does not do some crazy shortcut @@ -1747,9 +1747,9 @@ insert into t1 values ("bbb", "bbb"); insert into t1 values ("ccc", "ccc"); insert into t1 values ("ddd", "ddd"); -set engine_condition_pushdown = 0; +set optimizer_switch = "engine_condition_pushdown=off"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); -set engine_condition_pushdown = 1; +set optimizer_switch = "engine_condition_pushdown=on"; SELECT fname, lname FROM t1 WHERE (fname like 'Y%') or (lname like 'F%'); # bug#29390 (scan filter is too large, discarded) @@ -1766,7 +1766,7 @@ insert into t1 values (30,3,300,0+0x3333); insert into t1 values (40,4,400,0+0x4444); insert into t1 values (50,5,500,0+0x5555); -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; select a,b,d from t1 where b in (0,1,2,5) @@ -2050,5 +2050,5 @@ select a,b,d from t1 order by b; --enable_query_log -set engine_condition_pushdown = @old_ecpd; +set optimizer_switch = @old_optimizer_switch; DROP TABLE t1,t2,t3,t4,t5; diff --git a/mysql-test/suite/ndb/t/ndb_gis.test b/mysql-test/suite/ndb/t/ndb_gis.test index e14f462c32d..babff535f94 100644 --- a/mysql-test/suite/ndb/t/ndb_gis.test +++ b/mysql-test/suite/ndb/t/ndb_gis.test @@ -1,5 +1,5 @@ --source include/have_ndb.inc SET storage_engine=ndbcluster; --source include/gis_generic.inc -set engine_condition_pushdown = on; +set optimizer_switch = "engine_condition_pushdown=on"; --source include/gis_generic.inc diff --git a/mysql-test/suite/ndb/t/ndb_index_unique.test b/mysql-test/suite/ndb/t/ndb_index_unique.test index 78757c3bcf7..9178ace1ad0 100644 --- a/mysql-test/suite/ndb/t/ndb_index_unique.test +++ b/mysql-test/suite/ndb/t/ndb_index_unique.test @@ -112,11 +112,11 @@ insert t2 values(1,1,NULL),(2,2,2),(3,3,NULL),(4,4,4),(5,5,NULL),(6,6,6),(7,7,NU select * from t2 where c IS NULL order by a; select * from t2 where b = 3 AND c IS NULL order by a; select * from t2 where (b = 3 OR b = 5) AND c IS NULL order by a; -set @old_ecpd = @@session.engine_condition_pushdown; -set engine_condition_pushdown = true; +set @old_optimizer_switch = @@session.optimizer_switch; +set optimizer_switch = "engine_condition_pushdown=on"; explain select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a; select * from t2 where (b = 3 OR b = 5) AND c IS NULL AND a < 9 order by a; -set engine_condition_pushdown = @old_ecpd; +set optimizer_switch = @old_optimizer_switch; drop table t2; diff --git a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result index 6a8052490c4..2b0b57d5b33 100644 --- a/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result +++ b/mysql-test/suite/sys_vars/r/engine_condition_pushdown_basic.result @@ -6,19 +6,33 @@ SET @global_start_value = @@global.engine_condition_pushdown; SELECT @global_start_value; @global_start_value 1 +select @old_session_opt_switch:=@@session.optimizer_switch, +@old_global_opt_switch:=@@global.optimizer_switch; +@old_session_opt_switch:=@@session.optimizer_switch @old_global_opt_switch:=@@global.optimizer_switch +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on '#--------------------FN_DYNVARS_028_01------------------------#' SET @@session.engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SET @@session.engine_condition_pushdown = DEFAULT; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 1 SET @@global.engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SET @@global.engine_condition_pushdown = DEFAULT; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 1 '#---------------------FN_DYNVARS_028_02-------------------------#' SET engine_condition_pushdown = 1; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@engine_condition_pushdown; @@engine_condition_pushdown 1 @@ -29,27 +43,39 @@ ERROR 42S02: Unknown table 'local' in field list SELECT global.engine_condition_pushdown; ERROR 42S02: Unknown table 'global' in field list SET session engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 0 SET global engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 0 '#--------------------FN_DYNVARS_028_03------------------------#' SET @@session.engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 0 SET @@session.engine_condition_pushdown = 1; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 1 SET @@global.engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 0 SET @@global.engine_condition_pushdown = 1; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 1 @@ -88,11 +114,17 @@ SET @@global.engine_condition_pushdown = ERROR 42000: Variable 'engine_condition_pushdown' can't be set to the value of 'ÓFF' '#-------------------FN_DYNVARS_028_05----------------------------#' SET @@global.engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SET @@session.engine_condition_pushdown = 1; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown AS res_is_0; res_is_0 0 SET @@global.engine_condition_pushdown = 0; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown AS res_is_1; res_is_1 1 @@ -126,43 +158,133 @@ VARIABLE_VALUE ON '#---------------------FN_DYNVARS_028_08-------------------------#' SET @@session.engine_condition_pushdown = OFF; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 0 SET @@session.engine_condition_pushdown = ON; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 1 SET @@global.engine_condition_pushdown = OFF; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 0 SET @@global.engine_condition_pushdown = ON; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 1 '#---------------------FN_DYNVARS_028_09----------------------#' SET @@session.engine_condition_pushdown = TRUE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 1 SET @@session.engine_condition_pushdown = FALSE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 0 SET @@global.engine_condition_pushdown = TRUE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 1 SET @@global.engine_condition_pushdown = FALSE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 0 +Check that @@engine_condition_pushdown influences +@@optimizer_switch and vice-versa +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +set @@session.engine_condition_pushdown = TRUE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +set @@session.engine_condition_pushdown = FALSE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +set @@global.engine_condition_pushdown = TRUE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on +set @@global.engine_condition_pushdown = FALSE; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +set @@session.optimizer_switch = "engine_condition_pushdown=on"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +1 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +set @@session.optimizer_switch = "engine_condition_pushdown=off"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off +set @@global.optimizer_switch = "engine_condition_pushdown=on"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on +set @@global.optimizer_switch = "engine_condition_pushdown=off"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +0 0 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off SET @@session.engine_condition_pushdown = @session_start_value; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@session.engine_condition_pushdown; @@session.engine_condition_pushdown 1 SET @@global.engine_condition_pushdown = @global_start_value; +Warnings: +Warning 1287 The syntax '@@engine_condition_pushdown' is deprecated and will be removed in MySQL 7.0. Please use '@@optimizer_switch' instead SELECT @@global.engine_condition_pushdown; @@global.engine_condition_pushdown 1 +set @session.optimizer_switch=@old_session_opt_switch, +@@global.optimizer_switch=@old_global_opt_switch; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +@@session.engine_condition_pushdown @@global.engine_condition_pushdown @@session.optimizer_switch @@global.optimizer_switch +1 1 index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on diff --git a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result index d1e03f769c8..2d648259a26 100644 --- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result +++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result @@ -1,45 +1,45 @@ SET @start_global_value = @@global.optimizer_switch; SELECT @start_global_value; @start_global_value -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on show global variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on show session variables like 'optimizer_switch'; Variable_name Value -optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +optimizer_switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on select * from information_schema.global_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on select * from information_schema.session_variables where variable_name='optimizer_switch'; VARIABLE_NAME VARIABLE_VALUE -OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +OPTIMIZER_SWITCH index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on set global optimizer_switch=10; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on +index_merge=off,index_merge_union=on,index_merge_sort_union=off,index_merge_intersection=on,engine_condition_pushdown=off set session optimizer_switch=5; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off +index_merge=on,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off set global optimizer_switch="index_merge_sort_union=on"; select @@global.optimizer_switch; @@global.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off set session optimizer_switch="index_merge=off"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off +index_merge=off,index_merge_union=off,index_merge_sort_union=on,index_merge_intersection=off,engine_condition_pushdown=off set session optimizer_switch="default"; select @@session.optimizer_switch; @@session.optimizer_switch -index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=off,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=off set global optimizer_switch=1.1; ERROR 42000: Incorrect argument type to variable 'optimizer_switch' set global optimizer_switch=1e1; @@ -51,4 +51,4 @@ ERROR 42000: Variable 'optimizer_switch' can't be set to the value of 'foobar' SET @@global.optimizer_switch = @start_global_value; SELECT @@global.optimizer_switch; @@global.optimizer_switch -index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,engine_condition_pushdown=on diff --git a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test index b153ac50e1e..ab9bfc3dd6a 100644 --- a/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test +++ b/mysql-test/suite/sys_vars/t/engine_condition_pushdown_basic.test @@ -40,6 +40,10 @@ SELECT @session_start_value; SET @global_start_value = @@global.engine_condition_pushdown; SELECT @global_start_value; +# same for optimizer_switch +select @old_session_opt_switch:=@@session.optimizer_switch, +@old_global_opt_switch:=@@global.optimizer_switch; + --echo '#--------------------FN_DYNVARS_028_01------------------------#' ######################################################################## # Display the DEFAULT value of engine_condition_pushdown # @@ -204,6 +208,44 @@ SELECT @@global.engine_condition_pushdown; SET @@global.engine_condition_pushdown = FALSE; SELECT @@global.engine_condition_pushdown; +--echo Check that @@engine_condition_pushdown influences +--echo @@optimizer_switch and vice-versa +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@session.engine_condition_pushdown = TRUE; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@session.engine_condition_pushdown = FALSE; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@global.engine_condition_pushdown = TRUE; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@global.engine_condition_pushdown = FALSE; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@session.optimizer_switch = "engine_condition_pushdown=on"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@session.optimizer_switch = "engine_condition_pushdown=off"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@global.optimizer_switch = "engine_condition_pushdown=on"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; +set @@global.optimizer_switch = "engine_condition_pushdown=off"; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; + ############################## # Restore initial value # ############################## @@ -214,6 +256,12 @@ SELECT @@session.engine_condition_pushdown; SET @@global.engine_condition_pushdown = @global_start_value; SELECT @@global.engine_condition_pushdown; +set @session.optimizer_switch=@old_session_opt_switch, +@@global.optimizer_switch=@old_global_opt_switch; +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; + ############################################################### # END OF engine_condition_pushdown TESTS # ############################################################### diff --git a/mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt b/mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt new file mode 100644 index 00000000000..89aa07976ac --- /dev/null +++ b/mysql-test/t/optimizer_switch_eng_cond_pushdown1-master.opt @@ -0,0 +1 @@ +--optimizer-switch=engine_condition_pushdown=off --engine-condition-pushdown=1 diff --git a/mysql-test/t/optimizer_switch_eng_cond_pushdown1.test b/mysql-test/t/optimizer_switch_eng_cond_pushdown1.test new file mode 100644 index 00000000000..187aa145408 --- /dev/null +++ b/mysql-test/t/optimizer_switch_eng_cond_pushdown1.test @@ -0,0 +1,5 @@ +# check how --engine-condition-pushdown and --optimizer-switch +# influence each other when used together (last wins). +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; diff --git a/mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt b/mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt new file mode 100644 index 00000000000..f48ab5b963b --- /dev/null +++ b/mysql-test/t/optimizer_switch_eng_cond_pushdown2-master.opt @@ -0,0 +1 @@ +--engine-condition-pushdown=1 --optimizer-switch=engine_condition_pushdown=off diff --git a/mysql-test/t/optimizer_switch_eng_cond_pushdown2.test b/mysql-test/t/optimizer_switch_eng_cond_pushdown2.test new file mode 100644 index 00000000000..187aa145408 --- /dev/null +++ b/mysql-test/t/optimizer_switch_eng_cond_pushdown2.test @@ -0,0 +1,5 @@ +# check how --engine-condition-pushdown and --optimizer-switch +# influence each other when used together (last wins). +select @@session.engine_condition_pushdown, +@@global.engine_condition_pushdown, +@@session.optimizer_switch, @@global.optimizer_switch; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1615ca97073..bf0c587f7ae 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -622,17 +622,19 @@ protected: #define MODE_PAD_CHAR_TO_FULL_LENGTH (ULL(1) << 31) /* @@optimizer_switch flags. These must be in sync with optimizer_switch_typelib */ -#define OPTIMIZER_SWITCH_INDEX_MERGE 1 -#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION 2 -#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION 4 -#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT 8 -#define OPTIMIZER_SWITCH_LAST 16 +#define OPTIMIZER_SWITCH_INDEX_MERGE (1ULL << 0) +#define OPTIMIZER_SWITCH_INDEX_MERGE_UNION (1ULL << 1) +#define OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION (1ULL << 2) +#define OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT (1ULL << 3) +#define OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN (1ULL << 4) +#define OPTIMIZER_SWITCH_LAST (1ULL << 5) /* The following must be kept in sync with optimizer_switch_str in mysqld.cc */ #define OPTIMIZER_SWITCH_DEFAULT (OPTIMIZER_SWITCH_INDEX_MERGE | \ OPTIMIZER_SWITCH_INDEX_MERGE_UNION | \ OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION | \ - OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT) + OPTIMIZER_SWITCH_INDEX_MERGE_INTERSECT | \ + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) /* @@ -2636,7 +2638,8 @@ enum options_mysqld OPT_SSL_CIPHER, OPT_SSL_KEY, OPT_UPDATE_LOG, - OPT_WANT_CORE + OPT_WANT_CORE, + OPT_ENGINE_CONDITION_PUSHDOWN }; #endif /* MYSQL_SERVER */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d49e893aaa1..777f09c47ea 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -6995,6 +6995,18 @@ mysqld_get_one_option(int optid, } break; #endif /* defined(ENABLED_DEBUG_SYNC) */ + case OPT_ENGINE_CONDITION_PUSHDOWN: + /* + The last of --engine-condition-pushdown and --optimizer_switch on + command line wins (see get_options(). + */ + if (global_system_variables.engine_condition_pushdown) + global_system_variables.optimizer_switch|= + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN; + else + global_system_variables.optimizer_switch&= + ~OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN; + break; } return 0; } @@ -7216,6 +7228,11 @@ static int get_options(int *argc,char **argv) else pool_of_threads_scheduler(&thread_scheduler); /* purecov: tested */ #endif + + global_system_variables.engine_condition_pushdown= + test(global_system_variables.optimizer_switch & + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN); + return 0; } diff --git a/sql/records.cc b/sql/records.cc index 9ec19c55841..c97ffa152dc 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -270,7 +270,8 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, thd->variables.read_buff_size); } /* Condition pushdown to storage engine */ - if (thd->variables.engine_condition_pushdown && + if ((thd->variables.optimizer_switch & + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) && select && select->cond && (select->cond->used_tables() & table->map) && !table->file->pushed_cond) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 5f1c5ac2a34..5647727089f 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -6347,7 +6347,8 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) /* Push condition to storage engine if this is enabled and the condition is not guarded */ tab->table->file->pushed_cond= NULL; - if (thd->variables.engine_condition_pushdown) + if (thd->variables.optimizer_switch & + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) { COND *push_cond= make_cond_for_table(tmp, current_map, current_map); @@ -16630,7 +16631,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order, { const COND *pushed_cond= tab->table->file->pushed_cond; - if (thd->variables.engine_condition_pushdown && pushed_cond) + if ((thd->variables.optimizer_switch & + OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN) && pushed_cond) { extra.append(STRING_WITH_LEN("; Using where with pushed " "condition")); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index da507edbdb4..31dc9e74902 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1114,16 +1114,28 @@ static Sys_var_ulong Sys_optimizer_search_depth( static const char *optimizer_switch_names[]= { "index_merge", "index_merge_union", "index_merge_sort_union", - "index_merge_intersection", + "index_merge_intersection", "engine_condition_pushdown", "default", NullS }; +/** propagates changes to @@engine_condition_pushdown */ +static bool fix_optimizer_switch(sys_var *self, THD *thd, + enum_var_type type) +{ + SV *sv= (type == OPT_GLOBAL) ? &global_system_variables : &thd->variables; + sv->engine_condition_pushdown= + test(sv->optimizer_switch & OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN); + return false; +} static Sys_var_flagset Sys_optimizer_switch( "optimizer_switch", "optimizer_switch=option=val[,option=val...], where option is one of " "{index_merge, index_merge_union, index_merge_sort_union, " - "index_merge_intersection} and val is one of {on, off, default}", + "index_merge_intersection, engine_condition_pushdown}" + " and val is one of {on, off, default}", SESSION_VAR(optimizer_switch), CMD_LINE(REQUIRED_ARG), - optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT)); + optimizer_switch_names, DEFAULT(OPTIMIZER_SWITCH_DEFAULT), + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), + ON_UPDATE(fix_optimizer_switch)); static Sys_var_charptr Sys_pid_file( "pid_file", "Pid file used by safe_mysqld", @@ -1820,11 +1832,26 @@ static Sys_var_ulong Sys_net_wait_timeout( VALID_RANGE(1, IF_WIN(INT_MAX32/1000, LONG_TIMEOUT)), DEFAULT(NET_WAIT_TIMEOUT), BLOCK_SIZE(1)); +/** propagates changes to the relevant flag of @@optimizer_switch */ +static bool fix_engine_condition_pushdown(sys_var *self, THD *thd, + enum_var_type type) +{ + SV *sv= (type == OPT_GLOBAL) ? &global_system_variables : &thd->variables; + if (sv->engine_condition_pushdown) + sv->optimizer_switch|= OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN; + else + sv->optimizer_switch&= ~OPTIMIZER_SWITCH_ENGINE_CONDITION_PUSHDOWN; + return false; +} static Sys_var_mybool Sys_engine_condition_pushdown( "engine_condition_pushdown", - "Push supported query conditions to the storage engine", - SESSION_VAR(engine_condition_pushdown), CMD_LINE(OPT_ARG), - DEFAULT(TRUE)); + "Push supported query conditions to the storage engine." + " Deprecated, use --optimizer-switch instead.", + SESSION_VAR(engine_condition_pushdown), + CMD_LINE(OPT_ARG, OPT_ENGINE_CONDITION_PUSHDOWN), + DEFAULT(TRUE), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), + ON_UPDATE(fix_engine_condition_pushdown), + DEPRECATED(70000, "'@@optimizer_switch'")); static Sys_var_plugin Sys_default_storage_engine( "default_storage_engine", "The default storage engine for new tables", From ebb8574b7d4efc0c3f28bc71f9ce64e773a36370 Mon Sep 17 00:00:00 2001 From: Guilhem Bichot Date: Wed, 6 Jan 2010 11:59:01 +0100 Subject: [PATCH 48/69] Fix for BUG#50081 "Tests: mysqld--help-notwin fails with --parallel": eliminate 3 more "directory path" variables from the test's output (it was already the case for other similar ones likes slow-query-log-file). --- mysql-test/include/mysqld--help.inc | 3 ++- mysql-test/r/mysqld--help-notwin.result | 3 --- mysql-test/r/mysqld--help-win.result | 3 --- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/mysql-test/include/mysqld--help.inc b/mysql-test/include/mysqld--help.inc index 82bf65bc362..3c8d19107c9 100644 --- a/mysql-test/include/mysqld--help.inc +++ b/mysql-test/include/mysqld--help.inc @@ -11,7 +11,8 @@ exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --lower-case-table-names=1 --help perl; @skipvars=qw/basedir open-files-limit general-log-file log - log-slow-queries pid-file slow-query-log-file/; + log-slow-queries pid-file slow-query-log-file + datadir slave-load-tmpdir tmpdir/; @plugins=qw/innodb ndb ndbcluster safemalloc debug temp-pool ssl des-key-file thread-concurrency super-large-pages mutex-deadlock-detector/; @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_LIBDIR MYSQL_SHAREDIR/; diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 1953e014e4b..3975f085468 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -744,7 +744,6 @@ completion-type NO_CHAIN concurrent-insert AUTO connect-timeout 10 console FALSE -datadir MYSQLTEST_VARDIR/install.db/ date-format %Y-%m-%d datetime-format %Y-%m-%d %H:%i:%s default-character-set latin1 @@ -898,7 +897,6 @@ skip-show-database FALSE skip-slave-start FALSE slave-compressed-protocol FALSE slave-exec-mode STRICT -slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ slave-net-timeout 3600 slave-skip-errors (No default value) slave-transaction-retries 10 @@ -926,7 +924,6 @@ thread-stack 262144 time-format %H:%i:%s timed-mutexes FALSE tmp-table-size 16777216 -tmpdir MYSQLTEST_VARDIR/tmp/ transaction-alloc-block-size 8192 transaction-isolation REPEATABLE-READ transaction-prealloc-size 4096 diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 95d3a48a6e1..c51fbd969ba 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -748,7 +748,6 @@ completion-type NO_CHAIN concurrent-insert AUTO connect-timeout 10 console FALSE -datadir MYSQLTEST_VARDIR/install.db/ date-format %Y-%m-%d datetime-format %Y-%m-%d %H:%i:%s default-character-set latin1 @@ -904,7 +903,6 @@ skip-show-database FALSE skip-slave-start FALSE slave-compressed-protocol FALSE slave-exec-mode STRICT -slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ slave-net-timeout 3600 slave-skip-errors (No default value) slave-transaction-retries 10 @@ -932,7 +930,6 @@ thread-stack 262144 time-format %H:%i:%s timed-mutexes FALSE tmp-table-size 16777216 -tmpdir MYSQLTEST_VARDIR/tmp/ transaction-alloc-block-size 8192 transaction-isolation REPEATABLE-READ transaction-prealloc-size 4096 From a0f701ec171cbf02960ae014eefa5fef09a33ffe Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 6 Jan 2010 15:00:51 +0100 Subject: [PATCH 49/69] Bug #50087 Interval arithmetic for Event_queue_element is not portable. Subtraction of two unsigned months yielded a (very large) positive value. Conversion of this to a signed value was not necessarily well defined. Solution: do the subtraction on signed values. mysql-test/r/events_scheduling.result: Add test case. mysql-test/t/events_scheduling.test: Add test case. sql/event_data_objects.cc: Convert month to signed before doing the subtraction. --- mysql-test/r/events_scheduling.result | 19 +++++++++++++++++++ mysql-test/t/events_scheduling.test | 26 ++++++++++++++++++++++++++ sql/event_data_objects.cc | 5 +++-- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/events_scheduling.result b/mysql-test/r/events_scheduling.result index 7dfd10a53f8..262caea3d7f 100644 --- a/mysql-test/r/events_scheduling.result +++ b/mysql-test/r/events_scheduling.result @@ -82,5 +82,24 @@ DROP TABLE table_1; DROP TABLE table_2; DROP TABLE table_3; DROP TABLE table_4; + +Bug #50087 Interval arithmetic for Event_queue_element is not portable. + +CREATE TABLE t1(a int); +CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH +STARTS NOW() - INTERVAL 1 MONTH +ENDS NOW() + INTERVAL 2 MONTH +ON COMPLETION PRESERVE +DO +INSERT INTO t1 VALUES (1); +CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH +STARTS NOW() +ENDS NOW() + INTERVAL 11 MONTH +ON COMPLETION PRESERVE +DO +INSERT INTO t1 VALUES (1); +DROP TABLE t1; +DROP EVENT e1; +DROP EVENT e2; DROP DATABASE events_test; SET GLOBAL event_scheduler=@event_scheduler; diff --git a/mysql-test/t/events_scheduling.test b/mysql-test/t/events_scheduling.test index 041a2def490..5f16f8bea6a 100644 --- a/mysql-test/t/events_scheduling.test +++ b/mysql-test/t/events_scheduling.test @@ -108,6 +108,32 @@ DROP TABLE table_1; DROP TABLE table_2; DROP TABLE table_3; DROP TABLE table_4; + +-- echo +-- echo Bug #50087 Interval arithmetic for Event_queue_element is not portable. +-- echo + +CREATE TABLE t1(a int); + +CREATE EVENT e1 ON SCHEDULE EVERY 1 MONTH +STARTS NOW() - INTERVAL 1 MONTH +ENDS NOW() + INTERVAL 2 MONTH +ON COMPLETION PRESERVE +DO + INSERT INTO t1 VALUES (1); + +CREATE EVENT e2 ON SCHEDULE EVERY 1 MONTH +STARTS NOW() +ENDS NOW() + INTERVAL 11 MONTH +ON COMPLETION PRESERVE +DO + INSERT INTO t1 VALUES (1); + +DROP TABLE t1; +DROP EVENT e1; +DROP EVENT e2; + + DROP DATABASE events_test; SET GLOBAL event_scheduler=@event_scheduler; diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index b2bbd340e14..7562e8d8207 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -834,8 +834,9 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next, } else { - long diff_months= (long) (local_now.year - local_start.year)*12 + - (local_now.month - local_start.month); + long diff_months= ((long) local_now.year - (long) local_start.year)*12 + + ((long) local_now.month - (long) local_start.month); + /* Unlike for seconds above, the formula below returns the interval that, when added to the local_start, will give the time in the From 2ac6690200b0182bff6d9cda7f8d624b3cb4a3bb Mon Sep 17 00:00:00 2001 From: Tor Didriksen Date: Wed, 6 Jan 2010 16:21:43 +0100 Subject: [PATCH 50/69] Follup fix for WL#4738 --- mysql-test/lib/v1/mysql-test-run.pl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mysql-test/lib/v1/mysql-test-run.pl b/mysql-test/lib/v1/mysql-test-run.pl index 9ae3208fc24..4202334a244 100755 --- a/mysql-test/lib/v1/mysql-test-run.pl +++ b/mysql-test/lib/v1/mysql-test-run.pl @@ -3911,7 +3911,7 @@ sub mysqld_arguments ($$$$) { if ( $opt_valgrind_mysqld ) { - mtr_add_arg($args, "%s--skip-safemalloc", $prefix); + mtr_add_arg($args, "%s--loose-skip-safemalloc", $prefix); if ( $mysql_version_id < 50100 ) { @@ -5208,7 +5208,6 @@ sub valgrind_arguments { else { mtr_add_arg($args, "--tool=memcheck"); # From >= 2.1.2 needs this option - mtr_add_arg($args, "--alignment=8"); mtr_add_arg($args, "--leak-check=yes"); mtr_add_arg($args, "--num-callers=16"); mtr_add_arg($args, "--suppressions=%s/valgrind.supp", $glob_mysql_test_dir) From 4b559b912f5a3aa02a226fdacddaa3b80a8ade42 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 6 Jan 2010 14:26:03 -0700 Subject: [PATCH 51/69] Merge mysql-next-mr (revno 2955) --> mysql-next-mr-marc From a533cec71b5d0df0656fe00de107bc1472835500 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Thu, 7 Jan 2010 01:04:38 +0000 Subject: [PATCH 52/69] Fix for rpl_bug31076 valgrind failure which popped up after WL#5151 was pushed. Problem 1: Some old binlog events do not contain metadata. This makes checking whether the field can be converted or not rather impossible because one cannot compare, for instance, field sizes from original table and target table. Solution 1: When an event does not contain metadata, we will just check if field types are equal and assume that original field definition matched with the one in the target table. Problem 2: There is a second fix, which involves lack of information regarding maybe_null. This was causing a conditional jump warning when creating a conversion table. Solution 2: We will just assume that all fields that need to be in the conversion table may be null. --- sql/rpl_utility.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 3d5b3baad30..16eaae9b91d 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -590,6 +590,13 @@ can_convert_field_to(Field *field, */ if (field->real_type() == source_type) { + if (metadata == 0) // Metadata can only be zero if no metadata was provided + { + DBUG_PRINT("debug", ("Base types are identical, but there is no metadata")); + *order_var= 0; + DBUG_RETURN(true); + } + DBUG_PRINT("debug", ("Base types are identical, doing field size comparison")); if (field->compatible_field_size(metadata, rli, mflags, order_var)) DBUG_RETURN(is_conversion_ok(*order_var, rli)); @@ -920,7 +927,7 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * field_def->init_for_tmp_table(type(col), max_length, decimals, - maybe_null(col), // maybe_null + TRUE, // maybe_null FALSE, // unsigned_flag pack_length); field_def->charset= target_table->field[col]->charset(); From 3d915225611a921fad03934e58bf281b48fc15b0 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Wed, 6 Jan 2010 22:42:07 -0700 Subject: [PATCH 53/69] WL#2360 Performance schema Part IV: sql instrumentation --- client/client_priv.h | 2 +- libmysqld/lib_sql.cc | 14 +- mysql-test/include/have_perfschema.inc | 20 + mysql-test/suite/sys_vars/r/all_vars.result | 18 +- .../r/performance_schema_basic.result | 23 + ...vents_waits_history_long_size_basic.result | 23 + ...pfs_events_waits_history_size_basic.result | 23 + .../r/pfs_max_cond_classes_basic.result | 23 + .../r/pfs_max_cond_instances_basic.result | 23 + .../r/pfs_max_file_classes_basic.result | 23 + .../r/pfs_max_file_handles_basic.result | 23 + .../r/pfs_max_file_instances_basic.result | 23 + .../r/pfs_max_mutex_classes_basic.result | 23 + .../r/pfs_max_mutex_instances_basic.result | 23 + .../r/pfs_max_rwlock_classes_basic.result | 23 + .../r/pfs_max_rwlock_instances_basic.result | 23 + .../r/pfs_max_table_handles_basic.result | 23 + .../r/pfs_max_table_instances_basic.result | 23 + .../r/pfs_max_thread_classes_basic.result | 23 + .../r/pfs_max_thread_instances_basic.result | 23 + mysql-test/suite/sys_vars/t/all_vars.test | 41 +- .../t/performance_schema_basic-master.opt | 1 + .../sys_vars/t/performance_schema_basic.test | 47 + ...s_waits_history_long_size_basic-master.opt | 1 + ..._events_waits_history_long_size_basic.test | 47 + ...events_waits_history_size_basic-master.opt | 1 + .../pfs_events_waits_history_size_basic.test | 47 + .../t/pfs_max_cond_classes_basic-master.opt | 1 + .../t/pfs_max_cond_classes_basic.test | 47 + .../t/pfs_max_cond_instances_basic-master.opt | 1 + .../t/pfs_max_cond_instances_basic.test | 47 + .../t/pfs_max_file_classes_basic-master.opt | 1 + .../t/pfs_max_file_classes_basic.test | 47 + .../t/pfs_max_file_handles_basic-master.opt | 1 + .../t/pfs_max_file_handles_basic.test | 47 + .../t/pfs_max_file_instances_basic-master.opt | 1 + .../t/pfs_max_file_instances_basic.test | 47 + .../t/pfs_max_mutex_classes_basic-master.opt | 1 + .../t/pfs_max_mutex_classes_basic.test | 47 + .../pfs_max_mutex_instances_basic-master.opt | 1 + .../t/pfs_max_mutex_instances_basic.test | 47 + .../t/pfs_max_rwlock_classes_basic-master.opt | 1 + .../t/pfs_max_rwlock_classes_basic.test | 47 + .../pfs_max_rwlock_instances_basic-master.opt | 1 + .../t/pfs_max_rwlock_instances_basic.test | 47 + .../t/pfs_max_table_handles_basic-master.opt | 1 + .../t/pfs_max_table_handles_basic.test | 47 + .../pfs_max_table_instances_basic-master.opt | 1 + .../t/pfs_max_table_instances_basic.test | 47 + .../t/pfs_max_thread_classes_basic-master.opt | 1 + .../t/pfs_max_thread_classes_basic.test | 47 + .../pfs_max_thread_instances_basic-master.opt | 1 + .../t/pfs_max_thread_instances_basic.test | 47 + mysys/my_init.c | 5 +- mysys/my_thr_init.c | 4 +- mysys/mysys_priv.h | 2 +- sql/authors.h | 2 +- sql/derror.cc | 30 +- sql/des_key_file.cc | 11 +- sql/discover.cc | 27 +- sql/event_data_objects.cc | 5 +- sql/event_queue.cc | 22 +- sql/event_queue.h | 11 +- sql/event_scheduler.cc | 42 +- sql/event_scheduler.h | 6 +- sql/events.cc | 98 +- sql/events.h | 11 +- sql/filesort.cc | 7 +- sql/ha_ndbcluster.cc | 295 +++-- sql/ha_ndbcluster.h | 22 +- sql/ha_ndbcluster_binlog.cc | 262 ++--- sql/ha_ndbcluster_binlog.h | 20 +- sql/ha_partition.cc | 60 +- sql/ha_partition.h | 6 +- sql/handler.cc | 38 +- sql/handler.h | 55 +- sql/hash_filo.h | 12 +- sql/hostname.cc | 20 +- sql/item_func.cc | 28 +- sql/item_strfunc.cc | 36 +- sql/lock.cc | 30 +- sql/log.cc | 395 +++---- sql/log.h | 44 +- sql/log_event.cc | 105 +- sql/log_event.h | 6 +- sql/mysql_priv.h | 128 +- sql/mysqld.cc | 1025 +++++++++++++---- sql/parse_file.cc | 31 +- sql/repl_failsafe.cc | 89 +- sql/repl_failsafe.h | 6 +- sql/rpl_mi.cc | 42 +- sql/rpl_mi.h | 6 +- sql/rpl_reporting.cc | 28 +- sql/rpl_reporting.h | 27 +- sql/rpl_rli.cc | 101 +- sql/rpl_rli.h | 12 +- sql/set_var.cc | 39 +- sql/set_var.h | 17 +- sql/share/errmsg-utf8.txt | 5 + sql/slave.cc | 314 ++--- sql/slave.h | 19 +- sql/sql_acl.cc | 461 ++++---- sql/sql_acl.h | 135 ++- sql/sql_base.cc | 73 +- sql/sql_cache.cc | 68 +- sql/sql_cache.h | 8 +- sql/sql_class.cc | 124 +- sql/sql_class.h | 18 +- sql/sql_connect.cc | 46 +- sql/sql_load.cc | 13 +- sql/sql_manager.cc | 27 +- sql/sql_map.cc | 18 +- sql/sql_parse.cc | 392 ++++--- sql/sql_partition.cc | 49 +- sql/sql_plugin.cc | 206 ++-- sql/sql_plugin.h | 2 +- sql/sql_prepare.cc | 4 +- sql/sql_repl.cc | 94 +- sql/sql_servers.cc | 52 +- sql/sql_show.cc | 80 +- sql/sql_table.cc | 81 +- sql/sql_trigger.cc | 6 +- sql/sql_udf.cc | 56 +- sql/sql_update.cc | 9 +- sql/sql_view.cc | 29 +- sql/sys_vars.cc | 191 ++- sql/sys_vars.h | 70 +- sql/sys_vars_shared.h | 22 +- sql/table.cc | 132 ++- sql/table.h | 70 +- sql/tztime.cc | 46 +- sql/unireg.cc | 70 +- storage/myisam/ha_myisam.cc | 4 +- 133 files changed, 5198 insertions(+), 2295 deletions(-) create mode 100644 mysql-test/include/have_perfschema.inc create mode 100644 mysql-test/suite/sys_vars/r/performance_schema_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_events_waits_history_long_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_events_waits_history_size_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_cond_classes_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_cond_instances_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_file_classes_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_file_handles_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_file_instances_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_mutex_classes_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_mutex_instances_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_rwlock_classes_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_rwlock_instances_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_table_handles_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_table_instances_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_thread_classes_basic.result create mode 100644 mysql-test/suite/sys_vars/r/pfs_max_thread_instances_basic.result create mode 100644 mysql-test/suite/sys_vars/t/performance_schema_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/performance_schema_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic.test create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic-master.opt create mode 100644 mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic.test diff --git a/client/client_priv.h b/client/client_priv.h index 97a8920f744..9cd151f6160 100644 --- a/client/client_priv.h +++ b/client/client_priv.h @@ -101,7 +101,7 @@ enum options_client /** First mysql version supporting the performance schema. */ -#define FIRST_PERFORMANCE_SCHEMA_VERSION 50600 +#define FIRST_PERFORMANCE_SCHEMA_VERSION 50599 /** Name of the performance schema database. diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 2a425edb379..d56ada00266 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -501,7 +501,19 @@ int init_embedded_server(int argc, char **argv, char **groups) */ logger.init_base(); - if (init_common_variables("my", *argcp, *argvp, (const char **)groups)) + orig_argc= *argcp; + orig_argv= *argvp; + load_defaults("my", (const char **)groups, argcp, argvp); + defaults_argc= *argcp; + defaults_argv= *argvp; + remaining_argc= argc; + remaining_argv= argv; + + /* Must be initialized early for comparison of options name */ + system_charset_info= &my_charset_utf8_general_ci; + sys_var_init(); + + if (init_common_variables()) { mysql_server_end(); return 1; diff --git a/mysql-test/include/have_perfschema.inc b/mysql-test/include/have_perfschema.inc new file mode 100644 index 00000000000..6d52a53b6b1 --- /dev/null +++ b/mysql-test/include/have_perfschema.inc @@ -0,0 +1,20 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +if (!`SELECT count(*) FROM information_schema.engines WHERE + (support = 'YES' OR support = 'DEFAULT') AND + engine = 'PERFORMANCE_SCHEMA'`){ + skip Need performance schema compiled in; +} diff --git a/mysql-test/suite/sys_vars/r/all_vars.result b/mysql-test/suite/sys_vars/r/all_vars.result index abd1f5d2bd6..0f741ff930a 100644 --- a/mysql-test/suite/sys_vars/r/all_vars.result +++ b/mysql-test/suite/sys_vars/r/all_vars.result @@ -1,12 +1,14 @@ create table t1 (test_name text); +create table t2 (variable_name text); load data infile "MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1; -select variable_name as `There should be *no* variables listed below:` - from information_schema.global_variables -left join t1 on variable_name=test_name where -test_name is null -union -select variable_name from information_schema.session_variables -left join t1 on variable_name=test_name where -test_name is null; +insert into t2 select variable_name from information_schema.global_variables; +insert into t2 select variable_name from information_schema.session_variables; +update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); +select variable_name as `There should be *no* long test name listed below:` from t2 +where length(variable_name) > 50; +There should be *no* long test name listed below: +select variable_name as `There should be *no* variables listed below:` from t2 +left join t1 on variable_name=test_name where test_name is null; There should be *no* variables listed below: drop table t1; +drop table t2; diff --git a/mysql-test/suite/sys_vars/r/performance_schema_basic.result b/mysql-test/suite/sys_vars/r/performance_schema_basic.result new file mode 100644 index 00000000000..d494b64502b --- /dev/null +++ b/mysql-test/suite/sys_vars/r/performance_schema_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema; +@@global.performance_schema +1 +select @@session.performance_schema; +ERROR HY000: Variable 'performance_schema' is a GLOBAL variable +show global variables like 'performance_schema'; +Variable_name Value +performance_schema ON +show session variables like 'performance_schema'; +Variable_name Value +performance_schema ON +select * from information_schema.global_variables +where variable_name='performance_schema'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA ON +select * from information_schema.session_variables +where variable_name='performance_schema'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA ON +set global performance_schema=1; +ERROR HY000: Variable 'performance_schema' is a read only variable +set session performance_schema=1; +ERROR HY000: Variable 'performance_schema' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_events_waits_history_long_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_events_waits_history_long_size_basic.result new file mode 100644 index 00000000000..6aa1b0b6325 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_events_waits_history_long_size_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_events_waits_history_long_size; +@@global.performance_schema_events_waits_history_long_size +15000 +select @@session.performance_schema_events_waits_history_long_size; +ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a GLOBAL variable +show global variables like 'performance_schema_events_waits_history_long_size'; +Variable_name Value +performance_schema_events_waits_history_long_size 15000 +show session variables like 'performance_schema_events_waits_history_long_size'; +Variable_name Value +performance_schema_events_waits_history_long_size 15000 +select * from information_schema.global_variables +where variable_name='performance_schema_events_waits_history_long_size'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE 15000 +select * from information_schema.session_variables +where variable_name='performance_schema_events_waits_history_long_size'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_LONG_SIZE 15000 +set global performance_schema_events_waits_history_long_size=1; +ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a read only variable +set session performance_schema_events_waits_history_long_size=1; +ERROR HY000: Variable 'performance_schema_events_waits_history_long_size' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_events_waits_history_size_basic.result b/mysql-test/suite/sys_vars/r/pfs_events_waits_history_size_basic.result new file mode 100644 index 00000000000..defa4eca1d4 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_events_waits_history_size_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_events_waits_history_size; +@@global.performance_schema_events_waits_history_size +15 +select @@session.performance_schema_events_waits_history_size; +ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a GLOBAL variable +show global variables like 'performance_schema_events_waits_history_size'; +Variable_name Value +performance_schema_events_waits_history_size 15 +show session variables like 'performance_schema_events_waits_history_size'; +Variable_name Value +performance_schema_events_waits_history_size 15 +select * from information_schema.global_variables +where variable_name='performance_schema_events_waits_history_size'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE 15 +select * from information_schema.session_variables +where variable_name='performance_schema_events_waits_history_size'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_EVENTS_WAITS_HISTORY_SIZE 15 +set global performance_schema_events_waits_history_size=1; +ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a read only variable +set session performance_schema_events_waits_history_size=1; +ERROR HY000: Variable 'performance_schema_events_waits_history_size' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_cond_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_cond_classes_basic.result new file mode 100644 index 00000000000..ec980a90cbd --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_cond_classes_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_cond_classes; +@@global.performance_schema_max_cond_classes +123 +select @@session.performance_schema_max_cond_classes; +ERROR HY000: Variable 'performance_schema_max_cond_classes' is a GLOBAL variable +show global variables like 'performance_schema_max_cond_classes'; +Variable_name Value +performance_schema_max_cond_classes 123 +show session variables like 'performance_schema_max_cond_classes'; +Variable_name Value +performance_schema_max_cond_classes 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_cond_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_COND_CLASSES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_cond_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_COND_CLASSES 123 +set global performance_schema_max_cond_classes=1; +ERROR HY000: Variable 'performance_schema_max_cond_classes' is a read only variable +set session performance_schema_max_cond_classes=1; +ERROR HY000: Variable 'performance_schema_max_cond_classes' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_cond_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_cond_instances_basic.result new file mode 100644 index 00000000000..5bdb24ed0b8 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_cond_instances_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_cond_instances; +@@global.performance_schema_max_cond_instances +123 +select @@session.performance_schema_max_cond_instances; +ERROR HY000: Variable 'performance_schema_max_cond_instances' is a GLOBAL variable +show global variables like 'performance_schema_max_cond_instances'; +Variable_name Value +performance_schema_max_cond_instances 123 +show session variables like 'performance_schema_max_cond_instances'; +Variable_name Value +performance_schema_max_cond_instances 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_cond_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_COND_INSTANCES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_cond_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_COND_INSTANCES 123 +set global performance_schema_max_cond_instances=1; +ERROR HY000: Variable 'performance_schema_max_cond_instances' is a read only variable +set session performance_schema_max_cond_instances=1; +ERROR HY000: Variable 'performance_schema_max_cond_instances' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_file_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_file_classes_basic.result new file mode 100644 index 00000000000..47eaa449106 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_file_classes_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_file_classes; +@@global.performance_schema_max_file_classes +123 +select @@session.performance_schema_max_file_classes; +ERROR HY000: Variable 'performance_schema_max_file_classes' is a GLOBAL variable +show global variables like 'performance_schema_max_file_classes'; +Variable_name Value +performance_schema_max_file_classes 123 +show session variables like 'performance_schema_max_file_classes'; +Variable_name Value +performance_schema_max_file_classes 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_file_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_FILE_CLASSES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_file_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_FILE_CLASSES 123 +set global performance_schema_max_file_classes=1; +ERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable +set session performance_schema_max_file_classes=1; +ERROR HY000: Variable 'performance_schema_max_file_classes' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_file_handles_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_file_handles_basic.result new file mode 100644 index 00000000000..7d210ea3103 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_file_handles_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_file_handles; +@@global.performance_schema_max_file_handles +123 +select @@session.performance_schema_max_file_handles; +ERROR HY000: Variable 'performance_schema_max_file_handles' is a GLOBAL variable +show global variables like 'performance_schema_max_file_handles'; +Variable_name Value +performance_schema_max_file_handles 123 +show session variables like 'performance_schema_max_file_handles'; +Variable_name Value +performance_schema_max_file_handles 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_file_handles'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_FILE_HANDLES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_file_handles'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_FILE_HANDLES 123 +set global performance_schema_max_file_handles=1; +ERROR HY000: Variable 'performance_schema_max_file_handles' is a read only variable +set session performance_schema_max_file_handles=1; +ERROR HY000: Variable 'performance_schema_max_file_handles' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_file_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_file_instances_basic.result new file mode 100644 index 00000000000..097d4c14ed1 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_file_instances_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_file_instances; +@@global.performance_schema_max_file_instances +123 +select @@session.performance_schema_max_file_instances; +ERROR HY000: Variable 'performance_schema_max_file_instances' is a GLOBAL variable +show global variables like 'performance_schema_max_file_instances'; +Variable_name Value +performance_schema_max_file_instances 123 +show session variables like 'performance_schema_max_file_instances'; +Variable_name Value +performance_schema_max_file_instances 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_file_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_file_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_FILE_INSTANCES 123 +set global performance_schema_max_file_instances=1; +ERROR HY000: Variable 'performance_schema_max_file_instances' is a read only variable +set session performance_schema_max_file_instances=1; +ERROR HY000: Variable 'performance_schema_max_file_instances' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_mutex_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_mutex_classes_basic.result new file mode 100644 index 00000000000..f2b75ef9540 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_mutex_classes_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_mutex_classes; +@@global.performance_schema_max_mutex_classes +123 +select @@session.performance_schema_max_mutex_classes; +ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a GLOBAL variable +show global variables like 'performance_schema_max_mutex_classes'; +Variable_name Value +performance_schema_max_mutex_classes 123 +show session variables like 'performance_schema_max_mutex_classes'; +Variable_name Value +performance_schema_max_mutex_classes 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_mutex_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_mutex_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_MUTEX_CLASSES 123 +set global performance_schema_max_mutex_classes=1; +ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a read only variable +set session performance_schema_max_mutex_classes=1; +ERROR HY000: Variable 'performance_schema_max_mutex_classes' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_mutex_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_mutex_instances_basic.result new file mode 100644 index 00000000000..f12fa6ace03 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_mutex_instances_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_mutex_instances; +@@global.performance_schema_max_mutex_instances +123 +select @@session.performance_schema_max_mutex_instances; +ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a GLOBAL variable +show global variables like 'performance_schema_max_mutex_instances'; +Variable_name Value +performance_schema_max_mutex_instances 123 +show session variables like 'performance_schema_max_mutex_instances'; +Variable_name Value +performance_schema_max_mutex_instances 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_mutex_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_mutex_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_MUTEX_INSTANCES 123 +set global performance_schema_max_mutex_instances=1; +ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a read only variable +set session performance_schema_max_mutex_instances=1; +ERROR HY000: Variable 'performance_schema_max_mutex_instances' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_rwlock_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_rwlock_classes_basic.result new file mode 100644 index 00000000000..6c2d4b773c0 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_rwlock_classes_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_rwlock_classes; +@@global.performance_schema_max_rwlock_classes +123 +select @@session.performance_schema_max_rwlock_classes; +ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a GLOBAL variable +show global variables like 'performance_schema_max_rwlock_classes'; +Variable_name Value +performance_schema_max_rwlock_classes 123 +show session variables like 'performance_schema_max_rwlock_classes'; +Variable_name Value +performance_schema_max_rwlock_classes 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_rwlock_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_rwlock_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_RWLOCK_CLASSES 123 +set global performance_schema_max_rwlock_classes=1; +ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a read only variable +set session performance_schema_max_rwlock_classes=1; +ERROR HY000: Variable 'performance_schema_max_rwlock_classes' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_rwlock_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_rwlock_instances_basic.result new file mode 100644 index 00000000000..169387d369d --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_rwlock_instances_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_rwlock_instances; +@@global.performance_schema_max_rwlock_instances +123 +select @@session.performance_schema_max_rwlock_instances; +ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a GLOBAL variable +show global variables like 'performance_schema_max_rwlock_instances'; +Variable_name Value +performance_schema_max_rwlock_instances 123 +show session variables like 'performance_schema_max_rwlock_instances'; +Variable_name Value +performance_schema_max_rwlock_instances 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_rwlock_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_rwlock_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_RWLOCK_INSTANCES 123 +set global performance_schema_max_rwlock_instances=1; +ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a read only variable +set session performance_schema_max_rwlock_instances=1; +ERROR HY000: Variable 'performance_schema_max_rwlock_instances' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_table_handles_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_table_handles_basic.result new file mode 100644 index 00000000000..5f661b0ecdd --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_table_handles_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_table_handles; +@@global.performance_schema_max_table_handles +123 +select @@session.performance_schema_max_table_handles; +ERROR HY000: Variable 'performance_schema_max_table_handles' is a GLOBAL variable +show global variables like 'performance_schema_max_table_handles'; +Variable_name Value +performance_schema_max_table_handles 123 +show session variables like 'performance_schema_max_table_handles'; +Variable_name Value +performance_schema_max_table_handles 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_table_handles'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_table_handles'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_TABLE_HANDLES 123 +set global performance_schema_max_table_handles=1; +ERROR HY000: Variable 'performance_schema_max_table_handles' is a read only variable +set session performance_schema_max_table_handles=1; +ERROR HY000: Variable 'performance_schema_max_table_handles' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_table_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_table_instances_basic.result new file mode 100644 index 00000000000..8497527abb5 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_table_instances_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_table_instances; +@@global.performance_schema_max_table_instances +123 +select @@session.performance_schema_max_table_instances; +ERROR HY000: Variable 'performance_schema_max_table_instances' is a GLOBAL variable +show global variables like 'performance_schema_max_table_instances'; +Variable_name Value +performance_schema_max_table_instances 123 +show session variables like 'performance_schema_max_table_instances'; +Variable_name Value +performance_schema_max_table_instances 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_table_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_table_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_TABLE_INSTANCES 123 +set global performance_schema_max_table_instances=1; +ERROR HY000: Variable 'performance_schema_max_table_instances' is a read only variable +set session performance_schema_max_table_instances=1; +ERROR HY000: Variable 'performance_schema_max_table_instances' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_thread_classes_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_thread_classes_basic.result new file mode 100644 index 00000000000..9d45e13b46e --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_thread_classes_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_thread_classes; +@@global.performance_schema_max_thread_classes +123 +select @@session.performance_schema_max_thread_classes; +ERROR HY000: Variable 'performance_schema_max_thread_classes' is a GLOBAL variable +show global variables like 'performance_schema_max_thread_classes'; +Variable_name Value +performance_schema_max_thread_classes 123 +show session variables like 'performance_schema_max_thread_classes'; +Variable_name Value +performance_schema_max_thread_classes 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_thread_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_thread_classes'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_THREAD_CLASSES 123 +set global performance_schema_max_thread_classes=1; +ERROR HY000: Variable 'performance_schema_max_thread_classes' is a read only variable +set session performance_schema_max_thread_classes=1; +ERROR HY000: Variable 'performance_schema_max_thread_classes' is a read only variable diff --git a/mysql-test/suite/sys_vars/r/pfs_max_thread_instances_basic.result b/mysql-test/suite/sys_vars/r/pfs_max_thread_instances_basic.result new file mode 100644 index 00000000000..dbb3967ad33 --- /dev/null +++ b/mysql-test/suite/sys_vars/r/pfs_max_thread_instances_basic.result @@ -0,0 +1,23 @@ +select @@global.performance_schema_max_thread_instances; +@@global.performance_schema_max_thread_instances +123 +select @@session.performance_schema_max_thread_instances; +ERROR HY000: Variable 'performance_schema_max_thread_instances' is a GLOBAL variable +show global variables like 'performance_schema_max_thread_instances'; +Variable_name Value +performance_schema_max_thread_instances 123 +show session variables like 'performance_schema_max_thread_instances'; +Variable_name Value +performance_schema_max_thread_instances 123 +select * from information_schema.global_variables +where variable_name='performance_schema_max_thread_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES 123 +select * from information_schema.session_variables +where variable_name='performance_schema_max_thread_instances'; +VARIABLE_NAME VARIABLE_VALUE +PERFORMANCE_SCHEMA_MAX_THREAD_INSTANCES 123 +set global performance_schema_max_thread_instances=1; +ERROR HY000: Variable 'performance_schema_max_thread_instances' is a read only variable +set session performance_schema_max_thread_instances=1; +ERROR HY000: Variable 'performance_schema_max_thread_instances' is a read only variable diff --git a/mysql-test/suite/sys_vars/t/all_vars.test b/mysql-test/suite/sys_vars/t/all_vars.test index c6c228d842f..6a18b5e3d37 100644 --- a/mysql-test/suite/sys_vars/t/all_vars.test +++ b/mysql-test/suite/sys_vars/t/all_vars.test @@ -1,3 +1,18 @@ +# Copyright (C) 2009-2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + --source include/not_embedded.inc # @@ -20,16 +35,26 @@ perl; EOF create table t1 (test_name text); +create table t2 (variable_name text); --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR eval load data infile "$MYSQLTEST_VARDIR/tmp/sys_vars.all_vars.txt" into table t1; -select variable_name as `There should be *no* variables listed below:` - from information_schema.global_variables - left join t1 on variable_name=test_name where - test_name is null - union -select variable_name from information_schema.session_variables - left join t1 on variable_name=test_name where - test_name is null; +insert into t2 select variable_name from information_schema.global_variables; +insert into t2 select variable_name from information_schema.session_variables; + +# Performance schema variables are too long for files named +# 'mysql-test/suite/sys_vars/t/' ... +# ... 'performance_schema_events_waits_history_long_size_basic-master.opt' +# to fit in the tar source distribution (limit in old tar) +# Renaming the tests to aliases below. + +update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); + +select variable_name as `There should be *no* long test name listed below:` from t2 + where length(variable_name) > 50; + +select variable_name as `There should be *no* variables listed below:` from t2 + left join t1 on variable_name=test_name where test_name is null; drop table t1; +drop table t2; diff --git a/mysql-test/suite/sys_vars/t/performance_schema_basic-master.opt b/mysql-test/suite/sys_vars/t/performance_schema_basic-master.opt new file mode 100644 index 00000000000..542720c44d7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/performance_schema_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema diff --git a/mysql-test/suite/sys_vars/t/performance_schema_basic.test b/mysql-test/suite/sys_vars/t/performance_schema_basic.test new file mode 100644 index 00000000000..804e6261921 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/performance_schema_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema; + +show global variables like 'performance_schema'; + +show session variables like 'performance_schema'; + +select * from information_schema.global_variables + where variable_name='performance_schema'; + +select * from information_schema.session_variables + where variable_name='performance_schema'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic-master.opt new file mode 100644 index 00000000000..ff1dd2a8c05 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-events-waits-history-long-size=15000 diff --git a/mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic.test new file mode 100644 index 00000000000..bf6638803bc --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_long_size_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_events_waits_history_long_size; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_events_waits_history_long_size; + +show global variables like 'performance_schema_events_waits_history_long_size'; + +show session variables like 'performance_schema_events_waits_history_long_size'; + +select * from information_schema.global_variables + where variable_name='performance_schema_events_waits_history_long_size'; + +select * from information_schema.session_variables + where variable_name='performance_schema_events_waits_history_long_size'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_events_waits_history_long_size=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_events_waits_history_long_size=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic-master.opt new file mode 100644 index 00000000000..488707fc962 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-events-waits-history-size=15 diff --git a/mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic.test b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic.test new file mode 100644 index 00000000000..28338ad1ffd --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_events_waits_history_size_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_events_waits_history_size; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_events_waits_history_size; + +show global variables like 'performance_schema_events_waits_history_size'; + +show session variables like 'performance_schema_events_waits_history_size'; + +select * from information_schema.global_variables + where variable_name='performance_schema_events_waits_history_size'; + +select * from information_schema.session_variables + where variable_name='performance_schema_events_waits_history_size'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_events_waits_history_size=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_events_waits_history_size=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic-master.opt new file mode 100644 index 00000000000..438bc463289 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-cond-classes=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test new file mode 100644 index 00000000000..70a757087f8 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_cond_classes_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_cond_classes; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_cond_classes; + +show global variables like 'performance_schema_max_cond_classes'; + +show session variables like 'performance_schema_max_cond_classes'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_cond_classes'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_cond_classes'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_cond_classes=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_cond_classes=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic-master.opt new file mode 100644 index 00000000000..47b9d629655 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-cond-instances=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic.test new file mode 100644 index 00000000000..597ad334295 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_cond_instances_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_cond_instances; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_cond_instances; + +show global variables like 'performance_schema_max_cond_instances'; + +show session variables like 'performance_schema_max_cond_instances'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_cond_instances'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_cond_instances'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_cond_instances=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_cond_instances=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic-master.opt new file mode 100644 index 00000000000..6ed54f9f99d --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-file-classes=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test new file mode 100644 index 00000000000..8536a703afa --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_file_classes_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_file_classes; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_file_classes; + +show global variables like 'performance_schema_max_file_classes'; + +show session variables like 'performance_schema_max_file_classes'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_file_classes'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_file_classes'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_file_classes=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_file_classes=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic-master.opt new file mode 100644 index 00000000000..04633ae0897 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-file-handles=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test new file mode 100644 index 00000000000..ba702a030d7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_file_handles_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_file_handles; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_file_handles; + +show global variables like 'performance_schema_max_file_handles'; + +show session variables like 'performance_schema_max_file_handles'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_file_handles'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_file_handles'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_file_handles=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_file_handles=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic-master.opt new file mode 100644 index 00000000000..078a998c1e7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-file-instances=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic.test new file mode 100644 index 00000000000..829df39bbe9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_file_instances_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_file_instances; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_file_instances; + +show global variables like 'performance_schema_max_file_instances'; + +show session variables like 'performance_schema_max_file_instances'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_file_instances'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_file_instances'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_file_instances=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_file_instances=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic-master.opt new file mode 100644 index 00000000000..1525916a1ef --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-mutex-classes=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test new file mode 100644 index 00000000000..633d1a3487c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_mutex_classes_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_mutex_classes; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_mutex_classes; + +show global variables like 'performance_schema_max_mutex_classes'; + +show session variables like 'performance_schema_max_mutex_classes'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_mutex_classes'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_mutex_classes'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_mutex_classes=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_mutex_classes=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic-master.opt new file mode 100644 index 00000000000..98ce2ff3df9 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-mutex-instances=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic.test new file mode 100644 index 00000000000..2a8f5e5ae00 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_mutex_instances_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_mutex_instances; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_mutex_instances; + +show global variables like 'performance_schema_max_mutex_instances'; + +show session variables like 'performance_schema_max_mutex_instances'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_mutex_instances'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_mutex_instances'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_mutex_instances=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_mutex_instances=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic-master.opt new file mode 100644 index 00000000000..b5d5318635f --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-rwlock-classes=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic.test new file mode 100644 index 00000000000..ce911b60049 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_classes_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_rwlock_classes; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_rwlock_classes; + +show global variables like 'performance_schema_max_rwlock_classes'; + +show session variables like 'performance_schema_max_rwlock_classes'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_rwlock_classes'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_rwlock_classes'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_rwlock_classes=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_rwlock_classes=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic-master.opt new file mode 100644 index 00000000000..5dcecd99c0a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-rwlock-instances=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic.test new file mode 100644 index 00000000000..d16c1c46f68 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_rwlock_instances_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_rwlock_instances; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_rwlock_instances; + +show global variables like 'performance_schema_max_rwlock_instances'; + +show session variables like 'performance_schema_max_rwlock_instances'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_rwlock_instances'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_rwlock_instances'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_rwlock_instances=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_rwlock_instances=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic-master.opt new file mode 100644 index 00000000000..45e73c51f8c --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-table-handles=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test new file mode 100644 index 00000000000..3ede0985a70 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_table_handles_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_table_handles; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_table_handles; + +show global variables like 'performance_schema_max_table_handles'; + +show session variables like 'performance_schema_max_table_handles'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_table_handles'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_table_handles'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_table_handles=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_table_handles=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic-master.opt new file mode 100644 index 00000000000..b8b0ba4b40b --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-table-instances=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic.test new file mode 100644 index 00000000000..fcd4886ca22 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_table_instances_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_table_instances; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_table_instances; + +show global variables like 'performance_schema_max_table_instances'; + +show session variables like 'performance_schema_max_table_instances'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_table_instances'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_table_instances'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_table_instances=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_table_instances=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic-master.opt new file mode 100644 index 00000000000..c0b64e5889a --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-thread-classes=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic.test new file mode 100644 index 00000000000..4704e87cf06 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_thread_classes_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_thread_classes; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_thread_classes; + +show global variables like 'performance_schema_max_thread_classes'; + +show session variables like 'performance_schema_max_thread_classes'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_thread_classes'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_thread_classes'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_thread_classes=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_thread_classes=1; + diff --git a/mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic-master.opt b/mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic-master.opt new file mode 100644 index 00000000000..b70eda8acb1 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance-schema-max-thread-instances=123 diff --git a/mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic.test b/mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic.test new file mode 100644 index 00000000000..d709c097f20 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/pfs_max_thread_instances_basic.test @@ -0,0 +1,47 @@ +# Copyright (C) 2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Only global +# + +select @@global.performance_schema_max_thread_instances; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +select @@session.performance_schema_max_thread_instances; + +show global variables like 'performance_schema_max_thread_instances'; + +show session variables like 'performance_schema_max_thread_instances'; + +select * from information_schema.global_variables + where variable_name='performance_schema_max_thread_instances'; + +select * from information_schema.session_variables + where variable_name='performance_schema_max_thread_instances'; + +# +# Read-only +# + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set global performance_schema_max_thread_instances=1; + +--error ER_INCORRECT_GLOBAL_LOCAL_VAR +set session performance_schema_max_thread_instances=1; + diff --git a/mysys/my_init.c b/mysys/my_init.c index 8145dc6fb6a..31adc5ed99e 100644 --- a/mysys/my_init.c +++ b/mysys/my_init.c @@ -600,7 +600,7 @@ PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc, key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net, key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time, - key_TMPDIR_mutex; + key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap; static PSI_mutex_info all_mysys_mutexes[]= { @@ -630,7 +630,8 @@ static PSI_mutex_info all_mysys_mutexes[]= { &key_THR_LOCK_open, "THR_LOCK_open", PSI_FLAG_GLOBAL}, { &key_THR_LOCK_threads, "THR_LOCK_threads", PSI_FLAG_GLOBAL}, { &key_THR_LOCK_time, "THR_LOCK_time", PSI_FLAG_GLOBAL}, - { &key_TMPDIR_mutex, "TMPDIR_mutex", PSI_FLAG_GLOBAL} + { &key_TMPDIR_mutex, "TMPDIR_mutex", PSI_FLAG_GLOBAL}, + { &key_THR_LOCK_myisam_mmap, "THR_LOCK_myisam_mmap", PSI_FLAG_GLOBAL} }; PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond, diff --git a/mysys/my_thr_init.c b/mysys/my_thr_init.c index a06bbb64c8b..83d35863eca 100644 --- a/mysys/my_thr_init.c +++ b/mysys/my_thr_init.c @@ -24,8 +24,8 @@ #ifdef THREAD pthread_key(struct st_my_thread_var*, THR_KEY_mysys); -mysql_mutex_t THR_LOCK_malloc,THR_LOCK_open, - THR_LOCK_lock,THR_LOCK_isam,THR_LOCK_myisam,THR_LOCK_heap, +mysql_mutex_t THR_LOCK_malloc, THR_LOCK_open, + THR_LOCK_lock, THR_LOCK_isam, THR_LOCK_myisam, THR_LOCK_heap, THR_LOCK_net, THR_LOCK_charset, THR_LOCK_threads, THR_LOCK_time, THR_LOCK_myisam_mmap; diff --git a/mysys/mysys_priv.h b/mysys/mysys_priv.h index 3a663dfefbf..1f84d8d3aab 100644 --- a/mysys/mysys_priv.h +++ b/mysys/mysys_priv.h @@ -47,7 +47,7 @@ extern PSI_mutex_key key_BITMAP_mutex, key_IO_CACHE_append_buffer_lock, key_THR_LOCK_isam, key_THR_LOCK_lock, key_THR_LOCK_malloc, key_THR_LOCK_mutex, key_THR_LOCK_myisam, key_THR_LOCK_net, key_THR_LOCK_open, key_THR_LOCK_threads, key_THR_LOCK_time, - key_TMPDIR_mutex; + key_TMPDIR_mutex, key_THR_LOCK_myisam_mmap; extern PSI_cond_key key_COND_alarm, key_IO_CACHE_SHARE_cond, key_IO_CACHE_SHARE_cond_writer, key_my_thread_var_suspend, diff --git a/sql/authors.h b/sql/authors.h index ec46e368f5f..555fe2ae43a 100644 --- a/sql/authors.h +++ b/sql/authors.h @@ -39,7 +39,7 @@ struct show_table_authors_st { struct show_table_authors_st show_table_authors[]= { { "Brian (Krow) Aker", "Seattle, WA, USA", "Architecture, archive, federated, bunch of little stuff :)" }, - { "Marc Alff", "Denver, CO, USA", "Signal, Resignal" }, + { "Marc Alff", "Denver, CO, USA", "Signal, Resignal, Performance schema" }, { "Venu Anuganti", "", "Client/server protocol (4.1)" }, { "David Axmark", "Uppsala, Sweden", "Small stuff long time ago, Monty ripped it out!" }, diff --git a/sql/derror.cc b/sql/derror.cc index 95481e3212f..8e47dda7bbe 100644 --- a/sql/derror.cc +++ b/sql/derror.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2005 MySQL AB +/* Copyright (C) 2000-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,10 +107,10 @@ bool read_texts(const char *file_name, const char *language, funktpos=0; convert_dirname(lang_path, language, NullS); (void) my_load_path(lang_path, lang_path, lc_messages_dir); - if ((file=my_open(fn_format(name,file_name, - lang_path, "", 4), - O_RDONLY | O_SHARE | O_BINARY, - MYF(0))) < 0) + if ((file= mysql_file_open(key_file_ERRMSG, + fn_format(name, file_name, lang_path, "", 4), + O_RDONLY | O_SHARE | O_BINARY, + MYF(0))) < 0) { /* Trying pre-5.4 sematics of the --language parameter. @@ -118,16 +118,18 @@ bool read_texts(const char *file_name, const char *language, --language=/path/to/english/ */ - if ((file= my_open(fn_format(name, file_name, lc_messages_dir, "", 4), - O_RDONLY | O_SHARE | O_BINARY, - MYF(0))) < 0) + if ((file= mysql_file_open(key_file_ERRMSG, + fn_format(name, file_name, lc_messages_dir, "", 4), + O_RDONLY | O_SHARE | O_BINARY, + MYF(0))) < 0) goto err; sql_print_error("An old style --language value with language specific part detected: %s", lc_messages_dir); sql_print_error("Use --lc-messages-dir without language specific part instead."); } funktpos=1; - if (my_read(file,(uchar*) head,32,MYF(MY_NABP))) goto err; + if (mysql_file_read(file, (uchar*) head, 32, MYF(MY_NABP))) + goto err; if (head[0] != (uchar) 254 || head[1] != (uchar) 254 || head[2] != 2 || head[3] != 1) goto err; /* purecov: inspected */ @@ -143,7 +145,7 @@ Error message file '%s' had only %d error messages,\n\ but it should contain at least %d error messages.\n\ Check that the above file is the right version for this program!", name,count,error_messages); - (void) my_close(file,MYF(MY_WME)); + (void) mysql_file_close(file, MYF(MY_WME)); DBUG_RETURN(1); } @@ -156,21 +158,21 @@ Check that the above file is the right version for this program!", } buff= (uchar*) (*point + count); - if (my_read(file, buff, (size_t) count*2,MYF(MY_NABP))) + if (mysql_file_read(file, buff, (size_t) count*2, MYF(MY_NABP))) goto err; for (i=0, pos= buff ; i< count ; i++) { (*point)[i]= (char*) buff+uint2korr(pos); pos+=2; } - if (my_read(file, buff, length, MYF(MY_NABP))) + if (mysql_file_read(file, buff, length, MYF(MY_NABP))) goto err; for (i=1 ; i < textcount ; i++) { point[i]= *point +uint2korr(head+10+i+i); } - (void) my_close(file,MYF(0)); + (void) mysql_file_close(file, MYF(0)); DBUG_RETURN(0); err: @@ -187,7 +189,7 @@ err: } sql_print_error(errmsg, name); if (file != FERR) - (void) my_close(file,MYF(MY_WME)); + (void) mysql_file_close(file, MYF(MY_WME)); DBUG_RETURN(1); } /* read_texts */ diff --git a/sql/des_key_file.cc b/sql/des_key_file.cc index 87ad6ff12b0..c2b632e521b 100644 --- a/sql/des_key_file.cc +++ b/sql/des_key_file.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2003, 2005 MySQL AB +/* Copyright (C) 2001-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,8 +43,9 @@ load_des_key_file(const char *file_name) DBUG_ENTER("load_des_key_file"); DBUG_PRINT("enter",("name: %s",file_name)); - pthread_mutex_lock(&LOCK_des_key_file); - if ((file=my_open(file_name,O_RDONLY | O_BINARY ,MYF(MY_WME))) < 0 || + mysql_mutex_lock(&LOCK_des_key_file); + if ((file= mysql_file_open(key_file_des_key_file, file_name, + O_RDONLY | O_BINARY, MYF(MY_WME))) < 0 || init_io_cache(&io, file, IO_SIZE*2, READ_CACHE, 0, 0, MYF(MY_WME))) goto error; @@ -93,10 +94,10 @@ load_des_key_file(const char *file_name) error: if (file >= 0) { - my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); end_io_cache(&io); } - pthread_mutex_unlock(&LOCK_des_key_file); + mysql_mutex_unlock(&LOCK_des_key_file); DBUG_RETURN(result); } #endif /* HAVE_OPENSSL */ diff --git a/sql/discover.cc b/sql/discover.cc index f475cfbf72a..fcc26042fe2 100644 --- a/sql/discover.cc +++ b/sql/discover.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -57,15 +57,16 @@ int readfrm(const char *name, uchar **frmdata, size_t *len) *frmdata= NULL; // In case of errors *len= 0; error= 1; - if ((file=my_open(fn_format(index_file,name,"",reg_ext, - MY_UNPACK_FILENAME|MY_APPEND_EXT), - O_RDONLY | O_SHARE, - MYF(0))) < 0) + if ((file= mysql_file_open(key_file_frm, + fn_format(index_file, name, "", reg_ext, + MY_UNPACK_FILENAME|MY_APPEND_EXT), + O_RDONLY | O_SHARE, + MYF(0))) < 0) goto err_end; // Get length of file error= 2; - if (my_fstat(file, &state, MYF(0))) + if (mysql_file_fstat(file, &state, MYF(0))) goto err; read_len= state.st_size; @@ -82,7 +83,7 @@ int readfrm(const char *name, uchar **frmdata, size_t *len) err: if (file > 0) - (void) my_close(file,MYF(MY_WME)); + (void) mysql_file_close(file, MYF(MY_WME)); err_end: /* Here when no file */ DBUG_RETURN (error); @@ -112,13 +113,15 @@ int writefrm(const char *name, const uchar *frmdata, size_t len) DBUG_PRINT("enter",("name: '%s' len: %lu ",name, (ulong) len)); error= 0; - if ((file=my_create(fn_format(index_file,name,"",reg_ext, - MY_UNPACK_FILENAME|MY_APPEND_EXT), - CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0) + if ((file= mysql_file_create(key_file_frm, + fn_format(index_file, name, "", reg_ext, + MY_UNPACK_FILENAME | MY_APPEND_EXT), + CREATE_MODE, O_RDWR | O_TRUNC, + MYF(MY_WME))) >= 0) { - if (my_write(file, frmdata, len,MYF(MY_WME | MY_NABP))) + if (mysql_file_write(file, frmdata, len, MYF(MY_WME | MY_NABP))) error= 2; - (void) my_close(file,MYF(0)); + (void) mysql_file_close(file, MYF(0)); } DBUG_RETURN(error); } /* writefrm */ diff --git a/sql/event_data_objects.cc b/sql/event_data_objects.cc index b2bbd340e14..fd9561eb132 100644 --- a/sql/event_data_objects.cc +++ b/sql/event_data_objects.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1402,8 +1402,7 @@ Event_job_data::execute(THD *thd, bool drop) } #endif - if (check_access(thd, EVENT_ACL, dbname.str, - 0, 0, 0, is_schema_db(dbname.str))) + if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0)) { /* This aspect of behavior is defined in the worklog, diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 04d4f858b43..7d987db411a 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -94,16 +94,16 @@ Event_queue::Event_queue() mutex_queue_data_attempting_lock(FALSE), waiting_on_cond(FALSE) { - pthread_mutex_init(&LOCK_event_queue, MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_queue_state, NULL); + mysql_mutex_init(key_LOCK_event_queue, &LOCK_event_queue, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_queue_state, &COND_queue_state, NULL); } Event_queue::~Event_queue() { deinit_queue(); - pthread_mutex_destroy(&LOCK_event_queue); - pthread_cond_destroy(&COND_queue_state); + mysql_mutex_destroy(&LOCK_event_queue); + mysql_cond_destroy(&COND_queue_state); } @@ -210,7 +210,7 @@ Event_queue::create_event(THD *thd, Event_queue_element *new_element, LOCK_QUEUE_DATA(); *created= (queue_insert_safe(&queue, (uchar *) new_element) == FALSE); dbug_dump_queue(thd->query_start()); - pthread_cond_broadcast(&COND_queue_state); + mysql_cond_broadcast(&COND_queue_state); UNLOCK_QUEUE_DATA(); DBUG_RETURN(!*created); @@ -258,7 +258,7 @@ Event_queue::update_event(THD *thd, LEX_STRING dbname, LEX_STRING name, { DBUG_PRINT("info", ("new event in the queue: 0x%lx", (long) new_element)); queue_insert_safe(&queue, (uchar *) new_element); - pthread_cond_broadcast(&COND_queue_state); + mysql_cond_broadcast(&COND_queue_state); } dbug_dump_queue(thd->query_start()); @@ -669,7 +669,7 @@ Event_queue::lock_data(const char *func, uint line) mutex_last_attempted_lock_in_func= func; mutex_last_attempted_lock_at_line= line; mutex_queue_data_attempting_lock= TRUE; - pthread_mutex_lock(&LOCK_event_queue); + mysql_mutex_lock(&LOCK_event_queue); mutex_last_attempted_lock_in_func= ""; mutex_last_attempted_lock_at_line= 0; mutex_queue_data_attempting_lock= FALSE; @@ -700,7 +700,7 @@ Event_queue::unlock_data(const char *func, uint line) mutex_last_unlocked_at_line= line; mutex_queue_data_locked= FALSE; mutex_last_unlocked_in_func= func; - pthread_mutex_unlock(&LOCK_event_queue); + mysql_mutex_unlock(&LOCK_event_queue); DBUG_VOID_RETURN; } @@ -731,9 +731,9 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg, DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":"")); if (!abstime) - pthread_cond_wait(&COND_queue_state, &LOCK_event_queue); + mysql_cond_wait(&COND_queue_state, &LOCK_event_queue); else - pthread_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime); + mysql_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime); mutex_last_locked_in_func= func; mutex_last_locked_at_line= line; diff --git a/sql/event_queue.h b/sql/event_queue.h index 2870ecb4d0b..aac9eb04e98 100644 --- a/sql/event_queue.h +++ b/sql/event_queue.h @@ -1,6 +1,6 @@ #ifndef _EVENT_QUEUE_H_ #define _EVENT_QUEUE_H_ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,11 @@ Queue of events awaiting execution. */ +#ifdef HAVE_PSI_INTERFACE +extern PSI_mutex_key key_LOCK_event_queue; +extern PSI_cond_key key_COND_queue_state; +#endif /* HAVE_PSI_INTERFACE */ + class Event_basic; class Event_queue_element; class Event_queue_element_for_exec; @@ -101,8 +106,8 @@ private: dbug_dump_queue(time_t now); /* LOCK_event_queue is the mutex which protects the access to the queue. */ - pthread_mutex_t LOCK_event_queue; - pthread_cond_t COND_queue_state; + mysql_mutex_t LOCK_event_queue; + mysql_cond_t COND_queue_state; /* The sorted queue with the Event_queue_element objects */ QUEUE queue; diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 00d03e04b70..486b03fc58e 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -163,7 +163,7 @@ deinit_event_thread(THD *thd) /* - Performs pre- pthread_create() initialisation of THD. Do this + Performs pre- mysql_thread_create() initialisation of THD. Do this in the thread that will pass THD to the child thread. In the child thread call post_init_event_thread(). @@ -227,6 +227,9 @@ event_scheduler_thread(void *arg) bool res; thd->thread_stack= (char *)&thd; // remember where our stack is + + mysql_thread_set_psi_id(thd->thread_id); + res= post_init_event_thread(thd); DBUG_ENTER("event_scheduler_thread"); @@ -259,6 +262,8 @@ event_worker_thread(void *arg) thd= event->thd; + mysql_thread_set_psi_id(thd->thread_id); + Event_worker_thread worker_thread; worker_thread.run(thd, event); @@ -335,16 +340,17 @@ Event_scheduler::Event_scheduler(Event_queue *queue_arg) waiting_on_cond(FALSE), started_events(0) { - pthread_mutex_init(&LOCK_scheduler_state, MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_state, NULL); + mysql_mutex_init(key_event_scheduler_LOCK_scheduler_state, + &LOCK_scheduler_state, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_event_scheduler_COND_state, &COND_state, NULL); } Event_scheduler::~Event_scheduler() { stop(); /* does nothing if not running */ - pthread_mutex_destroy(&LOCK_scheduler_state); - pthread_cond_destroy(&COND_state); + mysql_mutex_destroy(&LOCK_scheduler_state); + mysql_cond_destroy(&COND_state); } @@ -403,8 +409,9 @@ Event_scheduler::start() DBUG_PRINT("info", ("Setting state go RUNNING")); state= RUNNING; DBUG_PRINT("info", ("Forking new thread for scheduler. THD: 0x%lx", (long) new_thd)); - if (pthread_create(&th, &connection_attrib, event_scheduler_thread, - (void*)scheduler_param_value)) + if (mysql_thread_create(key_thread_event_scheduler, + &th, &connection_attrib, event_scheduler_thread, + (void*)scheduler_param_value)) { DBUG_PRINT("error", ("cannot create a new thread")); state= INITIALIZED; @@ -487,7 +494,7 @@ Event_scheduler::run(THD *thd) scheduler_thd= NULL; state= INITIALIZED; DBUG_PRINT("info", ("Signalling back to the stopper COND_state")); - pthread_cond_signal(&COND_state); + mysql_cond_signal(&COND_state); UNLOCK_DATA(); DBUG_RETURN(res); @@ -531,8 +538,9 @@ Event_scheduler::execute_top(Event_queue_element_for_exec *event_name) reasonable level. */ /* Major failure */ - if ((res= pthread_create(&th, &connection_attrib, event_worker_thread, - event_name))) + if ((res= mysql_thread_create(key_thread_event_worker, + &th, &connection_attrib, event_worker_thread, + event_name))) goto error; ++started_events; @@ -632,13 +640,13 @@ Event_scheduler::stop() DBUG_PRINT("info", ("Scheduler thread has id %lu", scheduler_thd->thread_id)); /* Lock from delete */ - pthread_mutex_lock(&scheduler_thd->LOCK_thd_data); + mysql_mutex_lock(&scheduler_thd->LOCK_thd_data); /* This will wake up the thread if it waits on Queue's conditional */ sql_print_information("Event Scheduler: Killing the scheduler thread, " "thread id %lu", scheduler_thd->thread_id); scheduler_thd->awake(THD::KILL_CONNECTION); - pthread_mutex_unlock(&scheduler_thd->LOCK_thd_data); + mysql_mutex_unlock(&scheduler_thd->LOCK_thd_data); /* thd could be 0x0, when shutting down */ sql_print_information("Event Scheduler: " @@ -693,7 +701,7 @@ Event_scheduler::lock_data(const char *func, uint line) { DBUG_ENTER("Event_scheduler::lock_data"); DBUG_PRINT("enter", ("func=%s line=%u", func, line)); - pthread_mutex_lock(&LOCK_scheduler_state); + mysql_mutex_lock(&LOCK_scheduler_state); mutex_last_locked_in_func= func; mutex_last_locked_at_line= line; mutex_scheduler_data_locked= TRUE; @@ -719,7 +727,7 @@ Event_scheduler::unlock_data(const char *func, uint line) mutex_last_unlocked_at_line= line; mutex_scheduler_data_locked= FALSE; mutex_last_unlocked_in_func= func; - pthread_mutex_unlock(&LOCK_scheduler_state); + mysql_mutex_unlock(&LOCK_scheduler_state); DBUG_VOID_RETURN; } @@ -750,9 +758,9 @@ Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const char* msg, DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":"")); if (!abstime) - pthread_cond_wait(&COND_state, &LOCK_scheduler_state); + mysql_cond_wait(&COND_state, &LOCK_scheduler_state); else - pthread_cond_timedwait(&COND_state, &LOCK_scheduler_state, abstime); + mysql_cond_timedwait(&COND_state, &LOCK_scheduler_state, abstime); if (thd) { /* diff --git a/sql/event_scheduler.h b/sql/event_scheduler.h index 0be93a65d33..2988f354f63 100644 --- a/sql/event_scheduler.h +++ b/sql/event_scheduler.h @@ -1,6 +1,6 @@ #ifndef _EVENT_SCHEDULER_H_ #define _EVENT_SCHEDULER_H_ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -115,7 +115,7 @@ private: cond_wait(THD *thd, struct timespec *abstime, const char* msg, const char *func, uint line); - pthread_mutex_t LOCK_scheduler_state; + mysql_mutex_t LOCK_scheduler_state; enum enum_state { @@ -129,7 +129,7 @@ private: THD *scheduler_thd; - pthread_cond_t COND_state; + mysql_cond_t COND_state; Event_queue *queue; diff --git a/sql/events.cc b/sql/events.cc index b0803ab57d0..8b81fa7951d 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -68,7 +68,7 @@ Event_queue *Events::event_queue; Event_scheduler *Events::scheduler; Event_db_repository *Events::db_repository; uint Events::opt_event_scheduler= Events::EVENTS_OFF; -pthread_mutex_t Events::LOCK_event_metadata; +mysql_mutex_t Events::LOCK_event_metadata; bool Events::check_system_tables_error= FALSE; @@ -319,8 +319,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, /* At create, one of them must be set */ DBUG_ASSERT(parse_data->expression || parse_data->execute_at); - if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0, - is_schema_db(parse_data->dbname.str))) + if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0)) DBUG_RETURN(TRUE); if (check_db_dir_existence(parse_data->dbname.str)) @@ -338,7 +337,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, if (thd->current_stmt_binlog_row_based) thd->clear_current_stmt_binlog_row_based(); - pthread_mutex_lock(&LOCK_event_metadata); + mysql_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->create_event(thd, parse_data, if_not_exists))) @@ -383,7 +382,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data, ret= write_bin_log(thd, TRUE, log_query.c_ptr(), log_query.length()); } } - pthread_mutex_unlock(&LOCK_event_metadata); + mysql_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); } @@ -430,8 +429,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, if (parse_data->check_parse_data(thd) || parse_data->do_not_create) DBUG_RETURN(TRUE); - if (check_access(thd, EVENT_ACL, parse_data->dbname.str, 0, 0, 0, - is_schema_db(parse_data->dbname.str))) + if (check_access(thd, EVENT_ACL, parse_data->dbname.str, NULL, NULL, 0, 0)) DBUG_RETURN(TRUE); if (new_dbname) /* It's a rename */ @@ -452,8 +450,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, to tell the user that a database doesn't exist if they can not access it. */ - if (check_access(thd, EVENT_ACL, new_dbname->str, 0, 0, 0, - is_schema_db(new_dbname->str))) + if (check_access(thd, EVENT_ACL, new_dbname->str, NULL, NULL, 0, 0)) DBUG_RETURN(TRUE); /* Check that the target database exists */ @@ -471,7 +468,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, if (thd->current_stmt_binlog_row_based) thd->clear_current_stmt_binlog_row_based(); - pthread_mutex_lock(&LOCK_event_metadata); + mysql_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->update_event(thd, parse_data, @@ -504,7 +501,7 @@ Events::update_event(THD *thd, Event_parse_data *parse_data, ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } } - pthread_mutex_unlock(&LOCK_event_metadata); + mysql_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); } @@ -557,8 +554,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) if (check_if_system_tables_error()) DBUG_RETURN(TRUE); - if (check_access(thd, EVENT_ACL, dbname.str, 0, 0, 0, - is_schema_db(dbname.str))) + if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0)) DBUG_RETURN(TRUE); /* @@ -568,7 +564,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) if (thd->current_stmt_binlog_row_based) thd->clear_current_stmt_binlog_row_based(); - pthread_mutex_lock(&LOCK_event_metadata); + mysql_mutex_lock(&LOCK_event_metadata); /* On error conditions my_error() is called so no need to handle here */ if (!(ret= db_repository->drop_event(thd, dbname, name, if_exists))) { @@ -578,7 +574,7 @@ Events::drop_event(THD *thd, LEX_STRING dbname, LEX_STRING name, bool if_exists) DBUG_ASSERT(thd->query() && thd->query_length()); ret= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } - pthread_mutex_unlock(&LOCK_event_metadata); + mysql_mutex_unlock(&LOCK_event_metadata); DBUG_RETURN(ret); } @@ -607,11 +603,11 @@ Events::drop_schema_events(THD *thd, char *db) are damaged, as intended. */ - pthread_mutex_lock(&LOCK_event_metadata); + mysql_mutex_lock(&LOCK_event_metadata); if (event_queue) event_queue->drop_schema_events(thd, db_lex); db_repository->drop_schema_events(thd, db_lex); - pthread_mutex_unlock(&LOCK_event_metadata); + mysql_mutex_unlock(&LOCK_event_metadata); DBUG_VOID_RETURN; } @@ -714,8 +710,7 @@ Events::show_create_event(THD *thd, LEX_STRING dbname, LEX_STRING name) if (check_if_system_tables_error()) DBUG_RETURN(TRUE); - if (check_access(thd, EVENT_ACL, dbname.str, 0, 0, 0, - is_schema_db(dbname.str))) + if (check_access(thd, EVENT_ACL, dbname.str, NULL, NULL, 0, 0)) DBUG_RETURN(TRUE); /* @@ -773,8 +768,9 @@ Events::fill_schema_events(THD *thd, TABLE_LIST *tables, COND * /* cond */) if (thd->lex->sql_command == SQLCOM_SHOW_EVENTS) { DBUG_ASSERT(thd->lex->select_lex.db); - if (!is_schema_db(thd->lex->select_lex.db) && // There is no events in I_S - check_access(thd, EVENT_ACL, thd->lex->select_lex.db, 0, 0, 0, 0)) + if (!is_infoschema_db(thd->lex->select_lex.db) && // There is no events in I_S + check_access(thd, EVENT_ACL, thd->lex->select_lex.db, + NULL, NULL, 0, 0)) DBUG_RETURN(1); db= thd->lex->select_lex.db; } @@ -934,6 +930,51 @@ Events::deinit() DBUG_VOID_RETURN; } +#ifdef HAVE_PSI_INTERFACE +PSI_mutex_key key_LOCK_event_metadata, key_LOCK_event_queue, + key_event_scheduler_LOCK_scheduler_state; + +static PSI_mutex_info all_events_mutexes[]= +{ + { &key_LOCK_event_metadata, "LOCK_event_metadata", PSI_FLAG_GLOBAL}, + { &key_LOCK_event_queue, "LOCK_event_queue", PSI_FLAG_GLOBAL}, + { &key_event_scheduler_LOCK_scheduler_state, "Event_scheduler::LOCK_scheduler_state", PSI_FLAG_GLOBAL} +}; + +PSI_cond_key key_event_scheduler_COND_state, key_COND_queue_state; + +static PSI_cond_info all_events_conds[]= +{ + { &key_event_scheduler_COND_state, "Event_scheduler::COND_state", PSI_FLAG_GLOBAL}, + { &key_COND_queue_state, "COND_queue_state", PSI_FLAG_GLOBAL}, +}; + +PSI_thread_key key_thread_event_scheduler, key_thread_event_worker; + +static PSI_thread_info all_events_threads[]= +{ + { &key_thread_event_scheduler, "event_scheduler", PSI_FLAG_GLOBAL}, + { &key_thread_event_worker, "event_worker", 0} +}; + +static void init_events_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_events_mutexes); + PSI_server->register_mutex(category, all_events_mutexes, count); + + count= array_elements(all_events_conds); + PSI_server->register_cond(category, all_events_conds, count); + + count= array_elements(all_events_threads); + PSI_server->register_thread(category, all_events_threads, count); +} +#endif /* HAVE_PSI_INTERFACE */ /** Inits Events mutexes @@ -946,7 +987,12 @@ Events::deinit() void Events::init_mutexes() { - pthread_mutex_init(&LOCK_event_metadata, MY_MUTEX_INIT_FAST); +#ifdef HAVE_PSI_INTERFACE + init_events_psi_keys(); +#endif + + mysql_mutex_init(key_LOCK_event_metadata, + &LOCK_event_metadata, MY_MUTEX_INIT_FAST); } @@ -960,7 +1006,7 @@ Events::init_mutexes() void Events::destroy_mutexes() { - pthread_mutex_destroy(&LOCK_event_metadata); + mysql_mutex_destroy(&LOCK_event_metadata); } @@ -982,7 +1028,7 @@ Events::dump_internal_status() puts("LLA = Last Locked At LUA = Last Unlocked At"); puts("WOC = Waiting On Condition DL = Data Locked"); - pthread_mutex_lock(&LOCK_event_metadata); + mysql_mutex_lock(&LOCK_event_metadata); if (opt_event_scheduler == EVENTS_DISABLED) puts("The Event Scheduler is disabled"); else @@ -991,7 +1037,7 @@ Events::dump_internal_status() event_queue->dump_internal_status(); } - pthread_mutex_unlock(&LOCK_event_metadata); + mysql_mutex_unlock(&LOCK_event_metadata); DBUG_VOID_RETURN; } diff --git a/sql/events.h b/sql/events.h index 8f68d5a8029..881ade37cbf 100644 --- a/sql/events.h +++ b/sql/events.h @@ -1,6 +1,6 @@ #ifndef _EVENT_H_ #define _EVENT_H_ -/* Copyright (C) 2004-2006 MySQL AB +/* Copyright (C) 2004-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,6 +25,13 @@ A public interface of Events_Scheduler module. */ +#ifdef HAVE_PSI_INTERFACE +extern PSI_mutex_key key_LOCK_event_metadata, + key_event_scheduler_LOCK_scheduler_state; +extern PSI_cond_key key_event_scheduler_COND_state; +extern PSI_thread_key key_thread_event_scheduler, key_thread_event_worker; +#endif /* HAVE_PSI_INTERFACE */ + class Event_parse_data; class Event_db_repository; class Event_queue; @@ -77,7 +84,7 @@ public: */ enum enum_opt_event_scheduler { EVENTS_OFF, EVENTS_ON, EVENTS_DISABLED }; static uint opt_event_scheduler; - static pthread_mutex_t LOCK_event_metadata; + static mysql_mutex_t LOCK_event_metadata; static bool check_if_system_tables_error(); static bool start(); static bool stop(); diff --git a/sql/filesort.cc b/sql/filesort.cc index 3104e6824b0..c6156b8243f 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1119,8 +1119,9 @@ uint read_to_buffer(IO_CACHE *fromfile, BUFFPEK *buffpek, if ((count=(uint) min((ha_rows) buffpek->max_keys,buffpek->count))) { - if (my_pread(fromfile->file,(uchar*) buffpek->base, - (length= rec_length*count),buffpek->file_pos,MYF_RW)) + if (mysql_file_pread(fromfile->file, (uchar*) buffpek->base, + (length= rec_length*count), + buffpek->file_pos, MYF_RW)) return((uint) -1); /* purecov: inspected */ buffpek->key=buffpek->base; buffpek->file_pos+= length; /* New filepos */ diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index b820b6d939d..b254d5d387c 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -264,7 +264,7 @@ Ndb_cluster_connection* g_ndb_cluster_connection= NULL; uchar g_node_id_map[max_ndb_nodes]; /// Handler synchronization -pthread_mutex_t ndbcluster_mutex; +mysql_mutex_t ndbcluster_mutex; /// Table lock handling HASH ndbcluster_open_tables; @@ -281,9 +281,9 @@ static int ndb_get_table_statistics(ha_ndbcluster*, bool, Ndb*, const NDBTAB *, // Util thread variables pthread_t ndb_util_thread; int ndb_util_thread_running= 0; -pthread_mutex_t LOCK_ndb_util_thread; -pthread_cond_t COND_ndb_util_thread; -pthread_cond_t COND_ndb_util_ready; +mysql_mutex_t LOCK_ndb_util_thread; +mysql_cond_t COND_ndb_util_thread; +mysql_cond_t COND_ndb_util_ready; pthread_handler_t ndb_util_thread_func(void *arg); /** @@ -4778,11 +4778,11 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type) thd_ndb->changed_tables.push_back(m_share, &thd->transaction.mem_root); } - pthread_mutex_lock(&m_share->mutex); + mysql_mutex_lock(&m_share->mutex); DBUG_PRINT("info", ("Invalidating commit_count")); m_share->commit_count= 0; m_share->commit_count_lock++; - pthread_mutex_unlock(&m_share->mutex); + mysql_mutex_unlock(&m_share->mutex); } if (!--thd_ndb->lock_count) @@ -4943,12 +4943,12 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all) List_iterator_fast it(thd_ndb->changed_tables); while ((share= it++)) { - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %lu", share->table_name, (ulong) share->commit_count)); share->commit_count= 0; share->commit_count_lock++; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); } thd_ndb->changed_tables.empty(); @@ -5622,7 +5622,7 @@ int ha_ndbcluster::create(const char *name, if (!my_errno) { NDB_SHARE *share= 0; - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); /* First make sure we get a "fresh" share here, not an old trailing one... */ @@ -5647,7 +5647,7 @@ int ha_ndbcluster::create(const char *name, DBUG_PRINT("NDB_SHARE", ("%s binlog create use_count: %u", share->key, share->use_count)); } - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); while (!IS_TMP_PREFIX(m_tabname)) { @@ -6286,7 +6286,7 @@ retry_temporary_error1: /* the drop table failed for some reason, drop the share anyways */ if (share) { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); if (share->state != NSS_DROPPED) { /* @@ -6302,7 +6302,7 @@ retry_temporary_error1: DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u", share->key, share->use_count)); free_share(&share, TRUE); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); } #endif DBUG_RETURN(res); @@ -6343,7 +6343,7 @@ retry_temporary_error1: if (share) { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); if (share->state != NSS_DROPPED) { /* @@ -6359,7 +6359,7 @@ retry_temporary_error1: DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u", share->key, share->use_count)); free_share(&share, TRUE); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); } #endif DBUG_RETURN(0); @@ -7451,7 +7451,7 @@ int ndbcluster_find_files(handlerton *hton, THD *thd, /* Call back after cluster connect */ static int connect_callback() { - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); update_status_variables(g_ndb_cluster_connection); uint node_id, i= 0; @@ -7460,13 +7460,92 @@ static int connect_callback() while ((node_id= g_ndb_cluster_connection->get_next_node(node_iter))) g_node_id_map[node_id]= i++; - pthread_cond_signal(&COND_ndb_util_thread); - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_cond_signal(&COND_ndb_util_thread); + mysql_mutex_unlock(&LOCK_ndb_util_thread); return 0; } extern int ndb_dictionary_is_mysqld; -extern pthread_mutex_t LOCK_plugin; +extern mysql_mutex_t LOCK_plugin; + +#ifdef HAVE_PSI_INTERFACE + +#ifdef HAVE_NDB_BINLOG +PSI_mutex_key key_injector_mutex, key_ndb_schema_share_mutex, + key_ndb_schema_object_mutex; +#endif /* HAVE_NDB_BINLOG */ + +PSI_mutex_key key_NDB_SHARE_mutex, key_ndbcluster_mutex, + key_LOCK_ndb_util_thread; + +static PSI_mutex_info all_ndbcluster_mutexes[]= +{ +#ifdef HAVE_NDB_BINLOG + {& key_injector_mutex, "injector_mutex", PSI_FLAG_GLOBAL}, + {& key_ndb_schema_share_mutex, "ndb_schema_share_mutex", PSI_FLAG_GLOBAL}, + {& key_ndb_schema_object_mutex, "ndb_schema_object_mutex", PSI_FLAG_GLOBAL}, +#endif /* HAVE_NDB_BINLOG */ + {& key_NDB_SHARE_mutex, "NDB_SHARE::mutex", PSI_FLAG_GLOBAL}, + {& key_ndbcluster_mutex, "ndbcluster_mutex", PSI_FLAG_GLOBAL}, + {& key_LOCK_ndb_util_thread, "LOCK_ndb_util_thread", PSI_FLAG_GLOBAL} +}; + +#ifdef HAVE_NDB_BINLOG +PSI_cond_key key_injector_cond; +#endif /* HAVE_NDB_BINLOG */ + +PSI_cond_key key_COND_ndb_util_thread, key_COND_ndb_util_ready; + +static PSI_cond_info all_ndbcluster_conds[]= +{ +#ifdef HAVE_NDB_BINLOG + {& key_injector_cond, "injector_cond", PSI_FLAG_GLOBAL}, +#endif /* HAVE_NDB_BINLOG */ + {& key_COND_ndb_util_thread, "COND_ndb_util_thread", PSI_FLAG_GLOBAL}, + {& key_COND_ndb_util_ready, "COND_ndb_util_ready", PSI_FLAG_GLOBAL} +}; + +#ifdef HAVE_NDB_BINLOG +PSI_thread_key key_thread_ndb_binlog; +#endif /* HAVE_NDB_BINLOG */ +PSI_thread_key key_thread_ndb_util; + +static PSI_thread_info all_ndbcluster_threads[]= +{ +#ifdef HAVE_NDB_BINLOG + { &key_thread_ndb_binlog, "ndb_binlog", PSI_FLAG_GLOBAL}, +#endif /* HAVE_NDB_BINLOG */ + { &key_thread_ndb_util, "ndb_util", PSI_FLAG_GLOBAL} +}; + +PSI_file_key key_file_ndb; + +static PSI_file_info all_ndbcluster_files[]= +{ + { &key_file_ndb, "ndb", 0} +}; + +void init_ndbcluster_psi_keys() +{ + const char* category= "ndbcluster"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_ndbcluster_mutexes); + PSI_server->register_mutex(category, all_ndbcluster_mutexes, count); + + count= array_elements(all_ndbcluster_conds); + PSI_server->register_cond(category, all_ndbcluster_conds, count); + + count= array_elements(all_ndbcluster_threads); + PSI_server->register_thread(category, all_ndbcluster_threads, count); + + count= array_elements(all_ndbcluster_files); + PSI_server->register_file(category, all_ndbcluster_files, count); +} +#endif /* HAVE_PSI_INTERFACE */ static int ndbcluster_init(void *p) { @@ -7476,17 +7555,23 @@ static int ndbcluster_init(void *p) if (ndbcluster_inited) DBUG_RETURN(FALSE); +#ifdef HAVE_PSI_INTERFACE + init_ndbcluster_psi_keys(); +#endif + /* Below we create new THD's. They'll need LOCK_plugin, but it's taken now by plugin initialization code. Release it to avoid deadlocks. It's safe, as there're no threads that may concurrently access plugin control structures. */ - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); - pthread_mutex_init(&ndbcluster_mutex,MY_MUTEX_INIT_FAST); - pthread_mutex_init(&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_ndb_util_thread, NULL); - pthread_cond_init(&COND_ndb_util_ready, NULL); + mysql_mutex_init(key_ndbcluster_mutex, + &ndbcluster_mutex, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_ndb_util_thread, + &LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_ndb_util_thread, &COND_ndb_util_thread, NULL); + mysql_cond_init(key_COND_ndb_util_ready, &COND_ndb_util_ready, NULL); ndb_util_thread_running= -1; ndbcluster_terminating= 0; ndb_dictionary_is_mysqld= 1; @@ -7608,35 +7693,36 @@ static int ndbcluster_init(void *p) // Create utility thread pthread_t tmp; - if (pthread_create(&tmp, &connection_attrib, ndb_util_thread_func, 0)) + if (mysql_thread_create(key_thread_ndb_util, + &tmp, &connection_attrib, ndb_util_thread_func, 0)) { DBUG_PRINT("error", ("Could not create ndb utility thread")); my_hash_free(&ndbcluster_open_tables); - pthread_mutex_destroy(&ndbcluster_mutex); - pthread_mutex_destroy(&LOCK_ndb_util_thread); - pthread_cond_destroy(&COND_ndb_util_thread); - pthread_cond_destroy(&COND_ndb_util_ready); + mysql_mutex_destroy(&ndbcluster_mutex); + mysql_mutex_destroy(&LOCK_ndb_util_thread); + mysql_cond_destroy(&COND_ndb_util_thread); + mysql_cond_destroy(&COND_ndb_util_ready); goto ndbcluster_init_error; } /* Wait for the util thread to start */ - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); while (ndb_util_thread_running < 0) - pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread); - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread); + mysql_mutex_unlock(&LOCK_ndb_util_thread); if (!ndb_util_thread_running) { DBUG_PRINT("error", ("ndb utility thread exited prematurely")); my_hash_free(&ndbcluster_open_tables); - pthread_mutex_destroy(&ndbcluster_mutex); - pthread_mutex_destroy(&LOCK_ndb_util_thread); - pthread_cond_destroy(&COND_ndb_util_thread); - pthread_cond_destroy(&COND_ndb_util_ready); + mysql_mutex_destroy(&ndbcluster_mutex); + mysql_mutex_destroy(&LOCK_ndb_util_thread); + mysql_cond_destroy(&COND_ndb_util_thread); + mysql_cond_destroy(&COND_ndb_util_ready); goto ndbcluster_init_error; } - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); ndbcluster_inited= 1; DBUG_RETURN(FALSE); @@ -7650,7 +7736,7 @@ ndbcluster_init_error: g_ndb_cluster_connection= NULL; ndbcluster_hton->state= SHOW_OPTION_DISABLED; // If we couldn't use handler - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); DBUG_RETURN(TRUE); } @@ -7693,17 +7779,17 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type) /* wait for util thread to finish */ sql_print_information("Stopping Cluster Utility thread"); - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); ndbcluster_terminating= 1; - pthread_cond_signal(&COND_ndb_util_thread); + mysql_cond_signal(&COND_ndb_util_thread); while (ndb_util_thread_running > 0) - pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread); - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread); + mysql_mutex_unlock(&LOCK_ndb_util_thread); #ifdef HAVE_NDB_BINLOG { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); while (ndbcluster_open_tables.records) { NDB_SHARE *share= @@ -7714,7 +7800,7 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type) #endif ndbcluster_real_free_share(&share); } - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); } #endif my_hash_free(&ndbcluster_open_tables); @@ -7743,10 +7829,10 @@ static int ndbcluster_end(handlerton *hton, ha_panic_function type) // cleanup ndb interface ndb_end_internal(); - pthread_mutex_destroy(&ndbcluster_mutex); - pthread_mutex_destroy(&LOCK_ndb_util_thread); - pthread_cond_destroy(&COND_ndb_util_thread); - pthread_cond_destroy(&COND_ndb_util_ready); + mysql_mutex_destroy(&ndbcluster_mutex); + mysql_mutex_destroy(&LOCK_ndb_util_thread); + mysql_cond_destroy(&COND_ndb_util_thread); + mysql_cond_destroy(&COND_ndb_util_ready); DBUG_RETURN(0); } @@ -8049,12 +8135,12 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, build_table_filename(name, sizeof(name) - 1, dbname, tabname, "", 0); DBUG_PRINT("enter", ("name: %s", name)); - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); if (!(share=(NDB_SHARE*) my_hash_search(&ndbcluster_open_tables, (uchar*) name, strlen(name)))) { - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_PRINT("info", ("Table %s not found in ndbcluster_open_tables", name)); DBUG_RETURN(1); } @@ -8062,9 +8148,9 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, share->use_count++; DBUG_PRINT("NDB_SHARE", ("%s temporary use_count: %u", share->key, share->use_count)); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); if (opt_ndb_cache_check_time > 0) { if (share->commit_count != 0) @@ -8075,7 +8161,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, #endif DBUG_PRINT("info", ("Getting commit_count: %s from share", llstr(share->commit_count, buff))); - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); /* ndb_share reference temporary free */ DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u", share->key, share->use_count)); @@ -8092,7 +8178,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, ERR_RETURN(ndb->getNdbError()); } uint lock= share->commit_count_lock; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); struct Ndb_statistics stat; { @@ -8108,7 +8194,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, } } - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); if (share->commit_count_lock == lock) { #ifndef DBUG_OFF @@ -8124,7 +8210,7 @@ uint ndb_get_commitcount(THD *thd, char *dbname, char *tabname, DBUG_PRINT("info", ("Discarding commit_count, comit_count_lock changed")); *commit_count= 0; } - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); /* ndb_share reference temporary free */ DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u", share->key, share->use_count)); @@ -8340,7 +8426,7 @@ static void print_ndbcluster_open_tables() to avoid segmentation faults. There is a risk that the memory for this trailing share leaks. - Must be called with previous pthread_mutex_lock(&ndbcluster_mutex) + Must be called with previous mysql_mutex_lock(&ndbcluster_mutex) */ int handle_trailing_share(NDB_SHARE *share) { @@ -8352,7 +8438,7 @@ int handle_trailing_share(NDB_SHARE *share) ++share->use_count; DBUG_PRINT("NDB_SHARE", ("%s temporary use_count: %u", share->key, share->use_count)); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); TABLE_LIST table_list; bzero((char*) &table_list,sizeof(table_list)); @@ -8361,7 +8447,7 @@ int handle_trailing_share(NDB_SHARE *share) mysql_mutex_assert_owner(&LOCK_open); close_cached_tables(thd, &table_list, TRUE, FALSE, FALSE); - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); /* ndb_share reference temporary free */ DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u", share->key, share->use_count)); @@ -8452,7 +8538,7 @@ int handle_trailing_share(NDB_SHARE *share) static int rename_share(NDB_SHARE *share, const char *new_key) { NDB_SHARE *tmp; - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); uint new_length= (uint) strlen(new_key); DBUG_PRINT("rename_share", ("old_key: %s old__length: %d", share->key, share->key_length)); @@ -8490,7 +8576,7 @@ static int rename_share(NDB_SHARE *share, const char *new_key) share->key)); } dbug_print_open_tables(); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); return -1; } dbug_print_open_tables(); @@ -8515,7 +8601,7 @@ static int rename_share(NDB_SHARE *share, const char *new_key) share->old_names= old_key; // ToDo free old_names after ALTER EVENT - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); return 0; } #endif @@ -8526,12 +8612,12 @@ static int rename_share(NDB_SHARE *share, const char *new_key) */ NDB_SHARE *ndbcluster_get_share(NDB_SHARE *share) { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); share->use_count++; dbug_print_open_tables(); dbug_print_share("ndbcluster_get_share:", share); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); return share; } @@ -8548,7 +8634,7 @@ NDB_SHARE *ndbcluster_get_share(NDB_SHARE *share) create_if_not_exists == FALSE: returns 0 if share does not exist - have_lock == TRUE, pthread_mutex_lock(&ndbcluster_mutex) already taken + have_lock == TRUE, mysql_mutex_lock(&ndbcluster_mutex) already taken */ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, @@ -8561,7 +8647,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, DBUG_PRINT("enter", ("key: '%s'", key)); if (!have_lock) - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); if (!(share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables, (uchar*) key, length))) @@ -8570,7 +8656,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, { DBUG_PRINT("error", ("get_share: %s does not exist", key)); if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(0); } if ((share= (NDB_SHARE*) my_malloc(sizeof(*share), @@ -8592,11 +8678,11 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, my_free((uchar*) share, 0); *root_ptr= old_root; if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(0); } thr_lock_init(&share->lock); - pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_NDB_SHARE_mutex, &share->mutex, MY_MUTEX_INIT_FAST); share->commit_count= 0; share->commit_count_lock= 0; share->db= share->key + length + 1; @@ -8610,7 +8696,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, ndbcluster_real_free_share(&share); *root_ptr= old_root; if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(0); } #endif @@ -8620,7 +8706,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, { DBUG_PRINT("error", ("get_share: failed to alloc share")); if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); my_error(ER_OUTOFMEMORY, MYF(0), sizeof(*share)); DBUG_RETURN(0); } @@ -8630,7 +8716,7 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table, dbug_print_open_tables(); dbug_print_share("ndbcluster_get_share:", share); if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(share); } @@ -8642,7 +8728,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share) my_hash_delete(&ndbcluster_open_tables, (uchar*) *share); thr_lock_delete(&(*share)->lock); - pthread_mutex_destroy(&(*share)->mutex); + mysql_mutex_destroy(&(*share)->mutex); #ifdef HAVE_NDB_BINLOG if ((*share)->table) @@ -8671,7 +8757,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share) void ndbcluster_free_share(NDB_SHARE **share, bool have_lock) { if (!have_lock) - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); if ((*share)->util_lock == current_thd) (*share)->util_lock= 0; if (!--(*share)->use_count) @@ -8684,7 +8770,7 @@ void ndbcluster_free_share(NDB_SHARE **share, bool have_lock) dbug_print_share("ndbcluster_free_share:", *share); } if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); } @@ -8844,11 +8930,12 @@ int ha_ndbcluster::write_ndb_file(const char *name) (void)strxnmov(path, FN_REFLEN-1, mysql_data_home,"/",name,ha_ndb_ext,NullS); - if ((file=my_create(path, CREATE_MODE,O_RDWR | O_TRUNC,MYF(MY_WME))) >= 0) + if ((file= mysql_file_create(key_file_ndb, path, CREATE_MODE, + O_RDWR | O_TRUNC, MYF(MY_WME))) >= 0) { // It's an empty file error=0; - my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); } DBUG_RETURN(error); } @@ -9401,7 +9488,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) DBUG_ENTER("ndb_util_thread"); DBUG_PRINT("enter", ("cache_check_time: %lu", opt_ndb_cache_check_time)); - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); thd= new THD; /* note that contructor of THD uses DBUG_ */ if (thd == NULL) @@ -9434,45 +9521,45 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) /* Signal successful initialization */ ndb_util_thread_running= 1; - pthread_cond_signal(&COND_ndb_util_ready); - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_cond_signal(&COND_ndb_util_ready); + mysql_mutex_unlock(&LOCK_ndb_util_thread); /* wait for mysql server to start */ - pthread_mutex_lock(&LOCK_server_started); + mysql_mutex_lock(&LOCK_server_started); while (!mysqld_server_started) { set_timespec(abstime, 1); - pthread_cond_timedwait(&COND_server_started, &LOCK_server_started, - &abstime); + mysql_cond_timedwait(&COND_server_started, &LOCK_server_started, + &abstime); if (ndbcluster_terminating) { - pthread_mutex_unlock(&LOCK_server_started); - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_unlock(&LOCK_server_started); + mysql_mutex_lock(&LOCK_ndb_util_thread); goto ndb_util_thread_end; } } - pthread_mutex_unlock(&LOCK_server_started); + mysql_mutex_unlock(&LOCK_server_started); /* Wait for cluster to start */ - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); while (!ndb_cluster_node_id && (ndbcluster_hton->slot != ~(uint)0)) { /* ndb not connected yet */ - pthread_cond_wait(&COND_ndb_util_thread, &LOCK_ndb_util_thread); + mysql_cond_wait(&COND_ndb_util_thread, &LOCK_ndb_util_thread); if (ndbcluster_terminating) goto ndb_util_thread_end; } - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_mutex_unlock(&LOCK_ndb_util_thread); /* Get thd_ndb for this thread */ if (!(thd_ndb= ha_ndbcluster::seize_thd_ndb())) { sql_print_error("Could not allocate Thd_ndb object"); - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); goto ndb_util_thread_end; } set_thd_ndb(thd, thd_ndb); @@ -9493,14 +9580,14 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) set_timespec(abstime, 0); for (;;) { - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); if (!ndbcluster_terminating) - pthread_cond_timedwait(&COND_ndb_util_thread, - &LOCK_ndb_util_thread, - &abstime); + mysql_cond_timedwait(&COND_ndb_util_thread, + &LOCK_ndb_util_thread, + &abstime); if (ndbcluster_terminating) /* Shutting down server */ goto ndb_util_thread_end; - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_mutex_unlock(&LOCK_ndb_util_thread); #ifdef NDB_EXTRA_DEBUG_UTIL_THREAD DBUG_PRINT("ndb_util_thread", ("Started, opt_ndb_cache_check_time: %lu", opt_ndb_cache_check_time)); @@ -9525,7 +9612,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) /* Lock mutex and fill list with pointers to all open tables */ NDB_SHARE *share; - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); uint i, open_count, record_count= ndbcluster_open_tables.records; if (share_list_size < record_count) { @@ -9534,7 +9621,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) { sql_print_warning("ndb util thread: malloc failure, " "query cache not maintained properly"); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); goto next; // At least do not crash } delete [] share_list; @@ -9561,7 +9648,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) /* Store pointer to table */ share_list[open_count++]= share; } - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); /* Iterate through the open files list */ for (i= 0; i < open_count; i++) @@ -9586,9 +9673,9 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) struct Ndb_statistics stat; uint lock; - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); lock= share->commit_count_lock; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); { /* Contact NDB to get commit count for table */ Ndb* ndb= thd_ndb->ndb; @@ -9619,10 +9706,10 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused))) } } loop_next: - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); if (share->commit_count_lock == lock) share->commit_count= stat.commit_count; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); /* ndb_share reference temporary free */ DBUG_PRINT("NDB_SHARE", ("%s temporary free use_count: %u", @@ -9652,7 +9739,7 @@ next: } } - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); ndb_util_thread_end: net_end(&thd->net); @@ -9664,8 +9751,8 @@ ndb_util_thread_fail: /* signal termination */ ndb_util_thread_running= 0; - pthread_cond_signal(&COND_ndb_util_ready); - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_cond_signal(&COND_ndb_util_ready); + mysql_mutex_unlock(&LOCK_ndb_util_thread); DBUG_PRINT("exit", ("ndb_util_thread")); DBUG_LEAVE; // Must match DBUG_ENTER() diff --git a/sql/ha_ndbcluster.h b/sql/ha_ndbcluster.h index a51dc38bf93..63da24e8dda 100644 --- a/sql/ha_ndbcluster.h +++ b/sql/ha_ndbcluster.h @@ -1,7 +1,7 @@ #ifndef HA_NDBCLUSTER_INCLUDED #define HA_NDBCLUSTER_INCLUDED -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -35,6 +35,10 @@ #define NDB_HIDDEN_PRIMARY_KEY_LENGTH 8 +#ifdef HAVE_PSI_INTERFACE +extern PSI_file_key key_file_ndb; +#endif /* HAVE_PSI_INTERFACE */ + class Ndb; // Forward declaration class NdbOperation; // Forward declaration @@ -102,7 +106,7 @@ typedef struct st_ndbcluster_share { NDB_SHARE_STATE state; MEM_ROOT mem_root; THR_LOCK lock; - pthread_mutex_t mutex; + mysql_mutex_t mutex; char *key; uint key_length; THD *util_lock; @@ -131,9 +135,9 @@ NDB_SHARE_STATE get_ndb_share_state(NDB_SHARE *share) { NDB_SHARE_STATE state; - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); state= share->state; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); return state; } @@ -141,19 +145,19 @@ inline void set_ndb_share_state(NDB_SHARE *share, NDB_SHARE_STATE state) { - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); share->state= state; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); } struct Ndb_tuple_id_range_guard { Ndb_tuple_id_range_guard(NDB_SHARE* _share) : share(_share), range(share->tuple_id_range) { - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); } ~Ndb_tuple_id_range_guard() { - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); } NDB_SHARE* share; Ndb::TupleIdRange& range; @@ -578,6 +582,6 @@ static const char ndbcluster_hton_name[]= "ndbcluster"; static const int ndbcluster_hton_name_length=sizeof(ndbcluster_hton_name)-1; extern int ndbcluster_terminating; extern int ndb_util_thread_running; -extern pthread_cond_t COND_ndb_util_ready; +extern mysql_cond_t COND_ndb_util_ready; #endif /* HA_NDBCLUSTER_INCLUDED */ diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index b59e686d131..25f8474feae 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -79,7 +79,7 @@ THD *injector_thd= 0; to enable ndb injector thread receiving events. Must therefore always be used with a surrounding - pthread_mutex_lock(&injector_mutex), when doing create/dropEventOperation + mysql_mutex_lock(&injector_mutex), when doing create/dropEventOperation */ static Ndb *injector_ndb= 0; static Ndb *schema_ndb= 0; @@ -106,8 +106,8 @@ static int ndbcluster_binlog_terminating= 0; and injector thread */ pthread_t ndb_binlog_thread; -pthread_mutex_t injector_mutex; -pthread_cond_t injector_cond; +mysql_mutex_t injector_mutex; +mysql_cond_t injector_cond; /* NDB Injector thread (used for binlog creation) */ static ulonglong ndb_latest_applied_binlog_epoch= 0; @@ -116,7 +116,7 @@ static ulonglong ndb_latest_received_binlog_epoch= 0; NDB_SHARE *ndb_apply_status_share= 0; NDB_SHARE *ndb_schema_share= 0; -pthread_mutex_t ndb_schema_share_mutex; +mysql_mutex_t ndb_schema_share_mutex; extern my_bool opt_log_slave_updates; static my_bool g_ndb_log_slave_updates; @@ -124,7 +124,7 @@ static my_bool g_ndb_log_slave_updates; /* Schema object distribution handling */ HASH ndb_schema_objects; typedef struct st_ndb_schema_object { - pthread_mutex_t mutex; + mysql_mutex_t mutex; char *key; uint key_length; uint use_count; @@ -641,28 +641,28 @@ static int ndbcluster_binlog_end(THD *thd) however be a likely case as the ndbcluster_binlog_end is supposed to be called before ndb_cluster_end(). */ - pthread_mutex_lock(&LOCK_ndb_util_thread); + mysql_mutex_lock(&LOCK_ndb_util_thread); /* Ensure mutex are not freed if ndb_cluster_end is running at same time */ ndb_util_thread_running++; ndbcluster_terminating= 1; - pthread_cond_signal(&COND_ndb_util_thread); + mysql_cond_signal(&COND_ndb_util_thread); while (ndb_util_thread_running > 1) - pthread_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread); + mysql_cond_wait(&COND_ndb_util_ready, &LOCK_ndb_util_thread); ndb_util_thread_running--; - pthread_mutex_unlock(&LOCK_ndb_util_thread); + mysql_mutex_unlock(&LOCK_ndb_util_thread); } /* wait for injector thread to finish */ ndbcluster_binlog_terminating= 1; - pthread_mutex_lock(&injector_mutex); - pthread_cond_signal(&injector_cond); + mysql_mutex_lock(&injector_mutex); + mysql_cond_signal(&injector_cond); while (ndb_binlog_thread_running > 0) - pthread_cond_wait(&injector_cond, &injector_mutex); - pthread_mutex_unlock(&injector_mutex); + mysql_cond_wait(&injector_cond, &injector_mutex); + mysql_mutex_unlock(&injector_mutex); - pthread_mutex_destroy(&injector_mutex); - pthread_cond_destroy(&injector_cond); - pthread_mutex_destroy(&ndb_schema_share_mutex); + mysql_mutex_destroy(&injector_mutex); + mysql_cond_destroy(&injector_cond); + mysql_mutex_destroy(&ndb_schema_share_mutex); #endif DBUG_RETURN(0); @@ -742,14 +742,14 @@ void ndbcluster_binlog_init_handlerton() */ static NDB_SHARE *ndbcluster_check_ndb_apply_status_share() { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); void *share= my_hash_search(&ndbcluster_open_tables, (uchar*) NDB_APPLY_TABLE_FILE, sizeof(NDB_APPLY_TABLE_FILE) - 1); DBUG_PRINT("info",("ndbcluster_check_ndb_apply_status_share %s 0x%lx", NDB_APPLY_TABLE_FILE, (long) share)); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); return (NDB_SHARE*) share; } @@ -760,14 +760,14 @@ static NDB_SHARE *ndbcluster_check_ndb_apply_status_share() */ static NDB_SHARE *ndbcluster_check_ndb_schema_share() { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); void *share= my_hash_search(&ndbcluster_open_tables, (uchar*) NDB_SCHEMA_TABLE_FILE, sizeof(NDB_SCHEMA_TABLE_FILE) - 1); DBUG_PRINT("info",("ndbcluster_check_ndb_schema_share %s 0x%lx", NDB_SCHEMA_TABLE_FILE, (long) share)); - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); return (NDB_SHARE*) share; } @@ -802,7 +802,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd) { build_table_filename(buf, sizeof(buf) - 1, NDB_REP_DB, NDB_APPLY_TABLE, reg_ext, 0); - my_delete(buf, MYF(0)); + mysql_file_delete(key_file_frm, buf, MYF(0)); } /* @@ -860,7 +860,7 @@ static int ndbcluster_create_schema_table(THD *thd) { build_table_filename(buf, sizeof(buf) - 1, NDB_REP_DB, NDB_SCHEMA_TABLE, reg_ext, 0); - my_delete(buf, MYF(0)); + mysql_file_delete(key_file_frm, buf, MYF(0)); } /* @@ -928,7 +928,7 @@ int ndbcluster_setup_binlog_table_shares(THD *thd) close_cached_tables(NULL, NULL, TRUE, FALSE, FALSE); mysql_mutex_unlock(&LOCK_open); /* Signal injector thread that all is setup */ - pthread_cond_signal(&injector_cond); + mysql_cond_signal(&injector_cond); } return 0; } @@ -1239,12 +1239,12 @@ static void ndb_report_waiting(const char *key, { ulonglong ndb_latest_epoch= 0; const char *proc_info= ""; - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); if (injector_ndb) ndb_latest_epoch= injector_ndb->getLatestGCI(); if (injector_thd) proc_info= injector_thd->proc_info; - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); sql_print_information("NDB %s:" " waiting max %u sec for %s %s." " epochs: (%u,%u,%u)" @@ -1357,15 +1357,15 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, bitmap_set_all(&schema_subscribers); /* begin protect ndb_schema_share */ - pthread_mutex_lock(&ndb_schema_share_mutex); + mysql_mutex_lock(&ndb_schema_share_mutex); if (ndb_schema_share == 0) { - pthread_mutex_unlock(&ndb_schema_share_mutex); + mysql_mutex_unlock(&ndb_schema_share_mutex); if (ndb_schema_object) ndb_free_schema_object(&ndb_schema_object, FALSE); DBUG_RETURN(0); } - (void) pthread_mutex_lock(&ndb_schema_share->mutex); + mysql_mutex_lock(&ndb_schema_share->mutex); for (i= 0; i < no_storage_nodes; i++) { MY_BITMAP *table_subscribers= &ndb_schema_share->subscriber_bitmap[i]; @@ -1376,8 +1376,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, updated= 1; } } - (void) pthread_mutex_unlock(&ndb_schema_share->mutex); - pthread_mutex_unlock(&ndb_schema_share_mutex); + mysql_mutex_unlock(&ndb_schema_share->mutex); + mysql_mutex_unlock(&ndb_schema_share_mutex); /* end protect ndb_schema_share */ if (updated) @@ -1397,10 +1397,10 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, if (ndb_schema_object) { - (void) pthread_mutex_lock(&ndb_schema_object->mutex); + mysql_mutex_lock(&ndb_schema_object->mutex); memcpy(ndb_schema_object->slock, schema_subscribers.bitmap, sizeof(ndb_schema_object->slock)); - (void) pthread_mutex_unlock(&ndb_schema_object->mutex); + mysql_mutex_unlock(&ndb_schema_object->mutex); } DBUG_DUMP("schema_subscribers", (uchar*)schema_subscribers.bitmap, @@ -1566,7 +1566,7 @@ end: dict->forceGCPWait(); int max_timeout= DEFAULT_SYNC_TIMEOUT; - (void) pthread_mutex_lock(&ndb_schema_object->mutex); + mysql_mutex_lock(&ndb_schema_object->mutex); if (have_lock_open) { mysql_mutex_assert_owner(&LOCK_open); @@ -1578,20 +1578,20 @@ end: int i; int no_storage_nodes= g_ndb_cluster_connection->no_db_nodes(); set_timespec(abstime, 1); - int ret= pthread_cond_timedwait(&injector_cond, - &ndb_schema_object->mutex, - &abstime); + int ret= mysql_cond_timedwait(&injector_cond, + &ndb_schema_object->mutex, + &abstime); if (thd->killed) break; /* begin protect ndb_schema_share */ - pthread_mutex_lock(&ndb_schema_share_mutex); + mysql_mutex_lock(&ndb_schema_share_mutex); if (ndb_schema_share == 0) { - pthread_mutex_unlock(&ndb_schema_share_mutex); + mysql_mutex_unlock(&ndb_schema_share_mutex); break; } - (void) pthread_mutex_lock(&ndb_schema_share->mutex); + mysql_mutex_lock(&ndb_schema_share->mutex); for (i= 0; i < no_storage_nodes; i++) { /* remove any unsubscribed from schema_subscribers */ @@ -1599,8 +1599,8 @@ end: if (!bitmap_is_clear_all(tmp)) bitmap_intersect(&schema_subscribers, tmp); } - (void) pthread_mutex_unlock(&ndb_schema_share->mutex); - pthread_mutex_unlock(&ndb_schema_share_mutex); + mysql_mutex_unlock(&ndb_schema_share->mutex); + mysql_mutex_unlock(&ndb_schema_share_mutex); /* end protect ndb_schema_share */ /* remove any unsubscribed from ndb_schema_object->slock */ @@ -1631,7 +1631,7 @@ end: { mysql_mutex_lock(&LOCK_open); } - (void) pthread_mutex_unlock(&ndb_schema_object->mutex); + mysql_mutex_unlock(&ndb_schema_object->mutex); } if (ndb_schema_object) @@ -1761,11 +1761,11 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, if (is_online_alter_table) { /* Signal ha_ndbcluster::alter_table that drop is done */ - (void) pthread_cond_signal(&injector_cond); + mysql_cond_signal(&injector_cond); DBUG_RETURN(0); } - (void) pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); if (is_rename_table && !is_remote_change) { DBUG_PRINT("info", ("Detected name change of table %s.%s", @@ -1801,10 +1801,10 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, // either just us or drop table handling as well /* Signal ha_ndbcluster::delete/rename_table that drop is done */ - (void) pthread_mutex_unlock(&share->mutex); - (void) pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&share->mutex); + mysql_cond_signal(&injector_cond); - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); /* ndb_share reference binlog free */ DBUG_PRINT("NDB_SHARE", ("%s binlog free use_count: %u", share->key, share->use_count)); @@ -1830,14 +1830,14 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, } else share= 0; - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); pOp->setCustomData(0); - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); ndb->dropEventOperation(pOp); pOp= 0; - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); if (do_close_cached_tables) { @@ -2072,7 +2072,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, "read only on reconnect."); /* begin protect ndb_schema_share */ - pthread_mutex_lock(&ndb_schema_share_mutex); + mysql_mutex_lock(&ndb_schema_share_mutex); /* ndb_share reference binlog extra free */ DBUG_PRINT("NDB_SHARE", ("%s binlog extra free use_count: %u", ndb_schema_share->key, @@ -2080,7 +2080,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, free_share(&ndb_schema_share); ndb_schema_share= 0; ndb_binlog_tables_inited= 0; - pthread_mutex_unlock(&ndb_schema_share_mutex); + mysql_mutex_unlock(&ndb_schema_share_mutex); /* end protect ndb_schema_share */ close_cached_tables(NULL, NULL, FALSE, FALSE, FALSE); @@ -2092,7 +2092,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, { uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()]; DBUG_ASSERT(node_id != 0xFF); - (void) pthread_mutex_lock(&tmp_share->mutex); + mysql_mutex_lock(&tmp_share->mutex); bitmap_clear_all(&tmp_share->subscriber_bitmap[node_id]); DBUG_PRINT("info",("NODE_FAILURE UNSUBSCRIBE[%d]", node_id)); if (opt_ndb_extra_logging) @@ -2103,8 +2103,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, tmp_share->subscriber_bitmap[node_id].bitmap[1], tmp_share->subscriber_bitmap[node_id].bitmap[0]); } - (void) pthread_mutex_unlock(&tmp_share->mutex); - (void) pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&tmp_share->mutex); + mysql_cond_signal(&injector_cond); break; } case NDBEVENT::TE_SUBSCRIBE: @@ -2112,7 +2112,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()]; uint8 req_id= pOp->getReqNodeId(); DBUG_ASSERT(req_id != 0 && node_id != 0xFF); - (void) pthread_mutex_lock(&tmp_share->mutex); + mysql_mutex_lock(&tmp_share->mutex); bitmap_set_bit(&tmp_share->subscriber_bitmap[node_id], req_id); DBUG_PRINT("info",("SUBSCRIBE[%d] %d", node_id, req_id)); if (opt_ndb_extra_logging) @@ -2124,8 +2124,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, tmp_share->subscriber_bitmap[node_id].bitmap[1], tmp_share->subscriber_bitmap[node_id].bitmap[0]); } - (void) pthread_mutex_unlock(&tmp_share->mutex); - (void) pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&tmp_share->mutex); + mysql_cond_signal(&injector_cond); break; } case NDBEVENT::TE_UNSUBSCRIBE: @@ -2133,7 +2133,7 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, uint8 node_id= g_node_id_map[pOp->getNdbdNodeId()]; uint8 req_id= pOp->getReqNodeId(); DBUG_ASSERT(req_id != 0 && node_id != 0xFF); - (void) pthread_mutex_lock(&tmp_share->mutex); + mysql_mutex_lock(&tmp_share->mutex); bitmap_clear_bit(&tmp_share->subscriber_bitmap[node_id], req_id); DBUG_PRINT("info",("UNSUBSCRIBE[%d] %d", node_id, req_id)); if (opt_ndb_extra_logging) @@ -2145,8 +2145,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, tmp_share->subscriber_bitmap[node_id].bitmap[1], tmp_share->subscriber_bitmap[node_id].bitmap[0]); } - (void) pthread_mutex_unlock(&tmp_share->mutex); - (void) pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&tmp_share->mutex); + mysql_cond_signal(&injector_cond); break; } default: @@ -2186,22 +2186,22 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd, build_table_filename(key, sizeof(key) - 1, schema->db, schema->name, "", 0); if (schema_type == SOT_CLEAR_SLOCK) { - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); NDB_SCHEMA_OBJECT *ndb_schema_object= (NDB_SCHEMA_OBJECT*) my_hash_search(&ndb_schema_objects, (uchar*) key, strlen(key)); if (ndb_schema_object) { - pthread_mutex_lock(&ndb_schema_object->mutex); + mysql_mutex_lock(&ndb_schema_object->mutex); memcpy(ndb_schema_object->slock, schema->slock, sizeof(ndb_schema_object->slock)); DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap", (uchar*)ndb_schema_object->slock_bitmap.bitmap, no_bytes_in_map(&ndb_schema_object->slock_bitmap)); - pthread_mutex_unlock(&ndb_schema_object->mutex); - pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&ndb_schema_object->mutex); + mysql_cond_signal(&injector_cond); } - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); continue; } /* ndb_share reference temporary, free below */ @@ -2462,27 +2462,29 @@ int ndbcluster_binlog_start() DBUG_RETURN(-1); } - pthread_mutex_init(&injector_mutex, MY_MUTEX_INIT_FAST); - pthread_cond_init(&injector_cond, NULL); - pthread_mutex_init(&ndb_schema_share_mutex, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_injector_mutex, &injector_mutex, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_injector_cond, &injector_cond, NULL); + mysql_mutex_init(key_ndb_schema_share_mutex, + &ndb_schema_share_mutex, MY_MUTEX_INIT_FAST); /* Create injector thread */ - if (pthread_create(&ndb_binlog_thread, &connection_attrib, - ndb_binlog_thread_func, 0)) + if (mysql_thread_create(key_thread_ndb_binlog, + &ndb_binlog_thread, &connection_attrib, + ndb_binlog_thread_func, 0)) { DBUG_PRINT("error", ("Could not create ndb injector thread")); - pthread_cond_destroy(&injector_cond); - pthread_mutex_destroy(&injector_mutex); + mysql_cond_destroy(&injector_cond); + mysql_mutex_destroy(&injector_mutex); DBUG_RETURN(-1); } ndbcluster_binlog_inited= 1; /* Wait for the injector thread to start */ - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); while (!ndb_binlog_thread_running) - pthread_cond_wait(&injector_cond, &injector_mutex); - pthread_mutex_unlock(&injector_mutex); + mysql_cond_wait(&injector_cond, &injector_mutex); + mysql_mutex_unlock(&injector_mutex); if (ndb_binlog_thread_running < 0) DBUG_RETURN(-1); @@ -2572,7 +2574,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, DBUG_ASSERT(! IS_NDB_BLOB_PREFIX(table_name)); DBUG_ASSERT(strlen(key) == key_len); - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); /* Handle any trailing share */ NDB_SHARE *share= (NDB_SHARE*) my_hash_search(&ndbcluster_open_tables, @@ -2584,7 +2586,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, share->op != 0 || share->op_old != 0) { - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(0); // replication already setup, or should not } } @@ -2594,7 +2596,7 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, if (share->op || share->op_old) { my_errno= HA_ERR_TABLE_EXIST; - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(1); } if (!share_may_exist || share->connect_count != @@ -2637,10 +2639,10 @@ int ndbcluster_create_binlog_setup(Ndb *ndb, const char *key, if (!do_event_op) { share->flags|= NSF_NO_BINLOG; - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(0); } - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); while (share && !IS_TMP_PREFIX(table_name)) { @@ -2933,14 +2935,14 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, int retry_sleep= 100; while (1) { - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); Ndb *ndb= injector_ndb; if (do_ndb_schema_share) ndb= schema_ndb; if (ndb == 0) { - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); DBUG_RETURN(-1); } @@ -2965,7 +2967,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, ndb->getNdbError().code, ndb->getNdbError().message, "NDB"); - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); DBUG_RETURN(-1); } @@ -3015,7 +3017,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, op->getNdbError().message, "NDB"); ndb->dropEventOperation(op); - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); DBUG_RETURN(-1); } } @@ -3057,7 +3059,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, op->getNdbError().code, op->getNdbError().message); } ndb->dropEventOperation(op); - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); if (retries) { my_sleep(retry_sleep); @@ -3065,7 +3067,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, } DBUG_RETURN(-1); } - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); break; } @@ -3079,7 +3081,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, ndb_apply_status_share= get_share(share); DBUG_PRINT("NDB_SHARE", ("%s binlog extra use_count: %u", share->key, share->use_count)); - (void) pthread_cond_signal(&injector_cond); + mysql_cond_signal(&injector_cond); } else if (do_ndb_schema_share) { @@ -3087,7 +3089,7 @@ ndbcluster_create_event_ops(NDB_SHARE *share, const NDBTAB *ndbtab, ndb_schema_share= get_share(share); DBUG_PRINT("NDB_SHARE", ("%s binlog extra use_count: %u", share->key, share->use_count)); - (void) pthread_cond_signal(&injector_cond); + mysql_cond_signal(&injector_cond); } DBUG_PRINT("info",("%s share->op: 0x%lx share->use_count: %u", @@ -3158,7 +3160,7 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name, #define SYNC_DROP_ #ifdef SYNC_DROP_ thd->proc_info= "Syncing ndb table schema operation and binlog"; - (void) pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); mysql_mutex_assert_owner(&LOCK_open); mysql_mutex_unlock(&LOCK_open); int max_timeout= DEFAULT_SYNC_TIMEOUT; @@ -3166,9 +3168,9 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name, { struct timespec abstime; set_timespec(abstime, 1); - int ret= pthread_cond_timedwait(&injector_cond, - &share->mutex, - &abstime); + int ret= mysql_cond_timedwait(&injector_cond, + &share->mutex, + &abstime); if (thd->killed || share->op == 0) break; @@ -3187,12 +3189,12 @@ ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name, } } mysql_mutex_lock(&LOCK_open); - (void) pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); #else - (void) pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); share->op_old= share->op; share->op= 0; - (void) pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); #endif thd->proc_info= save_proc_info; @@ -3560,7 +3562,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key, DBUG_PRINT("enter", ("key: '%s'", key)); if (!have_lock) - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); while (!(ndb_schema_object= (NDB_SCHEMA_OBJECT*) my_hash_search(&ndb_schema_objects, (uchar*) key, @@ -3586,7 +3588,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key, my_free((uchar*) ndb_schema_object, 0); break; } - pthread_mutex_init(&ndb_schema_object->mutex, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_ndb_schema_object_mutex, &ndb_schema_object->mutex, MY_MUTEX_INIT_FAST); bitmap_init(&ndb_schema_object->slock_bitmap, ndb_schema_object->slock, sizeof(ndb_schema_object->slock)*8, FALSE); bitmap_clear_all(&ndb_schema_object->slock_bitmap); @@ -3598,7 +3600,7 @@ static NDB_SCHEMA_OBJECT *ndb_get_schema_object(const char *key, DBUG_PRINT("info", ("use_count: %d", ndb_schema_object->use_count)); } if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_RETURN(ndb_schema_object); } @@ -3609,12 +3611,12 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object, DBUG_ENTER("ndb_free_schema_object"); DBUG_PRINT("enter", ("key: '%s'", (*ndb_schema_object)->key)); if (!have_lock) - pthread_mutex_lock(&ndbcluster_mutex); + mysql_mutex_lock(&ndbcluster_mutex); if (!--(*ndb_schema_object)->use_count) { DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count)); my_hash_delete(&ndb_schema_objects, (uchar*) *ndb_schema_object); - pthread_mutex_destroy(&(*ndb_schema_object)->mutex); + mysql_mutex_destroy(&(*ndb_schema_object)->mutex); my_free((uchar*) *ndb_schema_object, MYF(0)); *ndb_schema_object= 0; } @@ -3623,7 +3625,7 @@ static void ndb_free_schema_object(NDB_SCHEMA_OBJECT **ndb_schema_object, DBUG_PRINT("info", ("use_count: %d", (*ndb_schema_object)->use_count)); } if (!have_lock) - pthread_mutex_unlock(&ndbcluster_mutex); + mysql_mutex_unlock(&ndbcluster_mutex); DBUG_VOID_RETURN; } @@ -3644,7 +3646,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) Timer main_timer; #endif - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); /* Set up the Thread */ @@ -3661,14 +3663,16 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) thd->thread_id= thread_id++; pthread_mutex_unlock(&LOCK_thread_count); + mysql_thread_set_psi_id(thd->thread_id); + thd->thread_stack= (char*) &thd; /* remember where our stack is */ if (thd->store_globals()) { thd->cleanup(); delete thd; ndb_binlog_thread_running= -1; - pthread_mutex_unlock(&injector_mutex); - pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&injector_mutex); + mysql_cond_signal(&injector_cond); DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); @@ -3703,8 +3707,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) { sql_print_error("NDB Binlog: Getting Schema Ndb object failed"); ndb_binlog_thread_running= -1; - pthread_mutex_unlock(&injector_mutex); - pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&injector_mutex); + mysql_cond_signal(&injector_cond); goto err; } @@ -3714,8 +3718,8 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) { sql_print_error("NDB Binlog: Getting Ndb object failed"); ndb_binlog_thread_running= -1; - pthread_mutex_unlock(&injector_mutex); - pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&injector_mutex); + mysql_cond_signal(&injector_cond); goto err; } @@ -3728,7 +3732,7 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) Used by both sql client thread and binlog thread to interact with the storage - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); */ injector_thd= thd; injector_ndb= i_ndb; @@ -3743,27 +3747,27 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) /* Thread start up completed */ ndb_binlog_thread_running= 1; - pthread_mutex_unlock(&injector_mutex); - pthread_cond_signal(&injector_cond); + mysql_mutex_unlock(&injector_mutex); + mysql_cond_signal(&injector_cond); /* wait for mysql server to start (so that the binlog is started and thus can receive the first GAP event) */ - pthread_mutex_lock(&LOCK_server_started); + mysql_mutex_lock(&LOCK_server_started); while (!mysqld_server_started) { struct timespec abstime; set_timespec(abstime, 1); - pthread_cond_timedwait(&COND_server_started, &LOCK_server_started, - &abstime); + mysql_cond_timedwait(&COND_server_started, &LOCK_server_started, + &abstime); if (ndbcluster_terminating) { - pthread_mutex_unlock(&LOCK_server_started); + mysql_mutex_unlock(&LOCK_server_started); goto err; } } - pthread_mutex_unlock(&LOCK_server_started); + mysql_mutex_unlock(&LOCK_server_started); restart: /* Main NDB Injector loop @@ -3806,21 +3810,21 @@ restart: { thd->proc_info= "Waiting for ndbcluster to start"; - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); while (!ndb_schema_share || (ndb_binlog_running && !ndb_apply_status_share)) { /* ndb not connected yet */ struct timespec abstime; set_timespec(abstime, 1); - pthread_cond_timedwait(&injector_cond, &injector_mutex, &abstime); + mysql_cond_timedwait(&injector_cond, &injector_mutex, &abstime); if (ndbcluster_binlog_terminating) { - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); goto err; } } - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); if (thd_ndb == NULL) { @@ -4291,13 +4295,13 @@ err: DBUG_PRINT("info",("Shutting down cluster binlog thread")); thd->proc_info= "Shutting down"; close_thread_tables(thd); - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); /* don't mess with the injector_ndb anymore from other threads */ injector_thd= 0; injector_ndb= 0; p_latest_trans_gci= 0; schema_ndb= 0; - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); thd->db= 0; // as not to try to free memory if (ndb_apply_status_share) @@ -4312,7 +4316,7 @@ err: if (ndb_schema_share) { /* begin protect ndb_schema_share */ - pthread_mutex_lock(&ndb_schema_share_mutex); + mysql_mutex_lock(&ndb_schema_share_mutex); /* ndb_share reference binlog extra free */ DBUG_PRINT("NDB_SHARE", ("%s binlog extra free use_count: %u", ndb_schema_share->key, @@ -4320,7 +4324,7 @@ err: free_share(&ndb_schema_share); ndb_schema_share= 0; ndb_binlog_tables_inited= 0; - pthread_mutex_unlock(&ndb_schema_share_mutex); + mysql_mutex_unlock(&ndb_schema_share_mutex); /* end protect ndb_schema_share */ } @@ -4380,7 +4384,7 @@ err: ndb_binlog_thread_running= -1; ndb_binlog_running= FALSE; - (void) pthread_cond_signal(&injector_cond); + mysql_cond_signal(&injector_cond); DBUG_PRINT("exit", ("ndb_binlog_thread")); @@ -4399,12 +4403,12 @@ ndbcluster_show_status_binlog(THD* thd, stat_print_fn *stat_print, ulonglong ndb_latest_epoch= 0; DBUG_ENTER("ndbcluster_show_status_binlog"); - pthread_mutex_lock(&injector_mutex); + mysql_mutex_lock(&injector_mutex); if (injector_ndb) { char buff1[22],buff2[22],buff3[22],buff4[22],buff5[22]; ndb_latest_epoch= injector_ndb->getLatestGCI(); - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); buflen= snprintf(buf, sizeof(buf), @@ -4424,7 +4428,7 @@ ndbcluster_show_status_binlog(THD* thd, stat_print_fn *stat_print, DBUG_RETURN(TRUE); } else - pthread_mutex_unlock(&injector_mutex); + mysql_mutex_unlock(&injector_mutex); DBUG_RETURN(FALSE); } diff --git a/sql/ha_ndbcluster_binlog.h b/sql/ha_ndbcluster_binlog.h index 4c64aa23c5b..32dac553ee8 100644 --- a/sql/ha_ndbcluster_binlog.h +++ b/sql/ha_ndbcluster_binlog.h @@ -1,7 +1,7 @@ #ifndef HA_NDBCLUSTER_BINLOG_INCLUDED #define HA_NDBCLUSTER_BINLOG_INCLUDED -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -104,16 +104,24 @@ private: }; #ifdef HAVE_NDB_BINLOG + +#ifdef HAVE_PSI_INTERFACE +extern PSI_mutex_key key_injector_mutex, key_ndb_schema_share_mutex, + key_ndb_schema_object_mutex; +extern PSI_cond_key key_injector_cond; +extern PSI_thread_key key_thread_ndb_binlog; +#endif /* HAVE_PSI_INTERFACE */ + extern pthread_t ndb_binlog_thread; -extern pthread_mutex_t injector_mutex; -extern pthread_cond_t injector_cond; +extern mysql_mutex_t injector_mutex; +extern mysql_cond_t injector_cond; extern unsigned char g_node_id_map[max_ndb_nodes]; extern pthread_t ndb_util_thread; -extern pthread_mutex_t LOCK_ndb_util_thread; -extern pthread_cond_t COND_ndb_util_thread; +extern mysql_mutex_t LOCK_ndb_util_thread; +extern mysql_cond_t COND_ndb_util_thread; extern int ndbcluster_util_inited; -extern pthread_mutex_t ndbcluster_mutex; +extern mysql_mutex_t ndbcluster_mutex; extern HASH ndbcluster_open_tables; extern Ndb_cluster_connection* g_ndb_cluster_connection; extern long ndb_number_of_storage_nodes; diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index d46d416e275..792dbf5d1c8 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -500,9 +500,9 @@ int ha_partition::create_handler_files(const char *path, strxmov(name, path, ha_par_ext, NullS); strxmov(old_name, old_path, ha_par_ext, NullS); if ((action_flag == CHF_DELETE_FLAG && - my_delete(name, MYF(MY_WME))) || + mysql_file_delete(key_file_partition, name, MYF(MY_WME))) || (action_flag == CHF_RENAME_FLAG && - my_rename(old_name, name, MYF(MY_WME)))) + mysql_file_rename(key_file_partition, old_name, name, MYF(MY_WME)))) { DBUG_RETURN(TRUE); } @@ -2205,12 +2205,13 @@ bool ha_partition::create_handler_file(const char *name) to be used at open, delete_table and rename_table */ fn_format(file_name, name, "", ha_par_ext, MY_APPEND_EXT); - if ((file= my_create(file_name, CREATE_MODE, O_RDWR | O_TRUNC, - MYF(MY_WME))) >= 0) + if ((file= mysql_file_create(key_file_partition, + file_name, CREATE_MODE, O_RDWR | O_TRUNC, + MYF(MY_WME))) >= 0) { - result= my_write(file, (uchar *) file_buffer, tot_len_byte, - MYF(MY_WME | MY_NABP)) != 0; - (void) my_close(file, MYF(0)); + result= mysql_file_write(file, (uchar *) file_buffer, tot_len_byte, + MYF(MY_WME | MY_NABP)) != 0; + (void) mysql_file_close(file, MYF(0)); } else result= TRUE; @@ -2387,17 +2388,18 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root) DBUG_RETURN(FALSE); fn_format(buff, name, "", ha_par_ext, MY_APPEND_EXT); - /* Following could be done with my_stat to read in whole file */ - if ((file= my_open(buff, O_RDONLY | O_SHARE, MYF(0))) < 0) + /* Following could be done with mysql_file_stat to read in whole file */ + if ((file= mysql_file_open(key_file_partition, + buff, O_RDONLY | O_SHARE, MYF(0))) < 0) DBUG_RETURN(TRUE); - if (my_read(file, (uchar *) & buff[0], 8, MYF(MY_NABP))) + if (mysql_file_read(file, (uchar *) &buff[0], 8, MYF(MY_NABP))) goto err1; len_words= uint4korr(buff); len_bytes= 4 * len_words; if (!(file_buffer= (char*) my_malloc(len_bytes, MYF(0)))) goto err1; - my_seek(file, 0, MY_SEEK_SET, MYF(0)); - if (my_read(file, (uchar *) file_buffer, len_bytes, MYF(MY_NABP))) + mysql_file_seek(file, 0, MY_SEEK_SET, MYF(0)); + if (mysql_file_read(file, (uchar *) file_buffer, len_bytes, MYF(MY_NABP))) goto err2; chksum= 0; @@ -2418,7 +2420,7 @@ bool ha_partition::get_from_handler_file(const char *name, MEM_ROOT *mem_root) if (len_words != (tot_partition_words + tot_name_words + 4)) goto err3; name_buffer_ptr= file_buffer + 16 + 4 * tot_partition_words; - (void) my_close(file, MYF(0)); + (void) mysql_file_close(file, MYF(0)); m_file_buffer= file_buffer; // Will be freed in clear_handler_file() m_name_buffer_ptr= name_buffer_ptr; @@ -2443,7 +2445,7 @@ err3: err2: my_free(file_buffer, MYF(0)); err1: - (void) my_close(file, MYF(0)); + (void) mysql_file_close(file, MYF(0)); DBUG_RETURN(TRUE); } @@ -2606,7 +2608,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) for the same table. */ if (is_not_tmp_table) - pthread_mutex_lock(&table_share->mutex); + mysql_mutex_lock(&table_share->mutex); if (!table_share->ha_data) { HA_DATA_PARTITION *ha_data; @@ -2617,7 +2619,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) if (!ha_data) { if (is_not_tmp_table) - pthread_mutex_unlock(&table_share->mutex); + mysql_mutex_unlock(&table_share->mutex); goto err_handler; } DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data)); @@ -2626,7 +2628,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) pthread_mutex_init(&ha_data->mutex, MY_MUTEX_INIT_FAST); } if (is_not_tmp_table) - pthread_mutex_unlock(&table_share->mutex); + mysql_mutex_unlock(&table_share->mutex); /* Some handlers update statistics as part of the open call. This will in some cases corrupt the statistics of the partition handler and thus @@ -6633,7 +6635,7 @@ int ha_partition::indexes_are_disabled(void) #ifdef NOT_USED static HASH partition_open_tables; -static pthread_mutex_t partition_mutex; +static mysql_mutex_t partition_mutex; static int partition_init= 0; @@ -6671,17 +6673,17 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table) if (!partition_init) { /* Hijack a mutex for init'ing the storage engine */ - pthread_mutex_lock(&LOCK_mysql_create_db); + mysql_mutex_lock(&LOCK_mysql_create_db); if (!partition_init) { partition_init++; - pthread_mutex_init(&partition_mutex, MY_MUTEX_INIT_FAST); + mysql_mutex_init(INSTRUMENT_ME, &partition_mutex, MY_MUTEX_INIT_FAST); (void) hash_init(&partition_open_tables, system_charset_info, 32, 0, 0, (hash_get_key) partition_get_key, 0, 0); } - pthread_mutex_unlock(&LOCK_mysql_create_db); + mysql_mutex_unlock(&LOCK_mysql_create_db); } - pthread_mutex_lock(&partition_mutex); + mysql_mutex_lock(&partition_mutex); length= (uint) strlen(table_name); if (!(share= (PARTITION_SHARE *) hash_search(&partition_open_tables, @@ -6692,7 +6694,7 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table) &share, (uint) sizeof(*share), &tmp_name, (uint) length + 1, NullS))) { - pthread_mutex_unlock(&partition_mutex); + mysql_mutex_unlock(&partition_mutex); return NULL; } @@ -6703,15 +6705,15 @@ static PARTITION_SHARE *get_share(const char *table_name, TABLE *table) if (my_hash_insert(&partition_open_tables, (uchar *) share)) goto error; thr_lock_init(&share->lock); - pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST); + mysql_mutex_init(INSTRUMENT_ME, &share->mutex, MY_MUTEX_INIT_FAST); } share->use_count++; - pthread_mutex_unlock(&partition_mutex); + mysql_mutex_unlock(&partition_mutex); return share; error: - pthread_mutex_unlock(&partition_mutex); + mysql_mutex_unlock(&partition_mutex); my_free((uchar*) share, MYF(0)); return NULL; @@ -6726,15 +6728,15 @@ error: static int free_share(PARTITION_SHARE *share) { - pthread_mutex_lock(&partition_mutex); + mysql_mutex_lock(&partition_mutex); if (!--share->use_count) { hash_delete(&partition_open_tables, (uchar *) share); thr_lock_delete(&share->lock); - pthread_mutex_destroy(&share->mutex); + mysql_mutex_destroy(&share->mutex); my_free((uchar*) share, MYF(0)); } - pthread_mutex_unlock(&partition_mutex); + mysql_mutex_unlock(&partition_mutex); return 0; } diff --git a/sql/ha_partition.h b/sql/ha_partition.h index d4579d013fd..e2e6c674c5e 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -36,7 +36,7 @@ typedef struct st_partition_share { char *table_name; uint table_name_length, use_count; - pthread_mutex_t mutex; + mysql_mutex_t mutex; THR_LOCK lock; } PARTITION_SHARE; #endif @@ -933,7 +933,7 @@ private: if(table_share->tmp_table == NO_TMP_TABLE) { auto_increment_lock= TRUE; - pthread_mutex_lock(&table_share->mutex); + mysql_mutex_lock(&table_share->mutex); } } virtual void unlock_auto_increment() @@ -946,7 +946,7 @@ private: */ if(auto_increment_lock && !auto_increment_safe_stmt_log_lock) { - pthread_mutex_unlock(&table_share->mutex); + mysql_mutex_unlock(&table_share->mutex); auto_increment_lock= FALSE; } } diff --git a/sql/handler.cc b/sql/handler.cc index 784d02d7f4c..fa53c112156 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1682,7 +1682,7 @@ bool mysql_xa_recover(THD *thd) Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(1); - pthread_mutex_lock(&LOCK_xid_cache); + mysql_mutex_lock(&LOCK_xid_cache); while ((xs= (XID_STATE*) my_hash_element(&xid_cache, i++))) { if (xs->xa_state==XA_PREPARED) @@ -1695,13 +1695,13 @@ bool mysql_xa_recover(THD *thd) &my_charset_bin); if (protocol->write()) { - pthread_mutex_unlock(&LOCK_xid_cache); + mysql_mutex_unlock(&LOCK_xid_cache); DBUG_RETURN(1); } } } - pthread_mutex_unlock(&LOCK_xid_cache); + mysql_mutex_unlock(&LOCK_xid_cache); my_eof(thd); DBUG_RETURN(0); } @@ -2104,6 +2104,10 @@ THD *handler::ha_thd(void) const return (table && table->in_use) ? table->in_use : current_thd; } +PSI_table_share *handler::ha_table_share_psi(const TABLE_SHARE *share) const +{ + return share->m_psi; +} /** @brief Open database-handler. @@ -2993,7 +2997,8 @@ static bool update_frm_version(TABLE *table) strxmov(path, table->s->normalized_path.str, reg_ext, NullS); - if ((file= my_open(path, O_RDWR|O_BINARY, MYF(MY_WME))) >= 0) + if ((file= mysql_file_open(key_file_frm, + path, O_RDWR|O_BINARY, MYF(MY_WME))) >= 0) { uchar version[4]; char *key= table->s->table_cache_key.str; @@ -3003,7 +3008,7 @@ static bool update_frm_version(TABLE *table) int4store(version, MYSQL_VERSION_ID); - if ((result= my_pwrite(file,(uchar*) version,4,51L,MYF_RW))) + if ((result= mysql_file_pwrite(file, (uchar*) version, 4, 51L, MYF_RW))) goto err; for (entry=(TABLE*) my_hash_first(&open_cache,(uchar*) key,key_length, &state); @@ -3013,7 +3018,7 @@ static bool update_frm_version(TABLE *table) } err: if (file >= 0) - (void) my_close(file,MYF(MY_WME)); + (void) mysql_file_close(file, MYF(MY_WME)); DBUG_RETURN(result); } @@ -3060,7 +3065,7 @@ int handler::delete_table(const char *name) for (const char **ext=bas_ext(); *ext ; ext++) { fn_format(buff, name, "", *ext, MY_UNPACK_FILENAME|MY_APPEND_EXT); - if (my_delete_with_symlink(buff, MYF(0))) + if (mysql_file_delete_with_symlink(key_file_misc, buff, MYF(0))) { if (my_errno != ENOENT) { @@ -3717,12 +3722,12 @@ int ha_init_key_cache(const char *name, KEY_CACHE *key_cache) if (!key_cache->key_cache_inited) { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); size_t tmp_buff_size= (size_t) key_cache->param_buff_size; uint tmp_block_size= (uint) key_cache->param_block_size; uint division_limit= key_cache->param_division_limit; uint age_threshold= key_cache->param_age_threshold; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); DBUG_RETURN(!init_key_cache(key_cache, tmp_block_size, tmp_buff_size, @@ -3741,12 +3746,12 @@ int ha_resize_key_cache(KEY_CACHE *key_cache) if (key_cache->key_cache_inited) { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); size_t tmp_buff_size= (size_t) key_cache->param_buff_size; long tmp_block_size= (long) key_cache->param_block_size; uint division_limit= key_cache->param_division_limit; uint age_threshold= key_cache->param_age_threshold; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); DBUG_RETURN(!resize_key_cache(key_cache, tmp_block_size, tmp_buff_size, division_limit, age_threshold)); @@ -3762,10 +3767,10 @@ int ha_change_key_cache_param(KEY_CACHE *key_cache) { if (key_cache->key_cache_inited) { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); uint division_limit= key_cache->param_division_limit; uint age_threshold= key_cache->param_age_threshold; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); change_key_cache_param(key_cache, division_limit, age_threshold); } return 0; @@ -4794,7 +4799,8 @@ int example_of_iterator_using_for_logs_cleanup(handlerton *hton) { printf("%s\n", data.filename.str); if (data.status == HA_LOG_STATUS_FREE && - my_delete(data.filename.str, MYF(MY_WME))) + mysql_file_delete(INSTRUMENT_ME, + data.filename.str, MYF(MY_WME))) goto err; } res= 0; @@ -4822,7 +4828,7 @@ err: enum log_status fl_get_log_status(char *log) { MY_STAT stat_buff; - if (my_stat(log, &stat_buff, MYF(0))) + if (mysql_file_stat(INSTRUMENT_ME, log, &stat_buff, MYF(0))) return HA_LOG_STATUS_INUSE; return HA_LOG_STATUS_NOSUCHLOG; } diff --git a/sql/handler.h b/sql/handler.h index 6d43c56edbf..711cc823f96 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -1,7 +1,7 @@ #ifndef HANDLER_INCLUDED #define HANDLER_INCLUDED -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* Definitions for parameters to do with handler-routines */ #ifdef USE_PRAGMA_INTERFACE @@ -305,6 +304,8 @@ enum legacy_db_type DB_TYPE_MEMCACHE, DB_TYPE_FALCON, DB_TYPE_MARIA, + /** Performance schema engine. */ + DB_TYPE_PERFORMANCE_SCHEMA, DB_TYPE_FIRST_DYNAMIC=42, DB_TYPE_DEFAULT=127 // Must be last }; @@ -1216,6 +1217,20 @@ public: */ uint auto_inc_intervals_count; + /** + Instrumented table associated with this handler. + This member should be set to NULL when no instrumentation is in place, + so that linking an instrumented/non instrumented server/plugin works. + For example: + - the server is compiled with the instrumentation. + The server expects either NULL or valid pointers in m_psi. + - an engine plugin is compiled without instrumentation. + The plugin can not leave this pointer uninitialized, + or can not leave a trash value on purpose in this pointer, + as this would crash the server. + */ + PSI_table *m_psi; + handler(handlerton *ht_arg, TABLE_SHARE *share_arg) :table_share(share_arg), table(0), estimation_rows_to_insert(0), ht(ht_arg), @@ -1224,7 +1239,8 @@ public: ft_handler(0), inited(NONE), locked(FALSE), implicit_emptied(0), pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0), - auto_inc_intervals_count(0) + auto_inc_intervals_count(0), + m_psi(NULL) {} virtual ~handler(void) { @@ -1824,6 +1840,39 @@ protected: void **ha_data(THD *) const; THD *ha_thd(void) const; + /** + Acquire the instrumented table information from a table share. + @param share a table share + @return an instrumented table share, or NULL. + */ + PSI_table_share *ha_table_share_psi(const TABLE_SHARE *share) const; + + inline void psi_open() + { + DBUG_ASSERT(m_psi == NULL); + DBUG_ASSERT(table_share != NULL); +#ifdef HAVE_PSI_INTERFACE + if (PSI_server) + { + PSI_table_share *share_psi= ha_table_share_psi(table_share); + if (share_psi) + m_psi= PSI_server->open_table(share_psi, this); + } +#endif + } + + inline void psi_close() + { +#ifdef HAVE_PSI_INTERFACE + if (PSI_server && m_psi) + { + PSI_server->close_table(m_psi); + m_psi= NULL; /* instrumentation handle, invalid after close_table() */ + } +#endif + DBUG_ASSERT(m_psi == NULL); + } + /** Default rename_table() and delete_table() rename/delete files with a given name and extensions from bas_ext(). diff --git a/sql/hash_filo.h b/sql/hash_filo.h index 5d17b880b4d..805e1262020 100644 --- a/sql/hash_filo.h +++ b/sql/hash_filo.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003, 2005 MySQL AB +/* Copyright (C) 2000-2003, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +45,7 @@ class hash_filo hash_filo_element *first_link,*last_link; public: - pthread_mutex_t lock; + mysql_mutex_t lock; HASH cache; hash_filo(uint size_arg, uint key_offset_arg , uint key_length_arg, @@ -64,7 +64,7 @@ public: { if (cache.array.buffer) /* Avoid problems with thread library */ (void) my_hash_free(&cache); - pthread_mutex_destroy(&lock); + mysql_mutex_destroy(&lock); } } void clear(bool locked=0) @@ -72,15 +72,15 @@ public: if (!init) { init=1; - (void) pthread_mutex_init(&lock,MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_hash_filo_lock, &lock, MY_MUTEX_INIT_FAST); } if (!locked) - (void) pthread_mutex_lock(&lock); + mysql_mutex_lock(&lock); (void) my_hash_free(&cache); (void) my_hash_init(&cache,hash_charset,size,key_offset, key_length, get_key, free_element,0); if (!locked) - (void) pthread_mutex_unlock(&lock); + mysql_mutex_unlock(&lock); first_link=last_link=0; } diff --git a/sql/hostname.cc b/sql/hostname.cc index cf35e60061f..5517d85527c 100644 --- a/sql/hostname.cc +++ b/sql/hostname.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -169,11 +169,11 @@ static bool add_hostname(const char *ip_key, const char *hostname) if (specialflag & SPECIAL_NO_HOST_CACHE) return FALSE; - pthread_mutex_lock(&hostname_cache->lock); + mysql_mutex_lock(&hostname_cache->lock); bool err_status= add_hostname_impl(ip_key, hostname); - pthread_mutex_unlock(&hostname_cache->lock); + mysql_mutex_unlock(&hostname_cache->lock); return err_status; } @@ -186,14 +186,14 @@ void inc_host_errors(const char *ip_string) char ip_key[HOST_ENTRY_KEY_SIZE]; prepare_hostname_cache_key(ip_string, ip_key); - pthread_mutex_lock(&hostname_cache->lock); + mysql_mutex_lock(&hostname_cache->lock); Host_entry *entry= hostname_cache_search(ip_key); if (entry) entry->connect_errors++; - pthread_mutex_unlock(&hostname_cache->lock); + mysql_mutex_unlock(&hostname_cache->lock); } @@ -205,14 +205,14 @@ void reset_host_errors(const char *ip_string) char ip_key[HOST_ENTRY_KEY_SIZE]; prepare_hostname_cache_key(ip_string, ip_key); - pthread_mutex_lock(&hostname_cache->lock); + mysql_mutex_lock(&hostname_cache->lock); Host_entry *entry= hostname_cache_search(ip_key); if (entry) entry->connect_errors= 0; - pthread_mutex_unlock(&hostname_cache->lock); + mysql_mutex_unlock(&hostname_cache->lock); } @@ -319,7 +319,7 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage, if (!(specialflag & SPECIAL_NO_HOST_CACHE)) { - pthread_mutex_lock(&hostname_cache->lock); + mysql_mutex_lock(&hostname_cache->lock); Host_entry *entry= hostname_cache_search(ip_key); @@ -337,12 +337,12 @@ bool ip_to_hostname(struct sockaddr_storage *ip_storage, (const char *) (*hostname? *hostname : "null"), (int) *connect_errors)); - pthread_mutex_unlock(&hostname_cache->lock); + mysql_mutex_unlock(&hostname_cache->lock); DBUG_RETURN(FALSE); } - pthread_mutex_unlock(&hostname_cache->lock); + mysql_mutex_unlock(&hostname_cache->lock); } /* diff --git a/sql/item_func.cc b/sql/item_func.cc index ec0f76717fd..557561789b2 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -5008,7 +5008,7 @@ void Item_func_get_system_var::fix_length_and_dec() break; case SHOW_CHAR: case SHOW_CHAR_PTR: - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); cptr= var->show_type() == SHOW_CHAR ? (char*) var->value_ptr(current_thd, var_type, &component) : *(char**) var->value_ptr(current_thd, var_type, &component); @@ -5016,19 +5016,19 @@ void Item_func_get_system_var::fix_length_and_dec() max_length= system_charset_info->cset->numchars(system_charset_info, cptr, cptr + strlen(cptr)); - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); collation.set(system_charset_info, DERIVATION_SYSCONST); max_length*= system_charset_info->mbmaxlen; decimals=NOT_FIXED_DEC; break; case SHOW_LEX_STRING: { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); LEX_STRING *ls= ((LEX_STRING*)var->value_ptr(current_thd, var_type, &component)); max_length= system_charset_info->cset->numchars(system_charset_info, ls->str, ls->str + ls->length); - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); collation.set(system_charset_info, DERIVATION_SYSCONST); max_length*= system_charset_info->mbmaxlen; decimals=NOT_FIXED_DEC; @@ -5113,9 +5113,9 @@ enum_field_types Item_func_get_system_var::field_type() const #define get_sys_var_safe(type) \ do { \ type value; \ - pthread_mutex_lock(&LOCK_global_system_variables); \ + mysql_mutex_lock(&LOCK_global_system_variables); \ value= *(type*) var->value_ptr(thd, var_type, &component); \ - pthread_mutex_unlock(&LOCK_global_system_variables); \ + mysql_mutex_unlock(&LOCK_global_system_variables); \ cache_present |= GET_SYS_VAR_CACHE_LONG; \ used_query_id= thd->query_id; \ cached_llval= null_value ? 0 : (longlong) value; \ @@ -5238,7 +5238,7 @@ String* Item_func_get_system_var::val_str(String* str) case SHOW_CHAR_PTR: case SHOW_LEX_STRING: { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); char *cptr= var->show_type() == SHOW_CHAR ? (char*) var->value_ptr(thd, var_type, &component) : *(char**) var->value_ptr(thd, var_type, &component); @@ -5258,7 +5258,7 @@ String* Item_func_get_system_var::val_str(String* str) null_value= TRUE; str= NULL; } - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); break; } @@ -5323,9 +5323,9 @@ double Item_func_get_system_var::val_real() switch (var->show_type()) { case SHOW_DOUBLE: - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); cached_dval= *(double*) var->value_ptr(thd, var_type, &component); - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); used_query_id= thd->query_id; cached_null_value= null_value; if (null_value) @@ -5336,7 +5336,7 @@ double Item_func_get_system_var::val_real() case SHOW_LEX_STRING: case SHOW_CHAR_PTR: { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); char *cptr= var->show_type() == SHOW_CHAR ? (char*) var->value_ptr(thd, var_type, &component) : *(char**) var->value_ptr(thd, var_type, &component); @@ -5348,7 +5348,7 @@ double Item_func_get_system_var::val_real() null_value= TRUE; cached_dval= 0; } - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); used_query_id= thd->query_id; cached_null_value= null_value; cache_present|= GET_SYS_VAR_CACHE_DOUBLE; @@ -6281,8 +6281,8 @@ void uuid_short_init() longlong Item_func_uuid_short::val_int() { ulonglong val; - pthread_mutex_lock(&LOCK_uuid_generator); + mysql_mutex_lock(&LOCK_uuid_generator); val= uuid_value++; - pthread_mutex_unlock(&LOCK_uuid_generator); + mysql_mutex_unlock(&LOCK_uuid_generator); return (longlong) val; } diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index d63226f2dbb..d9ca1d17d82 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -465,18 +465,18 @@ String *Item_func_des_encrypt::val_str(String *str) if (arg_count == 1) { /* Protect against someone doing FLUSH DES_KEY_FILE */ - pthread_mutex_lock(&LOCK_des_key_file); + mysql_mutex_lock(&LOCK_des_key_file); keyschedule= des_keyschedule[key_number=des_default_key]; - pthread_mutex_unlock(&LOCK_des_key_file); + mysql_mutex_unlock(&LOCK_des_key_file); } else if (args[1]->result_type() == INT_RESULT) { key_number= (uint) args[1]->val_int(); if (key_number > 9) goto error; - pthread_mutex_lock(&LOCK_des_key_file); + mysql_mutex_lock(&LOCK_des_key_file); keyschedule= des_keyschedule[key_number]; - pthread_mutex_unlock(&LOCK_des_key_file); + mysql_mutex_unlock(&LOCK_des_key_file); } else { @@ -566,9 +566,9 @@ String *Item_func_des_decrypt::val_str(String *str) key_number > 9) goto error; - pthread_mutex_lock(&LOCK_des_key_file); + mysql_mutex_lock(&LOCK_des_key_file); keyschedule= des_keyschedule[key_number]; - pthread_mutex_unlock(&LOCK_des_key_file); + mysql_mutex_unlock(&LOCK_des_key_file); } else { @@ -1702,17 +1702,17 @@ String *Item_func_encrypt::val_str(String *str) return 0; salt_ptr= salt_str->c_ptr_safe(); } - pthread_mutex_lock(&LOCK_crypt); + mysql_mutex_lock(&LOCK_crypt); char *tmp= crypt(res->c_ptr_safe(),salt_ptr); if (!tmp) { - pthread_mutex_unlock(&LOCK_crypt); + mysql_mutex_unlock(&LOCK_crypt); null_value= 1; return 0; } str->set(tmp, (uint) strlen(tmp), &my_charset_bin); str->copy(); - pthread_mutex_unlock(&LOCK_crypt); + mysql_mutex_unlock(&LOCK_crypt); return str; #else null_value=1; @@ -2998,7 +2998,7 @@ String *Item_load_file::val_str(String *str) strncmp(opt_secure_file_priv, path, strlen(opt_secure_file_priv))) goto err; - if (!my_stat(path, &stat_info, MYF(0))) + if (!mysql_file_stat(key_file_loadfile, path, &stat_info, MYF(0))) goto err; if (!(stat_info.st_mode & S_IROTH)) @@ -3016,15 +3016,17 @@ String *Item_load_file::val_str(String *str) } if (tmp_value.alloc(stat_info.st_size)) goto err; - if ((file = my_open(file_name->ptr(), O_RDONLY, MYF(0))) < 0) + if ((file= mysql_file_open(key_file_loadfile, + file_name->ptr(), O_RDONLY, MYF(0))) < 0) goto err; - if (my_read(file, (uchar*) tmp_value.ptr(), stat_info.st_size, MYF(MY_NABP))) + if (mysql_file_read(file, (uchar*) tmp_value.ptr(), stat_info.st_size, + MYF(MY_NABP))) { - my_close(file, MYF(0)); + mysql_file_close(file, MYF(0)); goto err; } tmp_value.length(stat_info.st_size); - my_close(file, MYF(0)); + mysql_file_close(file, MYF(0)); null_value = 0; DBUG_RETURN(&tmp_value); @@ -3468,7 +3470,7 @@ String *Item_func_uuid::val_str(String *str) char *s; THD *thd= current_thd; - pthread_mutex_lock(&LOCK_uuid_generator); + mysql_mutex_lock(&LOCK_uuid_generator); if (! uuid_time) /* first UUID() call. initializing data */ { ulong tmp=sql_rnd_with_mutex(); @@ -3558,7 +3560,7 @@ String *Item_func_uuid::val_str(String *str) } uuid_time=tv; - pthread_mutex_unlock(&LOCK_uuid_generator); + mysql_mutex_unlock(&LOCK_uuid_generator); uint32 time_low= (uint32) (tv & 0xFFFFFFFF); uint16 time_mid= (uint16) ((tv >> 32) & 0xFFFF); diff --git a/sql/lock.cc b/sql/lock.cc index e60259f6acc..0235c4ae881 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1436,7 +1436,7 @@ bool lock_global_read_lock(THD *thd) if (!thd->global_read_lock) { const char *old_message; - (void) pthread_mutex_lock(&LOCK_global_read_lock); + mysql_mutex_lock(&LOCK_global_read_lock); old_message=thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock, "Waiting to get readlock"); DBUG_PRINT("info", @@ -1445,7 +1445,7 @@ bool lock_global_read_lock(THD *thd) waiting_for_read_lock++; while (protect_against_global_read_lock && !thd->killed) - pthread_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock); + mysql_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock); waiting_for_read_lock--; if (thd->killed) { @@ -1476,16 +1476,16 @@ void unlock_global_read_lock(THD *thd) ("global_read_lock: %u global_read_lock_blocks_commit: %u", global_read_lock, global_read_lock_blocks_commit)); - pthread_mutex_lock(&LOCK_global_read_lock); + mysql_mutex_lock(&LOCK_global_read_lock); tmp= --global_read_lock; if (thd->global_read_lock == MADE_GLOBAL_READ_LOCK_BLOCK_COMMIT) --global_read_lock_blocks_commit; - pthread_mutex_unlock(&LOCK_global_read_lock); + mysql_mutex_unlock(&LOCK_global_read_lock); /* Send the signal outside the mutex to avoid a context switch */ if (!tmp) { DBUG_PRINT("signal", ("Broadcasting COND_global_read_lock")); - pthread_cond_broadcast(&COND_global_read_lock); + mysql_cond_broadcast(&COND_global_read_lock); } thd->global_read_lock= 0; @@ -1510,7 +1510,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, */ mysql_mutex_assert_not_owner(&LOCK_open); - (void) pthread_mutex_lock(&LOCK_global_read_lock); + mysql_mutex_lock(&LOCK_global_read_lock); if ((need_exit_cond= must_wait)) { if (thd->global_read_lock) // This thread had the read locks @@ -1518,7 +1518,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, if (is_not_commit) my_message(ER_CANT_UPDATE_WITH_READLOCK, ER(ER_CANT_UPDATE_WITH_READLOCK), MYF(0)); - (void) pthread_mutex_unlock(&LOCK_global_read_lock); + mysql_mutex_unlock(&LOCK_global_read_lock); /* We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does. This allowance is needed to not break existing versions of innobackup @@ -1532,7 +1532,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, (!abort_on_refresh || thd->version == refresh_version)) { DBUG_PRINT("signal", ("Waiting for COND_global_read_lock")); - (void) pthread_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock); + mysql_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock); DBUG_PRINT("signal", ("Got COND_global_read_lock")); } if (thd->killed) @@ -1547,7 +1547,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, if (unlikely(need_exit_cond)) thd->exit_cond(old_message); // this unlocks LOCK_global_read_lock else - pthread_mutex_unlock(&LOCK_global_read_lock); + mysql_mutex_unlock(&LOCK_global_read_lock); DBUG_RETURN(result); } @@ -1558,13 +1558,13 @@ void start_waiting_global_read_lock(THD *thd) DBUG_ENTER("start_waiting_global_read_lock"); if (unlikely(thd->global_read_lock)) DBUG_VOID_RETURN; - (void) pthread_mutex_lock(&LOCK_global_read_lock); + mysql_mutex_lock(&LOCK_global_read_lock); DBUG_ASSERT(protect_against_global_read_lock); tmp= (!--protect_against_global_read_lock && (waiting_for_read_lock || global_read_lock_blocks_commit)); - (void) pthread_mutex_unlock(&LOCK_global_read_lock); + mysql_mutex_unlock(&LOCK_global_read_lock); if (tmp) - pthread_cond_broadcast(&COND_global_read_lock); + mysql_cond_broadcast(&COND_global_read_lock); DBUG_VOID_RETURN; } @@ -1580,7 +1580,7 @@ bool make_global_read_lock_block_commit(THD *thd) */ if (thd->global_read_lock != GOT_GLOBAL_READ_LOCK) DBUG_RETURN(0); - pthread_mutex_lock(&LOCK_global_read_lock); + mysql_mutex_lock(&LOCK_global_read_lock); /* increment this BEFORE waiting on cond (otherwise race cond) */ global_read_lock_blocks_commit++; /* For testing we set up some blocking, to see if we can be killed */ @@ -1589,7 +1589,7 @@ bool make_global_read_lock_block_commit(THD *thd) old_message= thd->enter_cond(&COND_global_read_lock, &LOCK_global_read_lock, "Waiting for all running commits to finish"); while (protect_against_global_read_lock && !thd->killed) - pthread_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock); + mysql_cond_wait(&COND_global_read_lock, &LOCK_global_read_lock); DBUG_EXECUTE_IF("make_global_read_lock_block_commit_loop", protect_against_global_read_lock--;); if ((error= test(thd->killed))) @@ -1623,7 +1623,7 @@ bool make_global_read_lock_block_commit(THD *thd) void broadcast_refresh(void) { mysql_cond_broadcast(&COND_refresh); - pthread_cond_broadcast(&COND_global_read_lock); + mysql_cond_broadcast(&COND_global_read_lock); } /** diff --git a/sql/log.cc b/sql/log.cc index 74239555c88..3680398f068 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -168,24 +168,24 @@ char *make_log_name(char *buff, const char *name, const char* log_ext) class Mutex_sentry { public: - Mutex_sentry(pthread_mutex_t *mutex) + Mutex_sentry(mysql_mutex_t *mutex) : m_mutex(mutex) { if (m_mutex) - pthread_mutex_lock(mutex); + mysql_mutex_lock(mutex); } ~Mutex_sentry() { if (m_mutex) - pthread_mutex_unlock(m_mutex); + mysql_mutex_unlock(m_mutex); #ifndef DBUG_OFF m_mutex= 0; #endif } private: - pthread_mutex_t *m_mutex; + mysql_mutex_t *m_mutex; // It's not allowed to copy this object in any way Mutex_sentry(Mutex_sentry const&); @@ -437,7 +437,7 @@ bool Log_to_csv_event_handler:: table_list.db_length= MYSQL_SCHEMA_NAME.length; /* - 1) open_performance_schema_table generates an error of the + 1) open_log_table generates an error of the table can not be opened or is corrupted. 2) "INSERT INTO general_log" can generate warning sometimes. @@ -450,8 +450,7 @@ bool Log_to_csv_event_handler:: thd->push_internal_handler(& error_handler); need_pop= TRUE; - if (!(table= open_performance_schema_table(thd, & table_list, - & open_tables_backup))) + if (!(table= open_log_table(thd, &table_list, &open_tables_backup))) goto err; need_close= TRUE; @@ -531,7 +530,7 @@ err: if (need_pop) thd->pop_internal_handler(); if (need_close) - close_performance_schema_table(thd, & open_tables_backup); + close_log_table(thd, &open_tables_backup); thd->variables.option_bits= save_thd_options; thd->time_zone_used= save_time_zone_used; @@ -601,8 +600,7 @@ bool Log_to_csv_event_handler:: table_list.db= MYSQL_SCHEMA_NAME.str; table_list.db_length= MYSQL_SCHEMA_NAME.length; - if (!(table= open_performance_schema_table(thd, & table_list, - & open_tables_backup))) + if (!(table= open_log_table(thd, &table_list, &open_tables_backup))) goto err; need_close= TRUE; @@ -727,7 +725,7 @@ err: table->file->ha_release_auto_increment(); } if (need_close) - close_performance_schema_table(thd, & open_tables_backup); + close_log_table(thd, &open_tables_backup); thd->time_zone_used= save_time_zone_used; DBUG_RETURN(result); } @@ -761,12 +759,11 @@ int Log_to_csv_event_handler:: table_list.db= MYSQL_SCHEMA_NAME.str; table_list.db_length= MYSQL_SCHEMA_NAME.length; - table= open_performance_schema_table(thd, & table_list, - & open_tables_backup); + table= open_log_table(thd, &table_list, &open_tables_backup); if (table) { result= 0; - close_performance_schema_table(thd, & open_tables_backup); + close_log_table(thd, &open_tables_backup); } else result= 1; @@ -902,7 +899,7 @@ bool LOGGER::error_log_print(enum loglevel level, const char *format, void LOGGER::cleanup_base() { DBUG_ASSERT(inited == 1); - rwlock_destroy(&LOCK_logger); + mysql_rwlock_destroy(&LOCK_logger); if (table_log_handler) { table_log_handler->cleanup(); @@ -947,7 +944,7 @@ void LOGGER::init_base() init_error_log(LOG_FILE); file_log_handler->init_pthread_objects(); - my_rwlock_init(&LOCK_logger, NULL); + mysql_rwlock_init(key_rwlock_LOCK_logger, &LOCK_logger); } @@ -1815,8 +1812,9 @@ File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg) File file; DBUG_ENTER("open_binlog"); - if ((file = my_open(log_file_name, O_RDONLY | O_BINARY | O_SHARE, - MYF(MY_WME))) < 0) + if ((file= mysql_file_open(key_file_binlog, + log_file_name, O_RDONLY | O_BINARY | O_SHARE, + MYF(MY_WME))) < 0) { sql_print_error("Failed to open log (file '%s', errno %d)", log_file_name, my_errno); @@ -1838,7 +1836,7 @@ File open_binlog(IO_CACHE *log, const char *log_file_name, const char **errmsg) err: if (file >= 0) { - my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); end_io_cache(log); } DBUG_RETURN(-1); @@ -2048,10 +2046,11 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, db[0]= 0; - if ((file= my_open(log_file_name, open_flags, - MYF(MY_WME | ME_WAITTANG))) < 0 || + if ((file= mysql_file_open(key_file_MYSQL_LOG, + log_file_name, open_flags, + MYF(MY_WME | ME_WAITTANG))) < 0 || init_io_cache(&log_file, file, IO_SIZE, io_cache_type, - my_tell(file, MYF(MY_WME)), 0, + mysql_file_tell(file, MYF(MY_WME)), 0, MYF(MY_WME | MY_NABP | ((log_type == LOG_BIN) ? MY_WAIT_IF_FULL : 0)))) goto err; @@ -2089,7 +2088,7 @@ Turning logging off for the whole duration of the MySQL server process. \ To turn it on again: fix the cause, \ shutdown the MySQL server and restart it.", name, errno); if (file >= 0) - my_close(file, MYF(0)); + mysql_file_close(file, MYF(0)); end_io_cache(&log_file); safeFree(name); log_state= LOG_CLOSED; @@ -2113,7 +2112,7 @@ void MYSQL_LOG::init_pthread_objects() { DBUG_ASSERT(inited == 0); inited= 1; - (void) pthread_mutex_init(&LOCK_log, MY_MUTEX_INIT_SLOW); + mysql_mutex_init(key_LOG_LOCK_log, &LOCK_log, MY_MUTEX_INIT_SLOW); } /* @@ -2138,13 +2137,13 @@ void MYSQL_LOG::close(uint exiting) { end_io_cache(&log_file); - if (my_sync(log_file.file, MYF(MY_WME)) && ! write_error) + if (mysql_file_sync(log_file.file, MYF(MY_WME)) && ! write_error) { write_error= 1; sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno); } - if (my_close(log_file.file, MYF(MY_WME)) && ! write_error) + if (mysql_file_close(log_file.file, MYF(MY_WME)) && ! write_error) { write_error= 1; sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno); @@ -2164,7 +2163,7 @@ void MYSQL_LOG::cleanup() if (inited) { inited= 0; - (void) pthread_mutex_destroy(&LOCK_log); + mysql_mutex_destroy(&LOCK_log); close(0); } DBUG_VOID_RETURN; @@ -2219,7 +2218,7 @@ void MYSQL_QUERY_LOG::reopen_file() DBUG_VOID_RETURN; } - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); save_name= name; name= 0; // Don't free name @@ -2232,7 +2231,7 @@ void MYSQL_QUERY_LOG::reopen_file() open(save_name, log_type, 0, io_cache_type); my_free(save_name, MYF(0)); - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_VOID_RETURN; } @@ -2274,7 +2273,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host, struct tm start; uint time_buff_len= 0; - (void) pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); /* Test if someone closed between the is_open test and lock */ if (is_open()) @@ -2323,7 +2322,7 @@ bool MYSQL_QUERY_LOG::write(time_t event_time, const char *user_host, goto err; } - (void) pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); return FALSE; err: @@ -2332,7 +2331,7 @@ err: write_error= 1; sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno); } - (void) pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); return TRUE; } @@ -2375,11 +2374,11 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time, bool error= 0; DBUG_ENTER("MYSQL_QUERY_LOG::write"); - (void) pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); if (!is_open()) { - (void) pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(0); } @@ -2488,7 +2487,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time, } } } - (void) pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(error); } @@ -2550,9 +2549,9 @@ void MYSQL_BIN_LOG::cleanup() close(LOG_CLOSE_INDEX|LOG_CLOSE_STOP_EVENT); delete description_event_for_queue; delete description_event_for_exec; - (void) pthread_mutex_destroy(&LOCK_log); - (void) pthread_mutex_destroy(&LOCK_index); - (void) pthread_cond_destroy(&update_cond); + mysql_mutex_destroy(&LOCK_log); + mysql_mutex_destroy(&LOCK_index); + mysql_cond_destroy(&update_cond); } DBUG_VOID_RETURN; } @@ -2573,9 +2572,9 @@ void MYSQL_BIN_LOG::init_pthread_objects() { DBUG_ASSERT(inited == 0); inited= 1; - (void) pthread_mutex_init(&LOCK_log, MY_MUTEX_INIT_SLOW); - (void) pthread_mutex_init(&LOCK_index, MY_MUTEX_INIT_SLOW); - (void) pthread_cond_init(&update_cond, 0); + mysql_mutex_init(key_LOG_LOCK_log, &LOCK_log, MY_MUTEX_INIT_SLOW); + mysql_mutex_init(key_BINLOG_LOCK_index, &LOCK_index, MY_MUTEX_INIT_SLOW); + mysql_cond_init(key_BINLOG_update_cond, &update_cond, 0); } @@ -2598,23 +2597,25 @@ bool MYSQL_BIN_LOG::open_index_file(const char *index_file_name_arg, } fn_format(index_file_name, index_file_name_arg, mysql_data_home, ".index", opt); - if ((index_file_nr= my_open(index_file_name, - O_RDWR | O_CREAT | O_BINARY , - MYF(MY_WME))) < 0 || - my_sync(index_file_nr, MYF(MY_WME)) || + if ((index_file_nr= mysql_file_open(key_file_binlog_index, + index_file_name, + O_RDWR | O_CREAT | O_BINARY, + MYF(MY_WME))) < 0 || + mysql_file_sync(index_file_nr, MYF(MY_WME)) || init_io_cache(&index_file, index_file_nr, IO_SIZE, WRITE_CACHE, - my_seek(index_file_nr,0L,MY_SEEK_END,MYF(0)), - 0, MYF(MY_WME | MY_WAIT_IF_FULL)) || + mysql_file_seek(index_file_nr, 0L, MY_SEEK_END, MYF(0)), + 0, MYF(MY_WME | MY_WAIT_IF_FULL)) || DBUG_EVALUATE_IF("fault_injection_openning_index", 1, 0)) { /* TODO: all operations creating/deleting the index file or a log, should call my_sync_dir() or my_sync_dir_by_file() to be durable. - TODO: file creation should be done with my_create() not my_open(). + TODO: file creation should be done with mysql_file_create() + not mysql_file_open(). */ if (index_file_nr >= 0) - my_close(index_file_nr,MYF(0)); + mysql_file_close(index_file_nr, MYF(0)); return TRUE; } @@ -2778,7 +2779,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, bytes_written+= description_event_for_queue->data_written; } if (flush_io_cache(&log_file) || - my_sync(log_file.file, MYF(MY_WME))) + mysql_file_sync(log_file.file, MYF(MY_WME))) goto err; if (write_file_name_to_index_file) @@ -2799,7 +2800,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name, strlen(log_file_name)) || my_b_write(&index_file, (uchar*) "\n", 1) || flush_io_cache(&index_file) || - my_sync(index_file.file, MYF(MY_WME))) + mysql_file_sync(index_file.file, MYF(MY_WME))) goto err; #ifdef HAVE_REPLICATION @@ -2826,7 +2827,7 @@ Turning logging off for the whole duration of the MySQL server process. \ To turn it on again: fix the cause, \ shutdown the MySQL server and restart it.", name, errno); if (file >= 0) - my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); end_io_cache(&log_file); end_io_cache(&index_file); safeFree(name); @@ -2837,9 +2838,9 @@ shutdown the MySQL server and restart it.", name, errno); int MYSQL_BIN_LOG::get_current_log(LOG_INFO* linfo) { - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); int ret = raw_get_current_log(linfo); - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); return ret; } @@ -2879,19 +2880,20 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset) for (;; offset+= bytes_read) { - (void) my_seek(file, offset, MY_SEEK_SET, MYF(0)); - if ((bytes_read= (int) my_read(file, io_buf, sizeof(io_buf), MYF(MY_WME))) + mysql_file_seek(file, offset, MY_SEEK_SET, MYF(0)); + if ((bytes_read= (int) mysql_file_read(file, io_buf, sizeof(io_buf), + MYF(MY_WME))) < 0) goto err; if (!bytes_read) break; // end of file - (void) my_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0)); - if (my_write(file, io_buf, bytes_read, MYF(MY_WME | MY_NABP))) + mysql_file_seek(file, offset-init_offset, MY_SEEK_SET, MYF(0)); + if (mysql_file_write(file, io_buf, bytes_read, MYF(MY_WME | MY_NABP))) goto err; } /* The following will either truncate the file or fill the end with \n' */ - if (my_chsize(file, offset - init_offset, '\n', MYF(MY_WME)) || - my_sync(file, MYF(MY_WME))) + if (mysql_file_chsize(file, offset - init_offset, '\n', MYF(MY_WME)) || + mysql_file_sync(file, MYF(MY_WME))) goto err; /* Reset data in old index cache */ @@ -2940,8 +2942,8 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, move from under our feet */ if (need_lock) - pthread_mutex_lock(&LOCK_index); - safe_mutex_assert_owner(&LOCK_index); + mysql_mutex_lock(&LOCK_index); + mysql_mutex_assert_owner(&LOCK_index); /* As the file is flushed, we can't get an error here */ (void) reinit_io_cache(&index_file, READ_CACHE, (my_off_t) 0, 0, 0); @@ -2975,7 +2977,7 @@ int MYSQL_BIN_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, } if (need_lock) - pthread_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_index); DBUG_RETURN(error); } @@ -3011,8 +3013,8 @@ int MYSQL_BIN_LOG::find_next_log(LOG_INFO* linfo, bool need_lock) char *fname= linfo->log_file_name; if (need_lock) - pthread_mutex_lock(&LOCK_index); - safe_mutex_assert_owner(&LOCK_index); + mysql_mutex_lock(&LOCK_index); + mysql_mutex_assert_owner(&LOCK_index); /* As the file is flushed, we can't get an error here */ (void) reinit_io_cache(&index_file, READ_CACHE, linfo->index_file_offset, 0, @@ -3029,7 +3031,7 @@ int MYSQL_BIN_LOG::find_next_log(LOG_INFO* linfo, bool need_lock) err: if (need_lock) - pthread_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_index); return error; } @@ -3064,8 +3066,8 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) We need to get both locks to be sure that no one is trying to write to the index log file. */ - pthread_mutex_lock(&LOCK_log); - pthread_mutex_lock(&LOCK_index); + mysql_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_index); /* The following mutex is needed to ensure that no threads call @@ -3167,8 +3169,8 @@ err: if (error == 1) name= const_cast(save_name); pthread_mutex_unlock(&LOCK_thread_count); - pthread_mutex_unlock(&LOCK_index); - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(error); } @@ -3222,7 +3224,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) DBUG_ASSERT(rli->slave_running == 1); DBUG_ASSERT(!strcmp(rli->linfo.log_file_name,rli->event_relay_log_name)); - pthread_mutex_lock(&LOCK_index); + mysql_mutex_lock(&LOCK_index); to_purge_if_included= my_strdup(rli->group_relay_log_name, MYF(0)); /* @@ -3266,19 +3268,19 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) DBUG_EXECUTE_IF("crash_before_purge_logs", abort();); - pthread_mutex_lock(&rli->log_space_lock); + mysql_mutex_lock(&rli->log_space_lock); rli->relay_log.purge_logs(to_purge_if_included, included, 0, 0, &rli->log_space_total); // Tell the I/O thread to take the relay_log_space_limit into account rli->ignore_log_space_limit= 0; - pthread_mutex_unlock(&rli->log_space_lock); + mysql_mutex_unlock(&rli->log_space_lock); /* Ok to broadcast after the critical region as there is no risk of the mutex being destroyed by this thread later - this helps save context switches */ - pthread_cond_broadcast(&rli->log_space_cond); + mysql_cond_broadcast(&rli->log_space_cond); /* * Need to update the log pos because purge logs has been called @@ -3300,7 +3302,7 @@ int MYSQL_BIN_LOG::purge_first_log(Relay_log_info* rli, bool included) err: my_free(to_purge_if_included, MYF(0)); - pthread_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_index); DBUG_RETURN(error); } @@ -3340,7 +3342,7 @@ int MYSQL_BIN_LOG::update_log_index(LOG_INFO* log_info, bool need_update_threads LOG_INFO_EOF to_log not found LOG_INFO_EMFILE too many files opened LOG_INFO_FATAL if any other than ENOENT error from - my_stat() or my_delete() + mysql_file_stat() or mysql_file_delete() */ int MYSQL_BIN_LOG::purge_logs(const char *to_log, @@ -3357,7 +3359,7 @@ int MYSQL_BIN_LOG::purge_logs(const char *to_log, DBUG_PRINT("info",("to_log= %s",to_log)); if (need_mutex) - pthread_mutex_lock(&LOCK_index); + mysql_mutex_lock(&LOCK_index); if ((error=find_log_pos(&log_info, to_log, 0 /*no mutex*/))) { sql_print_error("MYSQL_BIN_LOG::purge_logs was called with file %s not " @@ -3420,7 +3422,7 @@ err: DBUG_EXECUTE_IF("crash_purge_non_critical_after_update_index", abort();); if (need_mutex) - pthread_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_index); DBUG_RETURN(error); } @@ -3559,7 +3561,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space, /* Get rid of the trailing '\n' */ log_info.log_file_name[length-1]= 0; - if (!my_stat(log_info.log_file_name, &s, MYF(0))) + if (!mysql_file_stat(key_file_binlog, log_info.log_file_name, &s, MYF(0))) { if (my_errno == ENOENT) { @@ -3573,7 +3575,7 @@ int MYSQL_BIN_LOG::purge_index_entry(THD *thd, ulonglong *decrease_log_space, ER_LOG_PURGE_NO_FILE, ER(ER_LOG_PURGE_NO_FILE), log_info.log_file_name); } - sql_print_information("Failed to execute my_stat on file '%s'", + sql_print_information("Failed to execute mysql_file_stat on file '%s'", log_info.log_file_name); my_errno= 0; } @@ -3711,7 +3713,7 @@ err: @retval LOG_INFO_PURGE_NO_ROTATE Binary file that can't be rotated LOG_INFO_FATAL if any other than ENOENT error from - my_stat() or my_delete() + mysql_file_stat() or mysql_file_delete() */ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) @@ -3724,7 +3726,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) DBUG_ENTER("purge_logs_before_date"); - pthread_mutex_lock(&LOCK_index); + mysql_mutex_lock(&LOCK_index); to_log[0]= 0; if ((error=find_log_pos(&log_info, NullS, 0 /*no mutex*/))) @@ -3734,7 +3736,8 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) !is_active(log_info.log_file_name) && !log_in_use(log_info.log_file_name)) { - if (!my_stat(log_info.log_file_name, &stat_area, MYF(0))) + if (!mysql_file_stat(key_file_binlog, + log_info.log_file_name, &stat_area, MYF(0))) { if (my_errno == ENOENT) { @@ -3783,7 +3786,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) error= (to_log[0] ? purge_logs(to_log, 1, 0, 1, (ulonglong *) 0) : 0); err: - pthread_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_index); DBUG_RETURN(error); } #endif /* HAVE_REPLICATION */ @@ -3859,11 +3862,11 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) } if (need_lock) - pthread_mutex_lock(&LOCK_log); - pthread_mutex_lock(&LOCK_index); + mysql_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_index); - safe_mutex_assert_owner(&LOCK_log); - safe_mutex_assert_owner(&LOCK_index); + mysql_mutex_assert_owner(&LOCK_log); + mysql_mutex_assert_owner(&LOCK_index); /* if binlog is used as tc log, be sure all xids are "unlogged", @@ -3877,12 +3880,12 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) if (prepared_xids) { tc_log_page_waits++; - pthread_mutex_lock(&LOCK_prep_xids); + mysql_mutex_lock(&LOCK_prep_xids); while (prepared_xids) { DBUG_PRINT("info", ("prepared_xids=%lu", prepared_xids)); - pthread_cond_wait(&COND_prep_xids, &LOCK_prep_xids); + mysql_cond_wait(&COND_prep_xids, &LOCK_prep_xids); } - pthread_mutex_unlock(&LOCK_prep_xids); + mysql_mutex_unlock(&LOCK_prep_xids); } /* Reuse old name if not binlog and not update log */ @@ -3942,8 +3945,8 @@ void MYSQL_BIN_LOG::new_file_impl(bool need_lock) end: if (need_lock) - pthread_mutex_unlock(&LOCK_log); - pthread_mutex_unlock(&LOCK_index); + mysql_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_index); DBUG_VOID_RETURN; } @@ -3952,7 +3955,7 @@ end: bool MYSQL_BIN_LOG::append(Log_event* ev) { bool error = 0; - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); DBUG_ENTER("MYSQL_BIN_LOG::append"); DBUG_ASSERT(log_file.type == SEQ_READ_APPEND); @@ -3973,7 +3976,7 @@ bool MYSQL_BIN_LOG::append(Log_event* ev) new_file_without_locking(); err: - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); signal_update(); // Safe as we don't call close DBUG_RETURN(error); } @@ -3988,7 +3991,7 @@ bool MYSQL_BIN_LOG::appendv(const char* buf, uint len,...) DBUG_ASSERT(log_file.type == SEQ_READ_APPEND); - safe_mutex_assert_owner(&LOCK_log); + mysql_mutex_assert_owner(&LOCK_log); do { if (my_b_append(&log_file,(uchar*) buf,len)) @@ -4015,14 +4018,14 @@ bool MYSQL_BIN_LOG::flush_and_sync(bool *synced) int err=0, fd=log_file.file; if (synced) *synced= 0; - safe_mutex_assert_owner(&LOCK_log); + mysql_mutex_assert_owner(&LOCK_log); if (flush_io_cache(&log_file)) return 1; uint sync_period= get_sync_period(); if (sync_period && ++sync_counter >= sync_period) { sync_counter= 0; - err=my_sync(fd, MYF(MY_WME)); + err= mysql_file_sync(fd, MYF(MY_WME)); if (synced) *synced= 1; } @@ -4281,14 +4284,14 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd, m_table_map_version below, and that change has to be protected by the LOCK_log mutex. */ - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); /* Write pending event to log file or transaction cache */ if (pending->write(file)) { - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); set_write_error(thd); DBUG_RETURN(1); } @@ -4323,7 +4326,7 @@ MYSQL_BIN_LOG::flush_and_set_pending_rows_event(THD *thd, } } - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); } thd->binlog_set_pending_rows_event(event); @@ -4367,7 +4370,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) if (thd->binlog_flush_pending_rows_event(end_stmt)) DBUG_RETURN(error); - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); /* In most cases this is only called if 'is_open()' is true; in fact this is @@ -4387,7 +4390,7 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info) if ((thd && !(thd->variables.option_bits & OPTION_BIN_LOG)) || (!binlog_filter->db_ok(local_db))) { - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(0); } #endif /* HAVE_REPLICATION */ @@ -4523,7 +4526,7 @@ err: if (event_info->flags & LOG_EVENT_UPDATE_TABLE_MAP_VERSION_F) ++m_table_map_version; - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(error); } @@ -4603,7 +4606,7 @@ void MYSQL_BIN_LOG::rotate_and_purge(uint flags) bool check_purge= false; #endif if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)) - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); if ((flags & RP_FORCE_ROTATE) || (my_b_tell(&log_file) >= (my_off_t) max_size)) { @@ -4613,7 +4616,7 @@ void MYSQL_BIN_LOG::rotate_and_purge(uint flags) #endif } if (!(flags & RP_LOCK_LOG_IS_ALREADY_LOCKED)) - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); #ifdef HAVE_REPLICATION /* @@ -4632,9 +4635,9 @@ void MYSQL_BIN_LOG::rotate_and_purge(uint flags) uint MYSQL_BIN_LOG::next_file_id() { uint res; - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); res = file_id++; - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); return res; } @@ -4818,7 +4821,7 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool lock) Incident incident= INCIDENT_LOST_EVENTS; Incident_log_event ev(thd, incident, write_error_msg); if (lock) - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); error= ev.write(&log_file); if (lock) { @@ -4827,7 +4830,7 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool lock) signal_update(); rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); } - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); } DBUG_RETURN(error); } @@ -4860,7 +4863,7 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event, bool incident) { DBUG_ENTER("MYSQL_BIN_LOG::write(THD *, IO_CACHE *, Log_event *)"); - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); /* NULL would represent nothing to replicate after ROLLBACK */ DBUG_ASSERT(commit_event != NULL); @@ -4942,14 +4945,14 @@ bool MYSQL_BIN_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event, */ if (commit_event && commit_event->get_type_code() == XID_EVENT) { - pthread_mutex_lock(&LOCK_prep_xids); + mysql_mutex_lock(&LOCK_prep_xids); prepared_xids++; - pthread_mutex_unlock(&LOCK_prep_xids); + mysql_mutex_unlock(&LOCK_prep_xids); } else rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); } - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(0); @@ -4959,7 +4962,7 @@ err: write_error= 1; sql_print_error(ER(ER_ERROR_ON_WRITE), name, errno); } - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(1); } @@ -4981,10 +4984,10 @@ void MYSQL_BIN_LOG::wait_for_update_relay_log(THD* thd) DBUG_ENTER("wait_for_update_relay_log"); old_msg= thd->enter_cond(&update_cond, &LOCK_log, - "Slave has read all relay log; " + "Slave has read all relay log; " "waiting for the slave I/O " "thread to update it" ); - pthread_cond_wait(&update_cond, &LOCK_log); + mysql_cond_wait(&update_cond, &LOCK_log); thd->exit_cond(old_msg); DBUG_VOID_RETURN; } @@ -5015,10 +5018,10 @@ int MYSQL_BIN_LOG::wait_for_update_bin_log(THD* thd, "Master has sent all binlog to slave; " "waiting for binlog to be updated"); if (!timeout) - pthread_cond_wait(&update_cond, &LOCK_log); + mysql_cond_wait(&update_cond, &LOCK_log); else - ret= pthread_cond_timedwait(&update_cond, &LOCK_log, - const_cast(timeout)); + ret= mysql_cond_timedwait(&update_cond, &LOCK_log, + const_cast(timeout)); DBUG_RETURN(ret); } @@ -5058,16 +5061,16 @@ void MYSQL_BIN_LOG::close(uint exiting) if (log_file.type == WRITE_CACHE && log_type == LOG_BIN) { my_off_t offset= BIN_LOG_HEADER_SIZE + FLAGS_OFFSET; - my_off_t org_position= my_tell(log_file.file, MYF(0)); + my_off_t org_position= mysql_file_tell(log_file.file, MYF(0)); uchar flags= 0; // clearing LOG_EVENT_BINLOG_IN_USE_F - my_pwrite(log_file.file, &flags, 1, offset, MYF(0)); + mysql_file_pwrite(log_file.file, &flags, 1, offset, MYF(0)); /* Restore position so that anything we have in the IO_cache is written to the correct position. - We need the seek here, as my_pwrite() is not guaranteed to keep the + We need the seek here, as mysql_file_pwrite() is not guaranteed to keep the original position on system that doesn't support pwrite(). */ - my_seek(log_file.file, org_position, MY_SEEK_SET, MYF(0)); + mysql_file_seek(log_file.file, org_position, MY_SEEK_SET, MYF(0)); } /* this will cleanup IO_CACHE, sync and close the file */ @@ -5082,7 +5085,7 @@ void MYSQL_BIN_LOG::close(uint exiting) if ((exiting & LOG_CLOSE_INDEX) && my_b_inited(&index_file)) { end_io_cache(&index_file); - if (my_close(index_file.file, MYF(0)) < 0 && ! write_error) + if (mysql_file_close(index_file.file, MYF(0)) < 0 && ! write_error) { write_error= 1; sql_print_error(ER(ER_ERROR_ON_WRITE), index_file_name, errno); @@ -5104,10 +5107,10 @@ void MYSQL_BIN_LOG::set_max_size(ulong max_size_arg) it's like if the SET command was never run. */ DBUG_ENTER("MYSQL_BIN_LOG::set_max_size"); - pthread_mutex_lock(&LOCK_log); + mysql_mutex_lock(&LOCK_log); if (is_open()) max_size= max_size_arg; - pthread_mutex_unlock(&LOCK_log); + mysql_mutex_unlock(&LOCK_log); DBUG_VOID_RETURN; } @@ -5179,7 +5182,7 @@ bool flush_error_log() char err_renamed[FN_REFLEN], *end; end= strmake(err_renamed,log_error_file,FN_REFLEN-4); strmov(end, "-old"); - pthread_mutex_lock(&LOCK_error_log); + mysql_mutex_lock(&LOCK_error_log); #ifdef __WIN__ char err_temp[FN_REFLEN+4]; /* @@ -5187,7 +5190,7 @@ bool flush_error_log() the current error file. */ strxmov(err_temp, err_renamed,"-tmp",NullS); - (void) my_delete(err_temp, MYF(0)); + my_delete(err_temp, MYF(0)); if (freopen(err_temp,"a+",stdout)) { int fd; @@ -5196,27 +5199,27 @@ bool flush_error_log() freopen(err_temp,"a+",stderr); setbuf(stderr, NULL); - (void) my_delete(err_renamed, MYF(0)); - my_rename(log_error_file,err_renamed,MYF(0)); + my_delete(err_renamed, MYF(0)); + my_rename(log_error_file, err_renamed, MYF(0)); if (freopen(log_error_file,"a+",stdout)) { freopen(log_error_file,"a+",stderr); setbuf(stderr, NULL); } - if ((fd = my_open(err_temp, O_RDONLY, MYF(0))) >= 0) + if ((fd= my_open(err_temp, O_RDONLY, MYF(0))) >= 0) { - while ((bytes= my_read(fd, buf, IO_SIZE, MYF(0))) && + while ((bytes= mysql_file_read(fd, buf, IO_SIZE, MYF(0))) && bytes != MY_FILE_ERROR) my_fwrite(stderr, buf, bytes, MYF(0)); - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); } - (void) my_delete(err_temp, MYF(0)); + my_delete(err_temp, MYF(0)); } else result= 1; #else - my_rename(log_error_file,err_renamed,MYF(0)); + my_rename(log_error_file, err_renamed, MYF(0)); if (freopen(log_error_file,"a+",stdout)) { FILE *reopen; @@ -5226,7 +5229,7 @@ bool flush_error_log() else result= 1; #endif - pthread_mutex_unlock(&LOCK_error_log); + mysql_mutex_unlock(&LOCK_error_log); } return result; } @@ -5235,7 +5238,7 @@ void MYSQL_BIN_LOG::signal_update() { DBUG_ENTER("MYSQL_BIN_LOG::signal_update"); signal_cnt++; - pthread_cond_broadcast(&update_cond); + mysql_cond_broadcast(&update_cond); DBUG_VOID_RETURN; } @@ -5301,7 +5304,7 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer) DBUG_ENTER("print_buffer_to_file"); DBUG_PRINT("enter",("buffer: %s", buffer)); - pthread_mutex_lock(&LOCK_error_log); + mysql_mutex_lock(&LOCK_error_log); skr= my_time(0); localtime_r(&skr, &tm_tmp); @@ -5320,7 +5323,7 @@ static void print_buffer_to_file(enum loglevel level, const char *buffer) fflush(stderr); - pthread_mutex_unlock(&LOCK_error_log); + mysql_mutex_unlock(&LOCK_error_log); DBUG_VOID_RETURN; } @@ -5444,17 +5447,18 @@ int TC_LOG_MMAP::open(const char *opt_name) DBUG_ASSERT(TC_LOG_PAGE_SIZE % tc_log_page_size == 0); fn_format(logname,opt_name,mysql_data_home,"",MY_UNPACK_FILENAME); - if ((fd= my_open(logname, O_RDWR, MYF(0))) < 0) + if ((fd= mysql_file_open(key_file_tclog, logname, O_RDWR, MYF(0))) < 0) { if (my_errno != ENOENT) goto err; if (using_heuristic_recover()) return 1; - if ((fd= my_create(logname, CREATE_MODE, O_RDWR, MYF(MY_WME))) < 0) + if ((fd= mysql_file_create(key_file_tclog, logname, CREATE_MODE, + O_RDWR, MYF(MY_WME))) < 0) goto err; inited=1; file_length= opt_tc_log_size; - if (my_chsize(fd, file_length, 0, MYF(MY_WME))) + if (mysql_file_chsize(fd, file_length, 0, MYF(MY_WME))) goto err; } else @@ -5468,7 +5472,7 @@ int TC_LOG_MMAP::open(const char *opt_name) "--tc-heuristic-recover is used"); goto err; } - file_length= my_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE)); + file_length= mysql_file_seek(fd, 0L, MY_SEEK_END, MYF(MY_WME+MY_FAE)); if (file_length == MY_FILEPOS_ERROR || file_length % tc_log_page_size) goto err; } @@ -5492,8 +5496,8 @@ int TC_LOG_MMAP::open(const char *opt_name) pg->next=pg+1; pg->waiters=0; pg->state=POOL; - pthread_mutex_init(&pg->lock, MY_MUTEX_INIT_FAST); - pthread_cond_init (&pg->cond, 0); + mysql_mutex_init(key_PAGE_lock, &pg->lock, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_PAGE_cond, &pg->cond, 0); pg->start=(my_xid *)(data + i*tc_log_page_size); pg->end=(my_xid *)(pg->start + tc_log_page_size); pg->size=pg->free=tc_log_page_size/sizeof(my_xid); @@ -5512,11 +5516,11 @@ int TC_LOG_MMAP::open(const char *opt_name) my_msync(fd, data, tc_log_page_size, MS_SYNC); inited=5; - pthread_mutex_init(&LOCK_sync, MY_MUTEX_INIT_FAST); - pthread_mutex_init(&LOCK_active, MY_MUTEX_INIT_FAST); - pthread_mutex_init(&LOCK_pool, MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_active, 0); - pthread_cond_init(&COND_pool, 0); + mysql_mutex_init(key_LOCK_sync, &LOCK_sync, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_active, &LOCK_active, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_pool, &LOCK_pool, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_active, &COND_active, 0); + mysql_cond_init(key_COND_pool, &COND_pool, 0); inited=6; @@ -5550,7 +5554,7 @@ void TC_LOG_MMAP::get_active_from_pool() int best_free; if (syncing) - pthread_mutex_lock(&LOCK_pool); + mysql_mutex_lock(&LOCK_pool); do { @@ -5583,7 +5587,7 @@ void TC_LOG_MMAP::get_active_from_pool() pool_last=*best_p; if (syncing) - pthread_mutex_unlock(&LOCK_pool); + mysql_mutex_unlock(&LOCK_pool); } /** @@ -5598,7 +5602,7 @@ int TC_LOG_MMAP::overflow() let's check the behaviour of tc_log_page_waits first */ tc_log_page_waits++; - pthread_cond_wait(&COND_pool, &LOCK_pool); + mysql_cond_wait(&COND_pool, &LOCK_pool); return 1; // always return 1 } @@ -5635,7 +5639,7 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid) PAGE *p; ulong cookie; - pthread_mutex_lock(&LOCK_active); + mysql_mutex_lock(&LOCK_active); /* if active page is full - just wait... @@ -5645,14 +5649,14 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid) unlog() does not signal COND_active. */ while (unlikely(active && active->free == 0)) - pthread_cond_wait(&COND_active, &LOCK_active); + mysql_cond_wait(&COND_active, &LOCK_active); /* no active page ? take one from the pool */ if (active == 0) get_active_from_pool(); p=active; - pthread_mutex_lock(&p->lock); + mysql_mutex_lock(&p->lock); /* searching for an empty slot */ while (*p->ptr) @@ -5668,9 +5672,9 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid) p->state= DIRTY; /* to sync or not to sync - this is the question */ - pthread_mutex_unlock(&LOCK_active); - pthread_mutex_lock(&LOCK_sync); - pthread_mutex_unlock(&p->lock); + mysql_mutex_unlock(&LOCK_active); + mysql_mutex_lock(&LOCK_sync); + mysql_mutex_unlock(&p->lock); if (syncing) { // somebody's syncing. let's wait @@ -5680,24 +5684,24 @@ int TC_LOG_MMAP::log_xid(THD *thd, my_xid xid) as p->state may be not DIRTY when we come here */ while (p->state == DIRTY && syncing) - pthread_cond_wait(&p->cond, &LOCK_sync); + mysql_cond_wait(&p->cond, &LOCK_sync); p->waiters--; err= p->state == ERROR; if (p->state != DIRTY) // page was synced { if (p->waiters == 0) - pthread_cond_signal(&COND_pool); // in case somebody's waiting - pthread_mutex_unlock(&LOCK_sync); + mysql_cond_signal(&COND_pool); // in case somebody's waiting + mysql_mutex_unlock(&LOCK_sync); goto done; // we're done } } // page was not synced! do it now DBUG_ASSERT(active == p && syncing == 0); - pthread_mutex_lock(&LOCK_active); + mysql_mutex_lock(&LOCK_active); syncing=p; // place is vacant - take it active=0; // page is not active anymore - pthread_cond_broadcast(&COND_active); // in case somebody's waiting - pthread_mutex_unlock(&LOCK_active); - pthread_mutex_unlock(&LOCK_sync); + mysql_cond_broadcast(&COND_active); // in case somebody's waiting + mysql_mutex_unlock(&LOCK_active); + mysql_mutex_unlock(&LOCK_sync); err= sync(); done: @@ -5717,20 +5721,20 @@ int TC_LOG_MMAP::sync() err= my_msync(fd, syncing->start, 1, MS_SYNC); /* page is synced. let's move it to the pool */ - pthread_mutex_lock(&LOCK_pool); + mysql_mutex_lock(&LOCK_pool); pool_last->next=syncing; pool_last=syncing; syncing->next=0; syncing->state= err ? ERROR : POOL; - pthread_cond_broadcast(&syncing->cond); // signal "sync done" - pthread_cond_signal(&COND_pool); // in case somebody's waiting - pthread_mutex_unlock(&LOCK_pool); + mysql_cond_broadcast(&syncing->cond); // signal "sync done" + mysql_cond_signal(&COND_pool); // in case somebody's waiting + mysql_mutex_unlock(&LOCK_pool); /* marking 'syncing' slot free */ - pthread_mutex_lock(&LOCK_sync); + mysql_mutex_lock(&LOCK_sync); syncing=0; - pthread_cond_signal(&active->cond); // wake up a new syncer - pthread_mutex_unlock(&LOCK_sync); + mysql_cond_signal(&active->cond); // wake up a new syncer + mysql_mutex_unlock(&LOCK_sync); return err; } @@ -5748,15 +5752,15 @@ void TC_LOG_MMAP::unlog(ulong cookie, my_xid xid) DBUG_ASSERT(x >= p->start && x < p->end); *x=0; - pthread_mutex_lock(&p->lock); + mysql_mutex_lock(&p->lock); p->free++; DBUG_ASSERT(p->free <= p->size); set_if_smaller(p->ptr, x); if (p->free == p->size) // the page is completely empty statistic_decrement(tc_log_cur_pages_used, &LOCK_status); if (p->waiters == 0) // the page is in pool and ready to rock - pthread_cond_signal(&COND_pool); // ping ... for overflow() - pthread_mutex_unlock(&p->lock); + mysql_cond_signal(&COND_pool); // ping ... for overflow() + mysql_mutex_unlock(&p->lock); } void TC_LOG_MMAP::close() @@ -5764,29 +5768,29 @@ void TC_LOG_MMAP::close() uint i; switch (inited) { case 6: - pthread_mutex_destroy(&LOCK_sync); - pthread_mutex_destroy(&LOCK_active); - pthread_mutex_destroy(&LOCK_pool); - pthread_cond_destroy(&COND_pool); + mysql_mutex_destroy(&LOCK_sync); + mysql_mutex_destroy(&LOCK_active); + mysql_mutex_destroy(&LOCK_pool); + mysql_cond_destroy(&COND_pool); case 5: - data[0]='A'; // garble the first (signature) byte, in case my_delete fails + data[0]='A'; // garble the first (signature) byte, in case mysql_file_delete fails case 4: for (i=0; i < npages; i++) { if (pages[i].ptr == 0) break; - pthread_mutex_destroy(&pages[i].lock); - pthread_cond_destroy(&pages[i].cond); + mysql_mutex_destroy(&pages[i].lock); + mysql_cond_destroy(&pages[i].cond); } case 3: my_free((uchar*)pages, MYF(0)); case 2: my_munmap((char*)data, (size_t)file_length); case 1: - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); } if (inited>=5) // cannot do in the switch because of Windows - my_delete(logname, MYF(MY_WME)); + mysql_file_delete(key_file_tclog, logname, MYF(MY_WME)); inited=0; } @@ -5891,8 +5895,9 @@ int TC_LOG_BINLOG::open(const char *opt_name) DBUG_ASSERT(total_ha_2pc > 1); DBUG_ASSERT(opt_name && opt_name[0]); - pthread_mutex_init(&LOCK_prep_xids, MY_MUTEX_INIT_FAST); - pthread_cond_init (&COND_prep_xids, 0); + mysql_mutex_init(key_BINLOG_LOCK_prep_xids, + &LOCK_prep_xids, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_BINLOG_COND_prep_xids, &COND_prep_xids, 0); if (!my_b_inited(&index_file)) { @@ -5958,7 +5963,7 @@ int TC_LOG_BINLOG::open(const char *opt_name) delete ev; end_io_cache(&log); - my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); if (error) goto err; @@ -5972,8 +5977,8 @@ err: void TC_LOG_BINLOG::close() { DBUG_ASSERT(prepared_xids==0); - pthread_mutex_destroy(&LOCK_prep_xids); - pthread_cond_destroy (&COND_prep_xids); + mysql_mutex_destroy(&LOCK_prep_xids); + mysql_cond_destroy(&COND_prep_xids); } /** @@ -6000,13 +6005,13 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_xid xid) void TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid) { - pthread_mutex_lock(&LOCK_prep_xids); + mysql_mutex_lock(&LOCK_prep_xids); DBUG_ASSERT(prepared_xids > 0); if (--prepared_xids == 0) { DBUG_PRINT("info", ("prepared_xids=%lu", prepared_xids)); - pthread_cond_signal(&COND_prep_xids); + mysql_cond_signal(&COND_prep_xids); } - pthread_mutex_unlock(&LOCK_prep_xids); + mysql_mutex_unlock(&LOCK_prep_xids); rotate_and_purge(0); // as ::write() did not rotate } diff --git a/sql/log.h b/sql/log.h index 847fa3db6f9..db774bc62fb 100644 --- a/sql/log.h +++ b/sql/log.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 MySQL AB +/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,8 +65,8 @@ class TC_LOG_MMAP: public TC_LOG int size, free; // max and current number of free xid slots on the page int waiters; // number of waiters on condition PAGE_STATE state; // see above - pthread_mutex_t lock; // to access page data or control structure - pthread_cond_t cond; // to wait for a sync + mysql_mutex_t lock; // to access page data or control structure + mysql_cond_t cond; // to wait for a sync } PAGE; char logname[FN_REFLEN]; @@ -81,8 +81,8 @@ class TC_LOG_MMAP: public TC_LOG one has to use active->lock. Same for LOCK_pool and LOCK_sync */ - pthread_mutex_t LOCK_active, LOCK_pool, LOCK_sync; - pthread_cond_t COND_pool, COND_active; + mysql_mutex_t LOCK_active, LOCK_pool, LOCK_sync; + mysql_cond_t COND_pool, COND_active; public: TC_LOG_MMAP(): inited(0) {} @@ -136,21 +136,25 @@ extern TC_LOG_DUMMY tc_log_dummy; class Relay_log_info; +#ifdef HAVE_PSI_INTERFACE +extern PSI_mutex_key key_LOG_INFO_lock; +#endif + typedef struct st_log_info { char log_file_name[FN_REFLEN]; my_off_t index_file_offset, index_file_start_offset; my_off_t pos; bool fatal; // if the purge happens to give us a negative offset - pthread_mutex_t lock; + mysql_mutex_t lock; st_log_info() : index_file_offset(0), index_file_start_offset(0), pos(0), fatal(0) { log_file_name[0] = '\0'; - pthread_mutex_init(&lock, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOG_INFO_lock, &lock, MY_MUTEX_INIT_FAST); } - ~st_log_info() { pthread_mutex_destroy(&lock);} + ~st_log_info() { mysql_mutex_destroy(&lock);} } LOG_INFO; /* @@ -198,7 +202,7 @@ public: int generate_new_name(char *new_name, const char *log_name); protected: /* LOCK_log is inited by init_pthread_objects() */ - pthread_mutex_t LOCK_log; + mysql_mutex_t LOCK_log; char *name; char log_file_name[FN_REFLEN]; char time_buff[20], db[NAME_LEN + 1]; @@ -244,10 +248,10 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG { private: /* LOCK_log and LOCK_index are inited by init_pthread_objects() */ - pthread_mutex_t LOCK_index; - pthread_mutex_t LOCK_prep_xids; - pthread_cond_t COND_prep_xids; - pthread_cond_t update_cond; + mysql_mutex_t LOCK_index; + mysql_mutex_t LOCK_prep_xids; + mysql_cond_t COND_prep_xids; + mysql_cond_t update_cond; ulonglong bytes_written; IO_CACHE index_file; char index_file_name[FN_REFLEN]; @@ -452,11 +456,11 @@ public: inline char* get_index_fname() { return index_file_name;} inline char* get_log_fname() { return log_file_name; } inline char* get_name() { return name; } - inline pthread_mutex_t* get_log_lock() { return &LOCK_log; } + inline mysql_mutex_t* get_log_lock() { return &LOCK_log; } inline IO_CACHE* get_log_file() { return &log_file; } - inline void lock_index() { pthread_mutex_lock(&LOCK_index);} - inline void unlock_index() { pthread_mutex_unlock(&LOCK_index);} + inline void lock_index() { mysql_mutex_lock(&LOCK_index);} + inline void unlock_index() { mysql_mutex_unlock(&LOCK_index);} inline IO_CACHE *get_index_file() { return &index_file;} inline uint32 get_open_count() { return open_count; } }; @@ -551,7 +555,7 @@ public: /* Class which manages slow, general and error log event handlers */ class LOGGER { - rw_lock_t LOCK_logger; + mysql_rwlock_t LOCK_logger; /* flag to check whether logger mutex is initialized */ uint inited; @@ -571,9 +575,9 @@ public: LOGGER() : inited(0), table_log_handler(NULL), file_log_handler(NULL), is_log_tables_initialized(FALSE) {} - void lock_shared() { rw_rdlock(&LOCK_logger); } - void lock_exclusive() { rw_wrlock(&LOCK_logger); } - void unlock() { rw_unlock(&LOCK_logger); } + void lock_shared() { mysql_rwlock_rdlock(&LOCK_logger); } + void lock_exclusive() { mysql_rwlock_wrlock(&LOCK_logger); } + void unlock() { mysql_rwlock_unlock(&LOCK_logger); } bool is_log_table_enabled(uint log_table_type); bool log_command(THD *thd, enum enum_server_command command); diff --git a/sql/log_event.cc b/sql/log_event.cc index c03ac278e8a..985d2110c9b 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -497,7 +497,7 @@ static void cleanup_load_tmpdir() if (is_prefix(file->name, prefbuf)) { fn_format(fname,file->name,slave_load_tmpdir,"",MY_UNPACK_FILENAME); - my_delete(fname, MYF(0)); + mysql_file_delete(key_file_misc, fname, MYF(0)); } } @@ -967,7 +967,7 @@ bool Log_event::write_header(IO_CACHE* file, ulong event_data_length) */ int Log_event::read_log_event(IO_CACHE* file, String* packet, - pthread_mutex_t* log_lock) + mysql_mutex_t* log_lock) { ulong data_len; int result=0; @@ -975,7 +975,7 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, DBUG_ENTER("Log_event::read_log_event"); if (log_lock) - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); if (my_b_read(file, (uchar*) buf, sizeof(buf))) { /* @@ -1033,14 +1033,14 @@ int Log_event::read_log_event(IO_CACHE* file, String* packet, end: if (log_lock) - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); DBUG_RETURN(result); } #endif /* !MYSQL_CLIENT */ #ifndef MYSQL_CLIENT -#define UNLOCK_MUTEX if (log_lock) pthread_mutex_unlock(log_lock); -#define LOCK_MUTEX if (log_lock) pthread_mutex_lock(log_lock); +#define UNLOCK_MUTEX if (log_lock) mysql_mutex_unlock(log_lock); +#define LOCK_MUTEX if (log_lock) mysql_mutex_lock(log_lock); #else #define UNLOCK_MUTEX #define LOCK_MUTEX @@ -1052,7 +1052,7 @@ end: Allocates memory; The caller is responsible for clean-up. */ Log_event* Log_event::read_log_event(IO_CACHE* file, - pthread_mutex_t* log_lock, + mysql_mutex_t* log_lock, const Format_description_log_event *description_event) #else @@ -4932,7 +4932,7 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli) !is_relay_log_event() && !rli->is_in_group()) { - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); DBUG_PRINT("info", ("old group_master_log_name: '%s' " "old group_master_log_pos: %lu", rli->group_master_log_name, @@ -4944,7 +4944,7 @@ int Rotate_log_event::do_update_pos(Relay_log_info *rli) "new group_master_log_pos: %lu", rli->group_master_log_name, (ulong) rli->group_master_log_pos)); - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); flush_relay_log_info(rli); /* @@ -5765,8 +5765,8 @@ Slave_log_event::Slave_log_event(THD* thd_arg, Master_info* mi = rli->mi; // TODO: re-write this better without holding both locks at the same time - pthread_mutex_lock(&mi->data_lock); - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&mi->data_lock); + mysql_mutex_lock(&rli->data_lock); master_host_len = strlen(mi->host); master_log_len = strlen(rli->group_master_log_name); // on OOM, just do not initialize the structure and print the error @@ -5784,8 +5784,8 @@ Slave_log_event::Slave_log_event(THD* thd_arg, } else sql_print_error("Out of memory while recording slave event"); - pthread_mutex_unlock(&rli->data_lock); - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_VOID_RETURN; } #endif /* !MYSQL_CLIENT */ @@ -6142,10 +6142,12 @@ int Create_file_log_event::do_apply_event(Relay_log_info const *rli) fname_buf= strmov(proc_info, "Making temp file "); ext= slave_load_file_stem(fname_buf, file_id, server_id, ".info"); thd_proc_info(thd, proc_info); - my_delete(fname_buf, MYF(0)); // old copy may exist already - if ((fd= my_create(fname_buf, CREATE_MODE, - O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, - MYF(MY_WME))) < 0 || + /* old copy may exist already */ + mysql_file_delete(key_file_log_event_info, fname_buf, MYF(0)); + if ((fd= mysql_file_create(key_file_log_event_info, + fname_buf, CREATE_MODE, + O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, + MYF(MY_WME))) < 0 || init_io_cache(&file, fd, IO_SIZE, WRITE_CACHE, (my_off_t)0, 0, MYF(MY_WME|MY_NABP))) { @@ -6167,20 +6169,22 @@ int Create_file_log_event::do_apply_event(Relay_log_info const *rli) goto err; } end_io_cache(&file); - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); // fname_buf now already has .data, not .info, because we did our trick - my_delete(fname_buf, MYF(0)); // old copy may exist already - if ((fd= my_create(fname_buf, CREATE_MODE, - O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, - MYF(MY_WME))) < 0) + /* old copy may exist already */ + mysql_file_delete(key_file_log_event_data, fname_buf, MYF(0)); + if ((fd= mysql_file_create(key_file_log_event_data, + fname_buf, CREATE_MODE, + O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, + MYF(MY_WME))) < 0) { rli->report(ERROR_LEVEL, my_errno, "Error in Create_file event: could not open file '%s'", fname_buf); goto err; } - if (my_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP))) + if (mysql_file_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP))) { rli->report(ERROR_LEVEL, my_errno, "Error in Create_file event: write to '%s' failed", @@ -6193,7 +6197,7 @@ err: if (error) end_io_cache(&file); if (fd >= 0) - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); thd_proc_info(thd, 0); return error != 0; } @@ -6325,10 +6329,12 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli) */ lex_start(thd); mysql_reset_thd_for_next_command(thd); - my_delete(fname, MYF(0)); // old copy may exist already - if ((fd= my_create(fname, CREATE_MODE, - O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, - MYF(MY_WME))) < 0) + /* old copy may exist already */ + mysql_file_delete(key_file_log_event_data, fname, MYF(0)); + if ((fd= mysql_file_create(key_file_log_event_data, + fname, CREATE_MODE, + O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, + MYF(MY_WME))) < 0) { rli->report(ERROR_LEVEL, my_errno, "Error in %s event: could not create file '%s'", @@ -6336,8 +6342,10 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli) goto err; } } - else if ((fd = my_open(fname, O_WRONLY | O_APPEND | O_BINARY | O_NOFOLLOW, - MYF(MY_WME))) < 0) + else if ((fd= mysql_file_open(key_file_log_event_data, + fname, + O_WRONLY | O_APPEND | O_BINARY | O_NOFOLLOW, + MYF(MY_WME))) < 0) { rli->report(ERROR_LEVEL, my_errno, "Error in %s event: could not open file '%s'", @@ -6345,10 +6353,14 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli) goto err; } - DBUG_EXECUTE_IF("remove_slave_load_file_before_write", - my_close(fd,MYF(0)); fd= -1; my_delete(fname, MYF(0));); + DBUG_EXECUTE_IF("remove_slave_load_file_before_write", + { + mysql_file_close(fd, MYF(0)); + fd= -1; + mysql_file_delete(0, fname, MYF(0)); + }); - if (my_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP))) + if (mysql_file_write(fd, (uchar*) block, block_len, MYF(MY_WME+MY_NABP))) { rli->report(ERROR_LEVEL, my_errno, "Error in %s event: write to '%s' failed", @@ -6359,7 +6371,7 @@ int Append_block_log_event::do_apply_event(Relay_log_info const *rli) err: if (fd >= 0) - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); thd_proc_info(thd, 0); DBUG_RETURN(error); } @@ -6453,9 +6465,9 @@ int Delete_file_log_event::do_apply_event(Relay_log_info const *rli) { char fname[FN_REFLEN+10]; char *ext= slave_load_file_stem(fname, file_id, server_id, ".data"); - (void) my_delete(fname, MYF(MY_WME)); + mysql_file_delete(key_file_log_event_data, fname, MYF(MY_WME)); strmov(ext, ".info"); - (void) my_delete(fname, MYF(MY_WME)); + mysql_file_delete(key_file_log_event_info, fname, MYF(MY_WME)); return 0; } #endif /* defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT) */ @@ -6556,8 +6568,9 @@ int Execute_load_log_event::do_apply_event(Relay_log_info const *rli) Load_log_event *lev= 0; ext= slave_load_file_stem(fname, file_id, server_id, ".info"); - if ((fd = my_open(fname, O_RDONLY | O_BINARY | O_NOFOLLOW, - MYF(MY_WME))) < 0 || + if ((fd= mysql_file_open(key_file_log_event_info, + fname, O_RDONLY | O_BINARY | O_NOFOLLOW, + MYF(MY_WME))) < 0 || init_io_cache(&file, fd, IO_SIZE, READ_CACHE, (my_off_t)0, 0, MYF(MY_WME|MY_NABP))) { @@ -6567,7 +6580,7 @@ int Execute_load_log_event::do_apply_event(Relay_log_info const *rli) goto err; } if (!(lev = (Load_log_event*)Log_event::read_log_event(&file, - (pthread_mutex_t*)0, + (mysql_mutex_t*)0, rli->relay_log.description_event_for_exec)) || lev->get_type_code() != NEW_LOAD_EVENT) { @@ -6607,24 +6620,24 @@ int Execute_load_log_event::do_apply_event(Relay_log_info const *rli) } /* We have an open file descriptor to the .info file; we need to close it - or Windows will refuse to delete the file in my_delete(). + or Windows will refuse to delete the file in mysql_file_delete(). */ if (fd >= 0) { - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); end_io_cache(&file); fd= -1; } - (void) my_delete(fname, MYF(MY_WME)); + mysql_file_delete(key_file_log_event_info, fname, MYF(MY_WME)); memcpy(ext, ".data", 6); - (void) my_delete(fname, MYF(MY_WME)); + mysql_file_delete(key_file_log_event_data, fname, MYF(MY_WME)); error = 0; err: delete lev; if (fd >= 0) { - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); end_io_cache(&file); } return error; @@ -6863,7 +6876,7 @@ Execute_load_query_log_event::do_apply_event(Relay_log_info const *rli) file so that we can re-execute this event at START SLAVE. */ if (!error) - (void) my_delete(fname, MYF(MY_WME)); + mysql_file_delete(key_file_log_event_data, fname, MYF(MY_WME)); my_free(buf, MYF(MY_ALLOW_ZERO_PTR)); return error; diff --git a/sql/log_event.h b/sql/log_event.h index 1fdd7a05968..5dd5de26fcf 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -946,11 +946,11 @@ public: constructor and pass description_event as an argument. */ static Log_event* read_log_event(IO_CACHE* file, - pthread_mutex_t* log_lock, + mysql_mutex_t* log_lock, const Format_description_log_event *description_event); static int read_log_event(IO_CACHE* file, String* packet, - pthread_mutex_t* log_lock); + mysql_mutex_t* log_lock); /* init_show_field_list() prepares the column names and types for the output of SHOW BINLOG EVENTS; it is used only by SHOW BINLOG diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 1615ca97073..33ca7eee89b 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -891,7 +891,10 @@ inline bool check_routine_access(THD *thd,ulong want_access,char *db, char *name, bool is_proc, bool no_errors) { return false; } inline bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table) -{ return false; } +{ + table->grant.privilege= want_access; + return false; +} inline bool check_merge_table_access(THD *thd, char *db, TABLE_LIST *table_list) { return false; } inline bool check_some_routine_access(THD *thd, const char *db, @@ -1041,6 +1044,7 @@ int check_user(THD *thd, enum enum_server_command command, const char *passwd, uint passwd_len, const char *db, bool check_count); pthread_handler_t handle_one_connection(void *arg); +void do_handle_one_connection(THD *thd_arg); bool init_new_connection_handler_thread(); void reset_mqh(LEX_USER *lu, bool get_them); bool check_mqh(THD *thd, uint check_command); @@ -1093,6 +1097,7 @@ void init_max_user_conn(void); void init_update_queries(void); void free_max_user_conn(void); pthread_handler_t handle_bootstrap(void *arg); +void do_handle_bootstrap(THD *thd); int mysql_execute_command(THD *thd); bool do_command(THD *thd); bool dispatch_command(enum enum_server_command command, THD *thd, @@ -1117,15 +1122,17 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, bool *write_to_binlog); #ifndef NO_EMBEDDED_ACCESS_CHECKS bool check_access(THD *thd, ulong access, const char *db, ulong *save_priv, - bool no_grant, bool no_errors, bool schema_db); -bool check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables, + GRANT_INTERNAL_INFO *grant_internal_info, + bool no_grant, bool no_errors); +bool check_table_access(THD *thd, ulong requirements, TABLE_LIST *tables, bool any_combination_of_privileges_will_do, uint number, bool no_errors); #else inline bool check_access(THD *thd, ulong access, const char *db, - ulong *save_priv, bool no_grant, bool no_errors, - bool schema_db) + ulong *save_priv, + GRANT_INTERNAL_INFO *grant_internal_info, + bool no_grant, bool no_errors) { if (save_priv) *save_priv= GLOBAL_ACLS; @@ -1314,7 +1321,7 @@ bool table_is_used(TABLE *table, bool wait_for_name_lock); TABLE *drop_locked_tables(THD *thd,const char *db, const char *table_name); void abort_locked_tables(THD *thd,const char *db, const char *table_name); void execute_init_command(THD *thd, LEX_STRING *init_command, - rw_lock_t *var_mutex); + mysql_rwlock_t *var_mutex); extern Field *not_found_field; extern Field *view_ref_found; @@ -1355,7 +1362,7 @@ struct st_des_keyschedule extern char *des_key_file; extern struct st_des_keyschedule des_keyschedule[10]; extern uint des_default_key; -extern pthread_mutex_t LOCK_des_key_file; +extern mysql_mutex_t LOCK_des_key_file; bool load_des_key_file(const char *file_name); #endif /* HAVE_OPENSSL */ @@ -1402,6 +1409,8 @@ void free_status_vars(); void reset_status_vars(); /* information schema */ extern LEX_STRING INFORMATION_SCHEMA_NAME; +/* performance schema */ +extern LEX_STRING PERFORMANCE_SCHEMA_DB_NAME; /* log tables */ extern LEX_STRING MYSQL_SCHEMA_NAME; extern LEX_STRING GENERAL_LOG_NAME; @@ -1423,9 +1432,11 @@ bool get_schema_tables_result(JOIN *join, enum enum_schema_table_state executed_place); enum enum_schema_tables get_schema_table_idx(ST_SCHEMA_TABLE *schema_table); -#define is_schema_db(X) \ +#define is_infoschema_db(X) \ !my_strcasecmp(system_charset_info, INFORMATION_SCHEMA_NAME.str, (X)) +void initialize_information_schema_acl(); + /* sql_handler.cc */ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen); bool mysql_ha_close(THD *thd, TABLE_LIST *tables); @@ -1728,7 +1739,7 @@ void release_ddl_log(); void execute_ddl_log_recovery(); bool execute_ddl_log_entry(THD *thd, uint first_entry); -extern pthread_mutex_t LOCK_gdl; +extern mysql_mutex_t LOCK_gdl; #define WFRM_WRITE_SHADOW 1 #define WFRM_INSTALL_SHADOW 2 @@ -1745,9 +1756,8 @@ bool open_system_tables_for_read(THD *thd, TABLE_LIST *table_list, void close_system_tables(THD *thd, Open_tables_state *backup); TABLE *open_system_table_for_update(THD *thd, TABLE_LIST *one_table); -TABLE *open_performance_schema_table(THD *thd, TABLE_LIST *one_table, - Open_tables_state *backup); -void close_performance_schema_table(THD *thd, Open_tables_state *backup); +TABLE *open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_state *backup); +void close_log_table(THD *thd, Open_tables_state *backup); bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock, bool wait_for_refresh, bool wait_for_placeholders); @@ -2034,31 +2044,29 @@ extern my_bool old_mode; extern MYSQL_PLUGIN_IMPORT MYSQL_BIN_LOG mysql_bin_log; extern LOGGER logger; extern TABLE_LIST general_log, slow_log; -extern FILE *bootstrap_file; +extern MYSQL_FILE *bootstrap_file; extern int bootstrap_error; extern FILE *stderror_file; extern pthread_key(MEM_ROOT**,THR_MALLOC); -extern pthread_mutex_t LOCK_mapped_file, - LOCK_error_log, LOCK_uuid_generator, - LOCK_crypt, LOCK_timezone, +extern mysql_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_lock_db, + LOCK_mapped_file, LOCK_user_locks, LOCK_status, + LOCK_error_log, LOCK_delayed_insert, LOCK_uuid_generator, + LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone, LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock, LOCK_global_system_variables, LOCK_user_conn, LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_connection_count; -extern mysql_mutex_t LOCK_mysql_create_db, LOCK_lock_db, LOCK_open, - LOCK_user_locks, LOCK_status, LOCK_delayed_status, LOCK_delayed_insert, - LOCK_delayed_create; extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count; #ifdef HAVE_OPENSSL -extern pthread_mutex_t LOCK_des_key_file; +extern mysql_mutex_t LOCK_des_key_file; #endif -extern pthread_mutex_t LOCK_server_started; -extern pthread_cond_t COND_server_started; +extern mysql_mutex_t LOCK_server_started; +extern mysql_cond_t COND_server_started; extern int mysqld_server_started; -extern rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; -extern rw_lock_t LOCK_system_variables_hash; -extern mysql_cond_t COND_refresh; -extern pthread_cond_t COND_thread_count, COND_manager; -extern pthread_cond_t COND_global_read_lock; +extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; +extern mysql_rwlock_t LOCK_system_variables_hash; +extern pthread_cond_t COND_thread_count; +extern mysql_cond_t COND_refresh, COND_manager; +extern mysql_cond_t COND_global_read_lock; extern pthread_attr_t connection_attrib; extern I_List threads; extern MY_BITMAP temp_pool; @@ -2081,7 +2089,6 @@ extern String null_string; extern HASH open_cache, lock_db_cache; extern TABLE *unused_tables; extern const char* any_db; -extern struct my_option my_long_options[]; extern const LEX_STRING view_type; extern scheduler_functions thread_scheduler; extern TYPELIB thread_handling_typelib; @@ -2644,4 +2651,69 @@ extern "C" int test_if_data_home_dir(const char *dir); #endif /* MYSQL_CLIENT */ +#ifdef MYSQL_SERVER +#ifdef HAVE_PSI_INTERFACE +#ifdef HAVE_MMAP +extern PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, + key_LOCK_pool; +#endif /* HAVE_MMAP */ + +#ifdef HAVE_OPENSSL +extern PSI_mutex_key key_LOCK_des_key_file; +#endif + +extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, + key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, + key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create, + key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log, + key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables, + key_LOCK_lock_db, key_LOCK_logger, key_LOCK_manager, key_LOCK_mapped_file, + key_LOCK_mysql_create_db, key_LOCK_open, key_LOCK_prepared_stmt_count, + key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status, + key_LOCK_table_share, key_LOCK_thd_data, + key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log, + key_master_info_data_lock, key_master_info_run_lock, + key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock, + key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, + key_structure_guard_mutex, key_TABLE_SHARE_mutex, key_LOCK_error_messages; + +extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, + key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, + key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock; + +#ifdef HAVE_MMAP +extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; +#endif /* HAVE_MMAP */ + +extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, + key_COND_cache_status_changed, key_COND_global_read_lock, key_COND_manager, + key_COND_refresh, key_COND_rpl_status, key_COND_server_started, + key_delayed_insert_cond, key_delayed_insert_cond_client, + key_item_func_sleep_cond, key_master_info_data_cond, + key_master_info_start_cond, key_master_info_stop_cond, + key_relay_log_info_data_cond, key_relay_log_info_log_space_cond, + key_relay_log_info_start_cond, key_relay_log_info_stop_cond, + key_TABLE_SHARE_cond, key_user_level_lock_cond; + +extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, + key_thread_handle_manager, key_thread_kill_server, key_thread_main, + key_thread_one_connection, key_thread_signal_hand; + +#ifdef HAVE_MMAP +extern PSI_file_key key_file_map; +#endif /* HAVE_MMAP */ + +extern PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest, + key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file, + key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load, + key_file_loadfile, key_file_log_event_data, key_file_log_event_info, + key_file_master_info, key_file_misc, key_file_MYSQL_LOG, key_file_partition, + key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog, + key_file_trg, key_file_trn, key_file_init; + +void init_server_psi_keys(); +#endif /* HAVE_PSI_INTERFACE */ +#endif /* MYSQL_SERVER */ + + #endif /* MYSQL_PRIV_H */ diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d49e893aaa1..f07410e0d43 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -28,6 +28,11 @@ #include "events.h" #include "probes_mysql.h" #include "debug_sync.h" + +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE +#include "../storage/perfschema/pfs_server.h" +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + #include "keycaches.h" #include "../storage/myisam/ha_myisam.h" #include "set_var.h" @@ -294,6 +299,24 @@ TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"", /* static variables */ +#ifdef HAVE_PSI_INTERFACE +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) +static PSI_thread_key key_thread_handle_con_namedpipes; +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ + +#if defined(HAVE_SMEM) && !defined(EMBEDDED_LIBRARY) +static PSI_thread_key key_thread_handle_con_sharedmem; +#endif /* HAVE_SMEM && !EMBEDDED_LIBRARY */ + +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) +static PSI_thread_key key_thread_handle_con_sockets; +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ + +#ifdef __WIN__ +static PSI_thread_key key_thread_handle_shutdown; +#endif /* __WIN__ */ +#endif /* HAVE_PSI_INTERFACE */ + /* the default log output is log tables */ static bool lower_case_table_names_used= 0; static bool volatile select_thread_in_use, signal_thread_in_use; @@ -318,6 +341,7 @@ static bool binlog_format_used= false; LEX_STRING opt_init_connect, opt_init_slave; +/* Not instrumented because of LOCK_thread_count */ static pthread_cond_t COND_thread_cache, COND_flush_thread_cache; /* Global variables */ @@ -545,7 +569,7 @@ Lt_creator lt_creator; Ge_creator ge_creator; Le_creator le_creator; -FILE *bootstrap_file; +MYSQL_FILE *bootstrap_file; int bootstrap_error; FILE *stderror_file=0; @@ -577,16 +601,16 @@ SHOW_COMP_OPTION have_profiling; pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); -pthread_mutex_t LOCK_thread_count, - LOCK_mapped_file, LOCK_global_read_lock, - LOCK_error_log, LOCK_uuid_generator, - LOCK_crypt, - LOCK_global_system_variables, - LOCK_user_conn, LOCK_slave_list, LOCK_active_mi, - LOCK_connection_count, LOCK_error_messages; -mysql_mutex_t LOCK_open, LOCK_mysql_create_db, LOCK_status, LOCK_delayed_status, - LOCK_delayed_insert, LOCK_delayed_create; - +/* Not instrumented because of Bug#47396 */ +pthread_mutex_t LOCK_thread_count; +mysql_mutex_t LOCK_mysql_create_db, LOCK_open, + LOCK_mapped_file, LOCK_status, LOCK_global_read_lock, + LOCK_error_log, LOCK_uuid_generator, + LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create, + LOCK_crypt, + LOCK_global_system_variables, + LOCK_user_conn, LOCK_slave_list, LOCK_active_mi, + LOCK_connection_count, LOCK_error_messages; /** The below lock protects access to two global server variables: max_prepared_stmt_count and prepared_stmt_count. These variables @@ -594,18 +618,18 @@ mysql_mutex_t LOCK_open, LOCK_mysql_create_db, LOCK_status, LOCK_delayed_status, in the server, respectively. As PREPARE/DEALLOCATE rate in a loaded server may be fairly high, we need a dedicated lock. */ -pthread_mutex_t LOCK_prepared_stmt_count; +mysql_mutex_t LOCK_prepared_stmt_count; #ifdef HAVE_OPENSSL -pthread_mutex_t LOCK_des_key_file; +mysql_mutex_t LOCK_des_key_file; #endif -rw_lock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; -rw_lock_t LOCK_system_variables_hash; -mysql_cond_t COND_refresh; -pthread_cond_t COND_thread_count, COND_global_read_lock; +mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; +mysql_rwlock_t LOCK_system_variables_hash; +pthread_cond_t COND_thread_count; +mysql_cond_t COND_refresh, COND_global_read_lock; pthread_t signal_thread; pthread_attr_t connection_attrib; -pthread_mutex_t LOCK_server_started; -pthread_cond_t COND_server_started; +mysql_mutex_t LOCK_server_started; +mysql_cond_t COND_server_started; int mysqld_server_started= 0; @@ -630,13 +654,176 @@ static int cleanup_done; static ulong opt_specialflag; static char *opt_update_logname, *opt_binlog_index_name; char *mysql_home_ptr, *pidfile_name_ptr; +/** Initial command line arguments (count), after load_defaults().*/ static int defaults_argc; +/** + Initial command line arguments (arguments), after load_defaults(). + This memory is allocated by @c load_defaults() and should be freed + using @c free_defaults(). + Do not modify defaults_argc / defaults_argv, + use remaining_argc / remaining_argv instead to parse the command + line arguments in multiple steps. +*/ static char **defaults_argv; +/** Remaining command line arguments (count), filtered by handle_options().*/ +static int remaining_argc; +/** Remaining command line arguments (arguments), filtered by handle_options().*/ +static char **remaining_argv; static char *opt_bin_logname; int orig_argc; char **orig_argv; +/* + Since buffered_option_error_reporter is only used currently + for parsing performance schema options, this code is not needed + when the performance schema is not compiled in. +*/ +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE +/** + A log message for the error log, buffered in memory. + Log messages are temporarily buffered when generated before the error log + is initialized, and then printed once the error log is ready. +*/ +class Buffered_log : public Sql_alloc +{ +public: + Buffered_log(enum loglevel level, const char *message); + + ~Buffered_log() + {} + + void print(void); + +private: + /** Log message level. */ + enum loglevel m_level; + /** Log message text. */ + String m_message; +}; + +/** + Constructor. + @param level the message log level + @param message the message text +*/ +Buffered_log::Buffered_log(enum loglevel level, const char *message) + : m_level(level), m_message() +{ + m_message.copy(message, strlen(message), &my_charset_latin1); +} + +/** + Print a buffered log to the real log file. +*/ +void Buffered_log::print() +{ + /* + Since messages are buffered, they can be printed out + of order with other entries in the log. + Add "Buffered xxx" to the message text to prevent confusion. + */ + switch(m_level) + { + case ERROR_LEVEL: + sql_print_error("Buffered error: %s\n", m_message.c_ptr_safe()); + break; + case WARNING_LEVEL: + sql_print_warning("Buffered warning: %s\n", m_message.c_ptr_safe()); + break; + case INFORMATION_LEVEL: + sql_print_information("Buffered information: %s\n", m_message.c_ptr_safe()); + break; + } +} + +/** + Collection of all the buffered log messages. +*/ +class Buffered_logs +{ +public: + Buffered_logs() + {} + + ~Buffered_logs() + {} + + void init(); + void cleanup(); + + void buffer(enum loglevel m_level, const char *msg); + void print(); +private: + /** + Memory root to use to store buffered logs. + This memory root lifespan is between init and cleanup. + Once the buffered logs are printed, they are not needed anymore, + and all the memory used is reclaimed. + */ + MEM_ROOT m_root; + /** List of buffered log messages. */ + List m_list; +}; + +void Buffered_logs::init() +{ + init_alloc_root(&m_root, 1024, 0); +} + +void Buffered_logs::cleanup() +{ + m_list.delete_elements(); + free_root(&m_root, MYF(0)); +} + +/** + Add a log message to the buffer. +*/ +void Buffered_logs::buffer(enum loglevel level, const char *msg) +{ + /* + Do not let Sql_alloc::operator new(size_t) allocate memory, + there is no memory root associated with the main() thread. + Give explicitly the proper memory root to use to + Sql_alloc::operator new(size_t, MEM_ROOT *) instead. + */ + Buffered_log *log= new (&m_root) Buffered_log(level, msg); + if (log) + m_list.push_back(log, &m_root); +} + +/** + Print buffered log messages. +*/ +void Buffered_logs::print() +{ + Buffered_log *log; + List_iterator_fast it(m_list); + while ((log= it++)) + log->print(); +} + +/** Logs reported before a logger is available. */ +static Buffered_logs buffered_logs; + +/** + Error reporter that buffer log messages. + @param level log message level + @param format log message format string +*/ +void buffered_option_error_reporter(enum loglevel level, const char *format, ...) +{ + va_list args; + char buffer[1024]; + + va_start(args, format); + my_vsnprintf(buffer, sizeof(buffer), format, args); + va_end(args); + buffered_logs.buffer(level, buffer); +} +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + static my_socket unix_sock,ip_sock; struct rand_struct sql_rand; ///< used by sql_class.cc:THD::THD() @@ -710,7 +897,7 @@ char *opt_ssl_ca= NULL, *opt_ssl_capath= NULL, *opt_ssl_cert= NULL, #ifndef HAVE_YASSL typedef struct CRYPTO_dynlock_value { - rw_lock_t lock; + mysql_rwlock_t lock; } openssl_lock_t; static openssl_lock_t *openssl_stdlocks; @@ -734,10 +921,14 @@ uint connection_count= 0; pthread_handler_t signal_hand(void *arg); static int mysql_init_variables(void); -static int get_options(int *argc,char **argv); +extern "C" void option_error_reporter(enum loglevel level, const char *format, ...); +static int get_options(int *argc_ptr, char ***argv_ptr); +static bool add_terminator(DYNAMIC_ARRAY *options); extern "C" my_bool mysqld_get_one_option(int, const struct my_option *, char *); static void set_server_version(void); static int init_thread_environment(); +static void init_error_log_mutex(); +static void clean_up_error_log_mutex(); static char *get_relative_path(const char *path); static int fix_paths(void); void handle_connections_sockets(); @@ -745,7 +936,7 @@ void handle_connections_sockets(); pthread_handler_t handle_connections_sockets_thread(void *arg); #endif pthread_handler_t kill_server_thread(void *arg); -static void bootstrap(FILE *file); +static void bootstrap(MYSQL_FILE *file); static bool read_init_file(char *file_name); #ifdef _WIN32 pthread_handler_t handle_connections_namedpipes(void *arg); @@ -898,7 +1089,7 @@ static void close_connections(void) mysql_mutex_unlock(&tmp->mysys_var->mutex); } } - (void) pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list + pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list Events::deinit(); end_slave(); @@ -1034,8 +1225,9 @@ void kill_mysql(void) { pthread_t tmp; abort_loop=1; - if (pthread_create(&tmp,&connection_attrib, kill_server_thread, - (void*) 0)) + if (mysql_thread_create(0, /* Not instrumented */ + &tmp, &connection_attrib, kill_server_thread, + (void*) 0)) sql_print_error("Can't create thread to kill server"); } #endif @@ -1185,6 +1377,7 @@ extern "C" void unireg_abort(int exit_code) DBUG_PRINT("quit",("done with cleanup in unireg_abort")); wait_for_signal_thread_to_end(); clean_up_mutexes(); + clean_up_error_log_mutex(); my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); exit(exit_code); /* purecov: inspected */ } @@ -1272,7 +1465,7 @@ void clean_up(bool print_message) #if !defined(EMBEDDED_LIBRARY) if (!opt_bootstrap) - (void) my_delete(pidfile_name,MYF(0)); // This may not always exist + mysql_file_delete(key_file_pid, pidfile_name, MYF(0)); // This may not always exist #endif if (print_message && my_default_lc_messages && server_start_time) sql_print_information(ER_DEFAULT(ER_SHUTDOWN_COMPLETE),my_progname); @@ -1328,47 +1521,46 @@ static void clean_up_mutexes() { mysql_mutex_destroy(&LOCK_mysql_create_db); mysql_mutex_destroy(&LOCK_lock_db); - (void) rwlock_destroy(&LOCK_grant); + mysql_rwlock_destroy(&LOCK_grant); mysql_mutex_destroy(&LOCK_open); - (void) pthread_mutex_destroy(&LOCK_thread_count); - (void) pthread_mutex_destroy(&LOCK_mapped_file); + pthread_mutex_destroy(&LOCK_thread_count); + mysql_mutex_destroy(&LOCK_mapped_file); mysql_mutex_destroy(&LOCK_status); - (void) pthread_mutex_destroy(&LOCK_error_log); mysql_mutex_destroy(&LOCK_delayed_insert); mysql_mutex_destroy(&LOCK_delayed_status); mysql_mutex_destroy(&LOCK_delayed_create); - (void) pthread_mutex_destroy(&LOCK_manager); - (void) pthread_mutex_destroy(&LOCK_crypt); - (void) pthread_mutex_destroy(&LOCK_user_conn); - (void) pthread_mutex_destroy(&LOCK_connection_count); + mysql_mutex_destroy(&LOCK_manager); + mysql_mutex_destroy(&LOCK_crypt); + mysql_mutex_destroy(&LOCK_user_conn); + mysql_mutex_destroy(&LOCK_connection_count); Events::destroy_mutexes(); #ifdef HAVE_OPENSSL - (void) pthread_mutex_destroy(&LOCK_des_key_file); + mysql_mutex_destroy(&LOCK_des_key_file); #ifndef HAVE_YASSL for (int i= 0; i < CRYPTO_num_locks(); ++i) - (void) rwlock_destroy(&openssl_stdlocks[i].lock); + rwlock_destroy(&openssl_stdlocks[i].lock); OPENSSL_free(openssl_stdlocks); #endif #endif #ifdef HAVE_REPLICATION - (void) pthread_mutex_destroy(&LOCK_rpl_status); - (void) pthread_cond_destroy(&COND_rpl_status); + mysql_mutex_destroy(&LOCK_rpl_status); + mysql_cond_destroy(&COND_rpl_status); #endif - (void) pthread_mutex_destroy(&LOCK_active_mi); - (void) rwlock_destroy(&LOCK_sys_init_connect); - (void) rwlock_destroy(&LOCK_sys_init_slave); - (void) pthread_mutex_destroy(&LOCK_global_system_variables); - (void) rwlock_destroy(&LOCK_system_variables_hash); - (void) pthread_mutex_destroy(&LOCK_global_read_lock); - (void) pthread_mutex_destroy(&LOCK_uuid_generator); - (void) pthread_mutex_destroy(&LOCK_prepared_stmt_count); - (void) pthread_mutex_destroy(&LOCK_error_messages); - (void) pthread_cond_destroy(&COND_thread_count); + mysql_mutex_destroy(&LOCK_active_mi); + mysql_rwlock_destroy(&LOCK_sys_init_connect); + mysql_rwlock_destroy(&LOCK_sys_init_slave); + mysql_mutex_destroy(&LOCK_global_system_variables); + mysql_rwlock_destroy(&LOCK_system_variables_hash); + mysql_mutex_destroy(&LOCK_global_read_lock); + mysql_mutex_destroy(&LOCK_uuid_generator); + mysql_mutex_destroy(&LOCK_prepared_stmt_count); + mysql_mutex_destroy(&LOCK_error_messages); + pthread_cond_destroy(&COND_thread_count); mysql_cond_destroy(&COND_refresh); - (void) pthread_cond_destroy(&COND_global_read_lock); - (void) pthread_cond_destroy(&COND_thread_cache); - (void) pthread_cond_destroy(&COND_flush_thread_cache); - (void) pthread_cond_destroy(&COND_manager); + mysql_cond_destroy(&COND_global_read_lock); + pthread_cond_destroy(&COND_thread_cache); + pthread_cond_destroy(&COND_flush_thread_cache); + mysql_cond_destroy(&COND_manager); } #endif /*EMBEDDED_LIBRARY*/ @@ -1829,11 +2021,11 @@ void unlink_thd(THD *thd) DBUG_PRINT("enter", ("thd: 0x%lx", (long) thd)); thd->cleanup(); - pthread_mutex_lock(&LOCK_connection_count); + mysql_mutex_lock(&LOCK_connection_count); --connection_count; - pthread_mutex_unlock(&LOCK_connection_count); + mysql_mutex_unlock(&LOCK_connection_count); - (void) pthread_mutex_lock(&LOCK_thread_count); + pthread_mutex_lock(&LOCK_thread_count); thread_count--; delete thd; DBUG_VOID_RETURN; @@ -1934,7 +2126,7 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache) void flush_thread_cache() { - (void) pthread_mutex_lock(&LOCK_thread_count); + pthread_mutex_lock(&LOCK_thread_count); kill_cached_threads++; while (cached_thread_count) { @@ -1942,7 +2134,7 @@ void flush_thread_cache() pthread_cond_wait(&COND_flush_thread_cache,&LOCK_thread_count); } kill_cached_threads--; - (void) pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); } @@ -2636,8 +2828,9 @@ static void start_signal_handler(void) #endif #endif - (void) pthread_mutex_lock(&LOCK_thread_count); - if ((error=pthread_create(&signal_thread,&thr_attr,signal_hand,0))) + pthread_mutex_lock(&LOCK_thread_count); + if ((error= mysql_thread_create(key_thread_signal_hand, + &signal_thread, &thr_attr, signal_hand, 0))) { sql_print_error("Can't create interrupt-thread (error %d, errno: %d)", error,errno); @@ -2704,9 +2897,9 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) At this pointer there is no other threads running, so there should not be any other pthread_cond_signal() calls. */ - (void) pthread_mutex_lock(&LOCK_thread_count); - (void) pthread_mutex_unlock(&LOCK_thread_count); - (void) pthread_cond_broadcast(&COND_thread_count); + pthread_mutex_lock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); + pthread_cond_broadcast(&COND_thread_count); (void) pthread_sigmask(SIG_BLOCK,&set,NULL); for (;;) @@ -2744,8 +2937,9 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) abort_loop=1; // mark abort for threads #ifdef USE_ONE_SIGNAL_HAND pthread_t tmp; - if (pthread_create(&tmp,&connection_attrib, kill_server_thread, - (void*) &sig)) + if (mysql_thread_create(0, /* Not instrumented */ + &tmp, &connection_attrib, kill_server_thread, + (void*) &sig)) sql_print_error("Can't create thread to kill server"); #else kill_server((void*) sig); // MIT THREAD has a alarm thread @@ -3083,8 +3277,7 @@ static inline char *make_default_log_name(char *buff,const char* log_ext) return make_log_name(buff, default_logfile_name, log_ext); } -static int init_common_variables(const char *conf_file_name, int argc, - char **argv, const char **groups) +static int init_common_variables() { char buff[FN_REFLEN]; umask(((~my_umask) & 0666)); @@ -3179,13 +3372,7 @@ static int init_common_variables(const char *conf_file_name, int argc, SQLCOM_END + 8); #endif - orig_argc=argc; - orig_argv=argv; - if (load_defaults(conf_file_name, groups, &argc, &argv)) - return 1; - defaults_argv=argv; - defaults_argc=argc; - if (get_options(&defaults_argc, defaults_argv)) + if (get_options(&remaining_argc, &remaining_argv)) return 1; set_server_version(); @@ -3489,6 +3676,15 @@ You should consider changing lower_case_table_names to 1 or 2", return 0; } +static void init_error_log_mutex() +{ + mysql_mutex_init(key_LOCK_error_log, &LOCK_error_log, MY_MUTEX_INIT_FAST); +} + +static void clean_up_error_log_mutex() +{ + mysql_mutex_destroy(&LOCK_error_log); +} static int init_thread_environment() { @@ -3496,34 +3692,42 @@ static int init_thread_environment() &LOCK_mysql_create_db, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_lock_db, &LOCK_lock_db, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_open, &LOCK_open, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_thread_count,MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_mapped_file,MY_MUTEX_INIT_SLOW); + pthread_mutex_init(&LOCK_thread_count, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_mapped_file, &LOCK_mapped_file, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_status, &LOCK_status, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_error_log,MY_MUTEX_INIT_FAST); - mysql_mutex_init(key_LOCK_deleyed_insert, + mysql_mutex_init(key_LOCK_delayed_insert, &LOCK_delayed_insert, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_delayed_status, &LOCK_delayed_status, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_delayed_create, &LOCK_delayed_create, MY_MUTEX_INIT_SLOW); - (void) pthread_mutex_init(&LOCK_manager,MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_crypt,MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_user_conn, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_active_mi, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_global_system_variables, MY_MUTEX_INIT_FAST); - (void) my_rwlock_init(&LOCK_system_variables_hash, NULL); - (void) pthread_mutex_init(&LOCK_global_read_lock, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_error_messages, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_uuid_generator, MY_MUTEX_INIT_FAST); - (void) pthread_mutex_init(&LOCK_connection_count, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_manager, + &LOCK_manager, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_crypt, &LOCK_crypt, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_user_conn, &LOCK_user_conn, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_active_mi, &LOCK_active_mi, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_global_system_variables, + &LOCK_global_system_variables, MY_MUTEX_INIT_FAST); + mysql_rwlock_init(key_rwlock_LOCK_system_variables_hash, + &LOCK_system_variables_hash); + mysql_mutex_init(key_LOCK_global_read_lock, + &LOCK_global_read_lock, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_prepared_stmt_count, + &LOCK_prepared_stmt_count, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_error_messages, + &LOCK_error_messages, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_uuid_generator, + &LOCK_uuid_generator, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_connection_count, + &LOCK_connection_count, MY_MUTEX_INIT_FAST); #ifdef HAVE_OPENSSL - (void) pthread_mutex_init(&LOCK_des_key_file,MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_des_key_file, + &LOCK_des_key_file, MY_MUTEX_INIT_FAST); #ifndef HAVE_YASSL openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * sizeof(openssl_lock_t)); for (int i= 0; i < CRYPTO_num_locks(); ++i) - (void) my_rwlock_init(&openssl_stdlocks[i].lock, NULL); + my_rwlock_init(&openssl_stdlocks[i].lock, NULL); CRYPTO_set_dynlock_create_callback(openssl_dynlock_create); CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy); CRYPTO_set_dynlock_lock_callback(openssl_lock); @@ -3531,21 +3735,22 @@ static int init_thread_environment() CRYPTO_set_id_callback(openssl_id_function); #endif #endif - (void) my_rwlock_init(&LOCK_sys_init_connect, NULL); - (void) my_rwlock_init(&LOCK_sys_init_slave, NULL); - (void) my_rwlock_init(&LOCK_grant, NULL); - (void) pthread_cond_init(&COND_thread_count,NULL); + mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect); + mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave); + mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant); + pthread_cond_init(&COND_thread_count, NULL); mysql_cond_init(key_COND_refresh, &COND_refresh, NULL); - (void) pthread_cond_init(&COND_global_read_lock,NULL); - (void) pthread_cond_init(&COND_thread_cache,NULL); - (void) pthread_cond_init(&COND_flush_thread_cache,NULL); - (void) pthread_cond_init(&COND_manager,NULL); + mysql_cond_init(key_COND_global_read_lock, &COND_global_read_lock, NULL); + pthread_cond_init(&COND_thread_cache, NULL); + pthread_cond_init(&COND_flush_thread_cache, NULL); + mysql_cond_init(key_COND_manager, &COND_manager, NULL); #ifdef HAVE_REPLICATION - (void) pthread_mutex_init(&LOCK_rpl_status, MY_MUTEX_INIT_FAST); - (void) pthread_cond_init(&COND_rpl_status, NULL); + mysql_mutex_init(key_LOCK_rpl_status, &LOCK_rpl_status, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_rpl_status, &COND_rpl_status, NULL); #endif - (void) pthread_mutex_init(&LOCK_server_started, MY_MUTEX_INIT_FAST); - (void) pthread_cond_init(&COND_server_started,NULL); + mysql_mutex_init(key_LOCK_server_started, + &LOCK_server_started, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_server_started, &COND_server_started, NULL); sp_cache_init(); #ifdef HAVE_EVENT_SCHEDULER Events::init_mutexes(); @@ -3731,6 +3936,18 @@ static int init_server_components() } } +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE + /* + Parsing the performance schema command line option may have reported + warnings/information messages. + Now that the logger is finally available, and redirected + to the proper file when the --log--error option is used, + print the buffered messages to the log. + */ + buffered_logs.print(); + buffered_logs.cleanup(); +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + if (xid_cache_init()) { sql_print_error("Out of memory"); @@ -3889,7 +4106,7 @@ a file name for --log-bin-index option", opt_binlog_index_name); if (ha_init_errors()) DBUG_RETURN(1); - if (plugin_init(&defaults_argc, defaults_argv, + if (plugin_init(&remaining_argc, remaining_argv, (opt_noacl ? PLUGIN_INIT_SKIP_PLUGIN_TABLE : 0) | (opt_help ? PLUGIN_INIT_SKIP_INITIALIZATION : 0))) { @@ -3906,10 +4123,9 @@ a file name for --log-bin-index option", opt_binlog_index_name); MYSQL_STORAGE_ENGINE_PLUGIN); /* we do want to exit if there are any other unknown options */ - if (defaults_argc > 1) + if (remaining_argc > 1) { int ho_error; - char **tmp_argv= defaults_argv; struct my_option no_opts[]= { {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} @@ -3917,21 +4133,22 @@ a file name for --log-bin-index option", opt_binlog_index_name); /* We need to eat any 'loose' arguments first before we conclude that there are unprocessed options. - But we need to preserve defaults_argv pointer intact for - free_defaults() to work. Thus we use a copy here. */ my_getopt_skip_unknown= 0; - if ((ho_error= handle_options(&defaults_argc, &tmp_argv, no_opts, + if ((ho_error= handle_options(&remaining_argc, &remaining_argv, no_opts, mysqld_get_one_option))) unireg_abort(ho_error); + /* Add back the program name handle_options removes */ + remaining_argc++; + remaining_argv--; my_getopt_skip_unknown= TRUE; - if (defaults_argc) + if (remaining_argc > 1) { fprintf(stderr, "%s: Too many arguments (first extra is '%s').\n" "Use --verbose --help to get a list of available options\n", - my_progname, *tmp_argv); + my_progname, remaining_argv[1]); unireg_abort(1); } } @@ -4095,7 +4312,8 @@ static void create_shutdown_thread() #ifdef __WIN__ hEventShutdown=CreateEvent(0, FALSE, FALSE, shutdown_event_name); pthread_t hThread; - if (pthread_create(&hThread,&connection_attrib,handle_shutdown,0)) + if (mysql_thread_create(key_thread_handle_shutdown, + &hThread, &connection_attrib, handle_shutdown, 0)) sql_print_warning("Can't create thread to handle shutdown requests"); // On "Stop Service" we have to do regular shutdown @@ -4125,8 +4343,9 @@ static void handle_connections_methods() if (hPipe != INVALID_HANDLE_VALUE) { handler_count++; - if (pthread_create(&hThread,&connection_attrib, - handle_connections_namedpipes, 0)) + if (mysql_thread_create(key_thread_handle_con_namedpipes, + &hThread, &connection_attrib, + handle_connections_namedpipes, 0)) { sql_print_warning("Can't create thread to handle named pipes"); handler_count--; @@ -4135,8 +4354,9 @@ static void handle_connections_methods() if (have_tcpip && !opt_disable_networking) { handler_count++; - if (pthread_create(&hThread,&connection_attrib, - handle_connections_sockets_thread, 0)) + if (mysql_thread_create(key_thread_handle_con_sockets, + &hThread, &connection_attrib, + handle_connections_sockets_thread, 0)) { sql_print_warning("Can't create thread to handle TCP/IP"); handler_count--; @@ -4146,8 +4366,9 @@ static void handle_connections_methods() if (opt_enable_shared_memory) { handler_count++; - if (pthread_create(&hThread,&connection_attrib, - handle_connections_shared_memory, 0)) + if (mysql_thread_create(key_thread_handle_con_sharedmem, + &hThread, &connection_attrib, + handle_connections_shared_memory, 0)) { sql_print_warning("Can't create thread to handle shared memory"); handler_count--; @@ -4212,15 +4433,134 @@ static void test_lc_time_sz() } #endif//DBUG_OFF - #ifdef __WIN__ int win_main(int argc, char **argv) #else int main(int argc, char **argv) #endif { - MY_INIT(argv[0]); // init my_sys library & pthreads - /* nothing should come before this line ^^^ */ + /* + Perform basic thread library and malloc initialization, + to be able to read defaults files and parse options. + */ + my_progname= argv[0]; + if (my_basic_init()) + { + fprintf(stderr, "my_basic_init() failed."); + return 1; + } + + orig_argc= argc; + orig_argv= argv; + if (load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv)) + return 1; + defaults_argc= argc; + defaults_argv= argv; + remaining_argc= argc; + remaining_argv= argv; + + /* Must be initialized early for comparison of options name */ + system_charset_info= &my_charset_utf8_general_ci; + + sys_var_init(); + +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE + /* + The performance schema needs to be initialized as early as possible, + before to-be-instrumented objects of the server are initialized. + */ + int ho_error; + DYNAMIC_ARRAY all_early_options; + + my_getopt_register_get_addr(NULL); + /* Skip unknown options so that they may be processed later */ + my_getopt_skip_unknown= TRUE; + + /* prepare all_early_options array */ + my_init_dynamic_array(&all_early_options, sizeof(my_option), 100, 25); + sys_var_add_options(&all_early_options, sys_var::PARSE_EARLY); + add_terminator(&all_early_options); + + /* + Logs generated while parsing the command line + options are buffered and printed later. + */ + buffered_logs.init(); + my_getopt_error_reporter= buffered_option_error_reporter; + + ho_error= handle_options(&remaining_argc, &remaining_argv, + (my_option*)(all_early_options.buffer), NULL); + delete_dynamic(&all_early_options); + if (ho_error == 0) + { + /* Add back the program name handle_options removes */ + remaining_argc++; + remaining_argv--; + if (pfs_param.m_enabled) + { + PSI_hook= initialize_performance_schema(&pfs_param); + if (PSI_hook == NULL) + { + pfs_param.m_enabled= false; + buffered_logs.buffer(WARNING_LEVEL, + "Performance schema disabled (reason: init failed)."); + } + else + { + buffered_logs.buffer(INFORMATION_LEVEL, + "Performance schema enabled."); + } + } + else + { + buffered_logs.buffer(INFORMATION_LEVEL, + "Performance schema disabled (reason: start parameters)."); + } + } +#else + /* + Other provider of the instrumentation interface should + initialize PSI_hook here: + - HAVE_PSI_INTERFACE is for the instrumentation interface + - WITH_PERFSCHEMA_STORAGE_ENGINE is for one implementation + of the interface, + but there could be alternate implementations, which is why + these two defines are kept separate. + */ +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + +#ifdef HAVE_PSI_INTERFACE + /* + Obtain the current performance schema instrumentation interface, + if available. + */ + if (PSI_hook) + PSI_server= (PSI*) PSI_hook->get_interface(PSI_CURRENT_VERSION); + + if (PSI_server) + { + /* + Now that we have parsed the command line arguments, and have initialized + the performance schema itself, the next step is to register all the + server instruments. + */ + init_server_psi_keys(); + /* Instrument the main thread */ + PSI_thread *psi= PSI_server->new_thread(key_thread_main, NULL, 0); + if (psi) + PSI_server->set_thread(psi); + + /* + Now that some instrumentation is in place, + recreate objects which were initialised early, + so that they are instrumented as well. + */ + my_thread_basic_global_reinit(); + } +#endif /* HAVE_PSI_INTERFACE */ + + my_init(); // init my_sys library & pthreads + init_error_log_mutex(); /* Set signal used to kill MySQL */ #if defined(SIGUSR2) @@ -4235,6 +4575,28 @@ int main(int argc, char **argv) */ logger.init_base(); +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE + if (ho_error) + { + /* + Parsing command line option failed, + Since we don't have a workable remaining_argc/remaining_argv + to continue the server initialization, this is as far as this + code can go. + This is the best effort to log meaningful messages: + - messages will be printed to stderr, which is not redirected yet, + - messages will be printed in the NT event log, for windows. + */ + buffered_logs.print(); + buffered_logs.cleanup(); + /* + Not enough initializations for unireg_abort() + Using exit() for windows. + */ + exit (ho_error); + } +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + #ifdef _CUSTOMSTARTUPCONFIG_ if (_cust_check_startup()) { @@ -4254,13 +4616,13 @@ int main(int argc, char **argv) { /* errors are not read yet, so we use english text here */ my_message(ER_WSAS_FAILED, "WSAStartup Failed", MYF(0)); - unireg_abort(1); + /* Not enough initializations for unireg_abort() */ + return 1; } } #endif /* __WIN__ */ - if (init_common_variables(MYSQL_CONFIG_NAME, - argc, argv, load_default_groups)) + if (init_common_variables()) unireg_abort(1); // Will do exit init_signals(); @@ -4381,7 +4743,7 @@ int main(int argc, char **argv) #endif /* __NETWARE__ */ if (!opt_bootstrap) - (void) my_delete(pidfile_name,MYF(MY_WME)); // Not needed anymore + mysql_file_delete(key_file_pid, pidfile_name, MYF(MY_WME)); // Not needed anymore if (unix_sock != INVALID_SOCKET) unlink(mysqld_unix_port); @@ -4415,6 +4777,13 @@ int main(int argc, char **argv) unireg_abort(1); } +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE + initialize_performance_schema_acl(opt_bootstrap); + check_performance_schema(); +#endif + + initialize_information_schema_acl(); + execute_ddl_log_recovery(); if (Events::init(opt_noacl || opt_bootstrap)) @@ -4423,7 +4792,7 @@ int main(int argc, char **argv) if (opt_bootstrap) { select_thread_in_use= 0; // Allow 'kill' to work - bootstrap(stdin); + bootstrap(mysql_stdin); unireg_abort(bootstrap_error ? 1 : 0); } if (opt_init_file && *opt_init_file) @@ -4446,10 +4815,10 @@ int main(int argc, char **argv) /* Signal threads waiting for server to be started */ - pthread_mutex_lock(&LOCK_server_started); + mysql_mutex_lock(&LOCK_server_started); mysqld_server_started= 1; - pthread_cond_signal(&COND_server_started); - pthread_mutex_unlock(&LOCK_server_started); + mysql_cond_signal(&COND_server_started); + mysql_mutex_unlock(&LOCK_server_started); #if defined(_WIN32) || defined(HAVE_SMEM) handle_connections_methods(); @@ -4492,8 +4861,26 @@ int main(int argc, char **argv) } #endif clean_up(1); + /* + Important note: we wait for the signal thread to end, + but if a kill -15 signal was sent, the signal thread did + spawn the kill_server_thread thread, which is running concurrently. + */ wait_for_signal_thread_to_end(); clean_up_mutexes(); + clean_up_error_log_mutex(); +#ifdef HAVE_PSI_INTERFACE + /* + Disable the instrumentation, to avoid recording events + during the shutdown. + */ + if (PSI_server) + { + PSI_server->delete_current_thread(); + PSI_server= NULL; + } + shutdown_performance_schema(); +#endif my_end(opt_endinfo ? MY_CHECK_ERROR | MY_GIVE_INFO : 0); exit(0); @@ -4711,7 +5098,7 @@ int main(int argc, char **argv) create MySQL privilege tables without having to start a full MySQL server. */ -static void bootstrap(FILE *file) +static void bootstrap(MYSQL_FILE *file) { DBUG_ENTER("bootstrap"); @@ -4726,24 +5113,25 @@ static void bootstrap(FILE *file) bootstrap_file=file; #ifndef EMBEDDED_LIBRARY // TODO: Enable this - if (pthread_create(&thd->real_id,&connection_attrib,handle_bootstrap, - (void*) thd)) + if (mysql_thread_create(key_thread_bootstrap, + &thd->real_id, &connection_attrib, handle_bootstrap, + (void*) thd)) { sql_print_warning("Can't create thread to handle bootstrap"); bootstrap_error=-1; DBUG_VOID_RETURN; } /* Wait for thread to die */ - (void) pthread_mutex_lock(&LOCK_thread_count); + pthread_mutex_lock(&LOCK_thread_count); while (in_bootstrap) { - (void) pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); + pthread_cond_wait(&COND_thread_count, &LOCK_thread_count); DBUG_PRINT("quit",("One thread died (count=%u)",thread_count)); } - (void) pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); #else thd->mysql= 0; - handle_bootstrap((void *)thd); + do_handle_bootstrap(thd); #endif DBUG_VOID_RETURN; @@ -4752,13 +5140,14 @@ static void bootstrap(FILE *file) static bool read_init_file(char *file_name) { - FILE *file; + MYSQL_FILE *file; DBUG_ENTER("read_init_file"); DBUG_PRINT("enter",("name: %s",file_name)); - if (!(file=my_fopen(file_name,O_RDONLY,MYF(MY_WME)))) + if (!(file= mysql_file_fopen(key_file_init, file_name, + O_RDONLY, MYF(MY_WME)))) DBUG_RETURN(TRUE); bootstrap(file); - (void) my_fclose(file,MYF(MY_WME)); + mysql_file_fclose(file, MYF(MY_WME)); DBUG_RETURN(FALSE); } @@ -4782,7 +5171,7 @@ void handle_connection_in_main_thread(THD *thd) threads.append(thd); pthread_mutex_unlock(&LOCK_thread_count); thd->start_utime= my_micro_time(); - handle_one_connection(thd); + do_handle_one_connection(thd); } @@ -4808,9 +5197,10 @@ void create_thread_to_handle_connection(THD *thd) threads.append(thd); DBUG_PRINT("info",(("creating thread %lu"), thd->thread_id)); thd->prior_thr_create_utime= thd->start_utime= my_micro_time(); - if ((error=pthread_create(&thd->real_id,&connection_attrib, - handle_one_connection, - (void*) thd))) + if ((error= mysql_thread_create(key_thread_one_connection, + &thd->real_id, &connection_attrib, + handle_one_connection, + (void*) thd))) { /* purecov: begin inspected */ DBUG_PRINT("error", @@ -4818,26 +5208,26 @@ void create_thread_to_handle_connection(THD *thd) error)); thread_count--; thd->killed= THD::KILL_CONNECTION; // Safety - (void) pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); - pthread_mutex_lock(&LOCK_connection_count); + mysql_mutex_lock(&LOCK_connection_count); --connection_count; - pthread_mutex_unlock(&LOCK_connection_count); + mysql_mutex_unlock(&LOCK_connection_count); statistic_increment(aborted_connects,&LOCK_status); /* Can't use my_error() since store_globals has not been called. */ my_snprintf(error_message_buff, sizeof(error_message_buff), ER(ER_CANT_CREATE_THREAD), error); net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL); - (void) pthread_mutex_lock(&LOCK_thread_count); + pthread_mutex_lock(&LOCK_thread_count); close_connection(thd,0,0); delete thd; - (void) pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); return; /* purecov: end */ } } - (void) pthread_mutex_unlock(&LOCK_thread_count); + pthread_mutex_unlock(&LOCK_thread_count); DBUG_PRINT("info",("Thread created")); } @@ -4864,11 +5254,11 @@ static void create_new_thread(THD *thd) only (max_connections + 1) connections. */ - pthread_mutex_lock(&LOCK_connection_count); + mysql_mutex_lock(&LOCK_connection_count); if (connection_count >= max_connections + 1 || abort_loop) { - pthread_mutex_unlock(&LOCK_connection_count); + mysql_mutex_unlock(&LOCK_connection_count); DBUG_PRINT("error",("Too many connections")); close_connection(thd, ER_CON_COUNT_ERROR, 1); @@ -4881,7 +5271,7 @@ static void create_new_thread(THD *thd) if (connection_count > max_used_connections) max_used_connections= connection_count; - pthread_mutex_unlock(&LOCK_connection_count); + mysql_mutex_unlock(&LOCK_connection_count); /* Start a new thread to handle connection. */ @@ -5490,7 +5880,7 @@ DYNAMIC_ARRAY all_options; to be listed here. */ -struct my_option my_long_options[] = +struct my_option my_long_options[]= { {"help", '?', "Display this help and exit.", (uchar**) &opt_help, (uchar**) &opt_help, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, @@ -5931,12 +6321,12 @@ static int show_rpl_status(THD *thd, SHOW_VAR *var, char *buff) static int show_slave_running(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_MY_BOOL; - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); var->value= buff; *((my_bool *)buff)= (my_bool) (active_mi && active_mi->slave_running == MYSQL_SLAVE_RUN_CONNECT && active_mi->rli.slave_running); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); return 0; } @@ -5946,41 +6336,41 @@ static int show_slave_retried_trans(THD *thd, SHOW_VAR *var, char *buff) TODO: with multimaster, have one such counter per line in SHOW SLAVE STATUS, and have the sum over all lines here. */ - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (active_mi) { var->type= SHOW_LONG; var->value= buff; - pthread_mutex_lock(&active_mi->rli.data_lock); + mysql_mutex_lock(&active_mi->rli.data_lock); *((long *)buff)= (long)active_mi->rli.retried_trans; - pthread_mutex_unlock(&active_mi->rli.data_lock); + mysql_mutex_unlock(&active_mi->rli.data_lock); } else var->type= SHOW_UNDEF; - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); return 0; } static int show_slave_received_heartbeats(THD *thd, SHOW_VAR *var, char *buff) { - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (active_mi) { var->type= SHOW_LONGLONG; var->value= buff; - pthread_mutex_lock(&active_mi->rli.data_lock); + mysql_mutex_lock(&active_mi->rli.data_lock); *((longlong *)buff)= active_mi->received_heartbeats; - pthread_mutex_unlock(&active_mi->rli.data_lock); + mysql_mutex_unlock(&active_mi->rli.data_lock); } else var->type= SHOW_UNDEF; - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); return 0; } static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff) { - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (active_mi) { var->type= SHOW_CHAR; @@ -5989,7 +6379,7 @@ static int show_heartbeat_period(THD *thd, SHOW_VAR *var, char *buff) } else var->type= SHOW_UNDEF; - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); return 0; } @@ -6008,9 +6398,9 @@ static int show_prepared_stmt_count(THD *thd, SHOW_VAR *var, char *buff) { var->type= SHOW_LONG; var->value= buff; - pthread_mutex_lock(&LOCK_prepared_stmt_count); + mysql_mutex_lock(&LOCK_prepared_stmt_count); *((long *)buff)= (long)prepared_stmt_count; - pthread_mutex_unlock(&LOCK_prepared_stmt_count); + mysql_mutex_unlock(&LOCK_prepared_stmt_count); return 0; } @@ -6411,10 +6801,10 @@ SHOW_VAR status_vars[]= { {NullS, NullS, SHOW_LONG} }; -static bool all_options_add_terminator() +bool add_terminator(DYNAMIC_ARRAY *options) { my_option empty_element= {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}; - return insert_dynamic(&all_options, (uchar *)&empty_element); + return insert_dynamic(options, (uchar *)&empty_element); } #ifndef EMBEDDED_LIBRARY @@ -6458,9 +6848,10 @@ static void print_help() init_alloc_root(&mem_root, 4096, 4096); pop_dynamic(&all_options); + sys_var_add_options(&all_options, sys_var::PARSE_EARLY); add_plugin_options(&all_options, &mem_root); sort_dynamic(&all_options, (qsort_cmp) option_cmp); - all_options_add_terminator(); + add_terminator(&all_options); my_print_help((my_option*) all_options.buffer); my_print_variables((my_option*) all_options.buffer); @@ -6557,8 +6948,6 @@ static int mysql_init_variables(void) mqh_used= 0; segfaulted= kill_in_progress= 0; cleanup_done= 0; - defaults_argc= 0; - defaults_argv= 0; server_id_supplied= 0; test_flags= select_errors= dropping_tables= ha_open_options=0; thread_count= thread_running= kill_cached_threads= wake_thread=0; @@ -7041,9 +7430,6 @@ mysql_getopt_value(const char *keyname, uint key_length, return option->value; } - -extern "C" void option_error_reporter(enum loglevel level, const char *format, ...); - void option_error_reporter(enum loglevel level, const char *format, ...) { va_list args; @@ -7060,38 +7446,46 @@ void option_error_reporter(enum loglevel level, const char *format, ...) /** + Get server options from the command line, + and perform related server initializations. + @param [in, out] argc_ptr command line options (count) + @param [in, out] argv_ptr command line options (values) + @return 0 on success + @todo - FIXME add EXIT_TOO_MANY_ARGUMENTS to "mysys_err.h" and return that code? */ -static int get_options(int *argc,char **argv) +static int get_options(int *argc_ptr, char ***argv_ptr) { int ho_error; my_getopt_register_get_addr(mysql_getopt_value); my_getopt_error_reporter= option_error_reporter; - /* prepare all_options array */ - my_init_dynamic_array(&all_options, sizeof(my_option), - array_elements(my_long_options), array_elements(my_long_options)/4); + /* prepare all_options array */ + my_init_dynamic_array(&all_options, sizeof(my_option), + array_elements(my_long_options), + array_elements(my_long_options)/4); for (my_option *opt= my_long_options; opt < my_long_options + array_elements(my_long_options) - 1; opt++) - insert_dynamic(&all_options, (uchar*) opt); - sys_var_init(&all_options); - all_options_add_terminator(); + insert_dynamic(&all_options, (uchar*) opt); + sys_var_add_options(&all_options, sys_var::PARSE_NORMAL); + add_terminator(&all_options); /* Skip unknown options so that they may be processed later by plugins */ my_getopt_skip_unknown= TRUE; - if ((ho_error= handle_options(argc, &argv, (my_option*)(all_options.buffer), + if ((ho_error= handle_options(argc_ptr, argv_ptr, (my_option*)(all_options.buffer), mysqld_get_one_option))) return ho_error; if (!opt_help) delete_dynamic(&all_options); - (*argc)++; /* add back one for the progname handle_options removes */ - /* no need to do this for argv as we are discarding it. */ + /* Add back the program name handle_options removes */ + (*argc_ptr)++; + (*argv_ptr)--; /* Options have been parsed. Now some of them need additional special @@ -7372,16 +7766,17 @@ static int test_if_case_insensitive(const char *dir_name) MY_UNPACK_FILENAME | MY_REPLACE_EXT | MY_REPLACE_DIR); fn_format(buff2, glob_hostname, dir_name, ".LOWER-TEST", MY_UNPACK_FILENAME | MY_REPLACE_EXT | MY_REPLACE_DIR); - (void) my_delete(buff2, MYF(0)); - if ((file= my_create(buff, 0666, O_RDWR, MYF(0))) < 0) + mysql_file_delete(key_file_casetest, buff2, MYF(0)); + if ((file= mysql_file_create(key_file_casetest, + buff, 0666, O_RDWR, MYF(0))) < 0) { sql_print_warning("Can't create test file %s", buff); DBUG_RETURN(-1); } - my_close(file, MYF(0)); - if (my_stat(buff2, &stat_info, MYF(0))) + mysql_file_close(file, MYF(0)); + if (mysql_file_stat(key_file_casetest, buff2, &stat_info, MYF(0))) result= 1; // Can access file - (void) my_delete(buff, MYF(MY_WME)); + mysql_file_delete(key_file_casetest, buff, MYF(MY_WME)); DBUG_PRINT("exit", ("result: %d", result)); DBUG_RETURN(result); } @@ -7395,18 +7790,19 @@ static int test_if_case_insensitive(const char *dir_name) static void create_pid_file() { File file; - if ((file = my_create(pidfile_name,0664, - O_WRONLY | O_TRUNC, MYF(MY_WME))) >= 0) + if ((file= mysql_file_create(key_file_pid, pidfile_name, 0664, + O_WRONLY | O_TRUNC, MYF(MY_WME))) >= 0) { char buff[21], *end; end= int10_to_str((long) getpid(), buff, 10); *end++= '\n'; - if (!my_write(file, (uchar*) buff, (uint) (end-buff), MYF(MY_WME | MY_NABP))) + if (!mysql_file_write(file, (uchar*) buff, (uint) (end-buff), + MYF(MY_WME | MY_NABP))) { - (void) my_close(file, MYF(0)); + mysql_file_close(file, MYF(0)); return; } - (void) my_close(file, MYF(0)); + mysql_file_close(file, MYF(0)); } sql_perror("Can't start server: can't create PID file"); exit(1); @@ -7462,3 +7858,244 @@ template class I_List; template class I_List; template class I_List_iterator; #endif + +#ifdef HAVE_PSI_INTERFACE +#ifdef HAVE_MMAP +PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, key_LOCK_pool; +#endif /* HAVE_MMAP */ + +#ifdef HAVE_OPENSSL +PSI_mutex_key key_LOCK_des_key_file; +#endif /* HAVE_OPENSSL */ + +PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, + key_delayed_insert_mutex, key_hash_filo_lock, key_LOCK_active_mi, + key_LOCK_connection_count, key_LOCK_crypt, key_LOCK_delayed_create, + key_LOCK_delayed_insert, key_LOCK_delayed_status, key_LOCK_error_log, + key_LOCK_gdl, key_LOCK_global_read_lock, key_LOCK_global_system_variables, + key_LOCK_lock_db, key_LOCK_manager, key_LOCK_mapped_file, + key_LOCK_mysql_create_db, key_LOCK_open, key_LOCK_prepared_stmt_count, + key_LOCK_rpl_status, key_LOCK_server_started, key_LOCK_status, + key_LOCK_system_variables_hash, key_LOCK_table_share, key_LOCK_thd_data, + key_LOCK_user_conn, key_LOCK_uuid_generator, key_LOG_LOCK_log, + key_master_info_data_lock, key_master_info_run_lock, + key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock, + key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, + key_structure_guard_mutex, key_TABLE_SHARE_mutex, key_LOCK_error_messages, + key_LOG_INFO_lock; + +static PSI_mutex_info all_server_mutexes[]= +{ +#ifdef HAVE_MMAP + { &key_PAGE_lock, "PAGE::lock", 0}, + { &key_LOCK_sync, "TC_LOG_MMAP::LOCK_sync", 0}, + { &key_LOCK_active, "TC_LOG_MMAP::LOCK_active", 0}, + { &key_LOCK_pool, "TC_LOG_MMAP::LOCK_pool", 0}, +#endif /* HAVE_MMAP */ + +#ifdef HAVE_OPENSSL + { &key_LOCK_des_key_file, "LOCK_des_key_file", PSI_FLAG_GLOBAL}, +#endif /* HAVE_OPENSSL */ + + { &key_BINLOG_LOCK_index, "MYSQL_BIN_LOG::LOCK_index", 0}, + { &key_BINLOG_LOCK_prep_xids, "MYSQL_BIN_LOG::LOCK_prep_xids", 0}, + { &key_delayed_insert_mutex, "Delayed_insert::mutex", 0}, + { &key_hash_filo_lock, "hash_filo::lock", 0}, + { &key_LOCK_active_mi, "LOCK_active_mi", PSI_FLAG_GLOBAL}, + { &key_LOCK_connection_count, "LOCK_connection_count", PSI_FLAG_GLOBAL}, + { &key_LOCK_crypt, "LOCK_crypt", PSI_FLAG_GLOBAL}, + { &key_LOCK_delayed_create, "LOCK_delayed_create", PSI_FLAG_GLOBAL}, + { &key_LOCK_delayed_insert, "LOCK_delayed_insert", PSI_FLAG_GLOBAL}, + { &key_LOCK_delayed_status, "LOCK_delayed_status", PSI_FLAG_GLOBAL}, + { &key_LOCK_error_log, "LOCK_error_log", PSI_FLAG_GLOBAL}, + { &key_LOCK_gdl, "LOCK_gdl", PSI_FLAG_GLOBAL}, + { &key_LOCK_global_read_lock, "LOCK_global_read_lock", PSI_FLAG_GLOBAL}, + { &key_LOCK_global_system_variables, "LOCK_global_system_variables", PSI_FLAG_GLOBAL}, + { &key_LOCK_lock_db, "LOCK_lock_db", PSI_FLAG_GLOBAL}, + { &key_LOCK_manager, "LOCK_manager", PSI_FLAG_GLOBAL}, + { &key_LOCK_mapped_file, "LOCK_mapped_file", PSI_FLAG_GLOBAL}, + { &key_LOCK_mysql_create_db, "LOCK_mysql_create_db", PSI_FLAG_GLOBAL}, + { &key_LOCK_open, "LOCK_open", PSI_FLAG_GLOBAL}, + { &key_LOCK_prepared_stmt_count, "LOCK_prepared_stmt_count", PSI_FLAG_GLOBAL}, + { &key_LOCK_rpl_status, "LOCK_rpl_status", PSI_FLAG_GLOBAL}, + { &key_LOCK_server_started, "LOCK_server_started", PSI_FLAG_GLOBAL}, + { &key_LOCK_status, "LOCK_status", PSI_FLAG_GLOBAL}, + { &key_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL}, + { &key_LOCK_table_share, "LOCK_table_share", PSI_FLAG_GLOBAL}, + { &key_LOCK_thd_data, "THD::LOCK_thd_data", 0}, + { &key_LOCK_user_conn, "LOCK_user_conn", PSI_FLAG_GLOBAL}, + { &key_LOCK_uuid_generator, "LOCK_uuid_generator", PSI_FLAG_GLOBAL}, + { &key_LOG_LOCK_log, "LOG::LOCK_log", 0}, + { &key_master_info_data_lock, "Master_info::data_lock", 0}, + { &key_master_info_run_lock, "Master_info::run_lock", 0}, + { &key_mutex_slave_reporting_capability_err_lock, "Slave_reporting_capability::err_lock", 0}, + { &key_relay_log_info_data_lock, "Relay_log_info::data_lock", 0}, + { &key_relay_log_info_log_space_lock, "Relay_log_info::log_space_lock", 0}, + { &key_relay_log_info_run_lock, "Relay_log_info::run_lock", 0}, + { &key_structure_guard_mutex, "Query_cache::structure_guard_mutex", 0}, + { &key_TABLE_SHARE_mutex, "TABLE_SHARE::mutex", 0}, + { &key_LOCK_error_messages, "LOCK_error_messages", PSI_FLAG_GLOBAL}, + { &key_LOG_INFO_lock, "LOG_INFO::lock", 0} +}; + +PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, + key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, + key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock; + +static PSI_rwlock_info all_server_rwlocks[]= +{ + { &key_rwlock_LOCK_grant, "LOCK_grant", PSI_FLAG_GLOBAL}, + { &key_rwlock_LOCK_logger, "LOGGER::LOCK_logger", 0}, + { &key_rwlock_LOCK_sys_init_connect, "LOCK_sys_init_connect", PSI_FLAG_GLOBAL}, + { &key_rwlock_LOCK_sys_init_slave, "LOCK_sys_init_slave", PSI_FLAG_GLOBAL}, + { &key_rwlock_LOCK_system_variables_hash, "LOCK_system_variables_hash", PSI_FLAG_GLOBAL}, + { &key_rwlock_query_cache_query_lock, "Query_cache_query::lock", 0} +}; + +#ifdef HAVE_MMAP +PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; +#endif /* HAVE_MMAP */ + +PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, + key_COND_cache_status_changed, key_COND_global_read_lock, key_COND_manager, + key_COND_refresh, key_COND_rpl_status, key_COND_server_started, + key_delayed_insert_cond, key_delayed_insert_cond_client, + key_item_func_sleep_cond, key_master_info_data_cond, + key_master_info_start_cond, key_master_info_stop_cond, + key_relay_log_info_data_cond, key_relay_log_info_log_space_cond, + key_relay_log_info_start_cond, key_relay_log_info_stop_cond, + key_TABLE_SHARE_cond, key_user_level_lock_cond; + +static PSI_cond_info all_server_conds[]= +{ +#ifdef HAVE_MMAP + { &key_PAGE_cond, "PAGE::cond", 0}, + { &key_COND_active, "TC_LOG_MMAP::COND_active", 0}, + { &key_COND_pool, "TC_LOG_MMAP::COND_pool", 0}, +#endif /* HAVE_MMAP */ + { &key_BINLOG_COND_prep_xids, "MYSQL_BIN_LOG::COND_prep_xids", 0}, + { &key_BINLOG_update_cond, "MYSQL_BIN_LOG::update_cond", 0}, + { &key_COND_cache_status_changed, "Query_cache::COND_cache_status_changed", 0}, + { &key_COND_global_read_lock, "COND_global_read_lock", PSI_FLAG_GLOBAL}, + { &key_COND_manager, "COND_manager", PSI_FLAG_GLOBAL}, + { &key_COND_refresh, "COND_refresh", PSI_FLAG_GLOBAL}, + { &key_COND_rpl_status, "COND_rpl_status", PSI_FLAG_GLOBAL}, + { &key_COND_server_started, "COND_server_started", PSI_FLAG_GLOBAL}, + { &key_delayed_insert_cond, "Delayed_insert::cond", 0}, + { &key_delayed_insert_cond_client, "Delayed_insert::cond_client", 0}, + { &key_item_func_sleep_cond, "Item_func_sleep::cond", 0}, + { &key_master_info_data_cond, "Master_info::data_cond", 0}, + { &key_master_info_start_cond, "Master_info::start_cond", 0}, + { &key_master_info_stop_cond, "Master_info::stop_cond", 0}, + { &key_relay_log_info_data_cond, "Relay_log_info::data_cond", 0}, + { &key_relay_log_info_log_space_cond, "Relay_log_info::log_space_cond", 0}, + { &key_relay_log_info_start_cond, "Relay_log_info::start_cond", 0}, + { &key_relay_log_info_stop_cond, "Relay_log_info::stop_cond", 0}, + { &key_TABLE_SHARE_cond, "TABLE_SHARE::cond", 0}, + { &key_user_level_lock_cond, "User_level_lock::cond", 0} +}; + +PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, + key_thread_handle_manager, key_thread_main, + key_thread_one_connection, key_thread_signal_hand; + +static PSI_thread_info all_server_threads[]= +{ +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + { &key_thread_handle_con_namedpipes, "con_named_pipes", PSI_FLAG_GLOBAL}, +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ + +#if defined(HAVE_SMEM) && !defined(EMBEDDED_LIBRARY) + { &key_thread_handle_con_sharedmem, "con_shared_mem", PSI_FLAG_GLOBAL}, +#endif /* HAVE_SMEM && !EMBEDDED_LIBRARY */ + +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + { &key_thread_handle_con_sockets, "con_sockets", PSI_FLAG_GLOBAL}, +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ + +#ifdef __WIN__ + { &key_thread_handle_shutdown, "shutdown", PSI_FLAG_GLOBAL}, +#endif /* __WIN__ */ + + { &key_thread_bootstrap, "bootstrap", PSI_FLAG_GLOBAL}, + { &key_thread_delayed_insert, "delayed_insert", 0}, + { &key_thread_handle_manager, "manager", PSI_FLAG_GLOBAL}, + { &key_thread_main, "main", PSI_FLAG_GLOBAL}, + { &key_thread_one_connection, "one_connection", 0}, + { &key_thread_signal_hand, "signal_handler", PSI_FLAG_GLOBAL} +}; + +#ifdef HAVE_MMAP +PSI_file_key key_file_map; +#endif /* HAVE_MMAP */ + +PSI_file_key key_file_binlog, key_file_binlog_index, key_file_casetest, + key_file_dbopt, key_file_des_key_file, key_file_ERRMSG, key_select_to_file, + key_file_fileparser, key_file_frm, key_file_global_ddl_log, key_file_load, + key_file_loadfile, key_file_log_event_data, key_file_log_event_info, + key_file_master_info, key_file_misc, key_file_MYSQL_LOG, key_file_partition, + key_file_pid, key_file_relay_log_info, key_file_send_file, key_file_tclog, + key_file_trg, key_file_trn, key_file_init; + +static PSI_file_info all_server_files[]= +{ +#ifdef HAVE_MMAP + { &key_file_map, "map", 0}, +#endif /* HAVE_MMAP */ + { &key_file_binlog, "binlog", 0}, + { &key_file_binlog_index, "binlog_index", 0}, + { &key_file_casetest, "casetest", 0}, + { &key_file_dbopt, "dbopt", 0}, + { &key_file_des_key_file, "des_key_file", 0}, + { &key_file_ERRMSG, "ERRMSG", 0}, + { &key_select_to_file, "select_to_file", 0}, + { &key_file_fileparser, "file_parser", 0}, + { &key_file_frm, "FRM", 0}, + { &key_file_global_ddl_log, "global_ddl_log", 0}, + { &key_file_load, "load", 0}, + { &key_file_loadfile, "LOAD_FILE", 0}, + { &key_file_log_event_data, "log_event_data", 0}, + { &key_file_log_event_info, "log_event_info", 0}, + { &key_file_master_info, "master_info", 0}, + { &key_file_misc, "misc", 0}, + { &key_file_MYSQL_LOG, "MYSQL_LOG", 0}, + { &key_file_partition, "partition", 0}, + { &key_file_pid, "pid", 0}, + { &key_file_relay_log_info, "relay_log_info", 0}, + { &key_file_send_file, "send_file", 0}, + { &key_file_tclog, "tclog", 0}, + { &key_file_trg, "trigger_name", 0}, + { &key_file_trn, "trigger", 0}, + { &key_file_init, "init", 0} +}; + +/** + Initialise all the performance schema instrumentation points + used by the server. +*/ +void init_server_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_server_mutexes); + PSI_server->register_mutex(category, all_server_mutexes, count); + + count= array_elements(all_server_rwlocks); + PSI_server->register_rwlock(category, all_server_rwlocks, count); + + count= array_elements(all_server_conds); + PSI_server->register_cond(category, all_server_conds, count); + + count= array_elements(all_server_threads); + PSI_server->register_thread(category, all_server_threads, count); + + count= array_elements(all_server_files); + PSI_server->register_file(category, all_server_files, count); +} + +#endif /* HAVE_PSI_INTERFACE */ + diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 3d65fa1de31..d94ab3d940d 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -237,8 +237,9 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, // temporary file name path[path_end]='~'; path[path_end+1]= '\0'; - if ((handler= my_create(path, CREATE_MODE, O_RDWR | O_TRUNC, - MYF(MY_WME))) <= 0) + if ((handler= mysql_file_create(key_file_fileparser, + path, CREATE_MODE, O_RDWR | O_TRUNC, + MYF(MY_WME))) <= 0) { DBUG_RETURN(TRUE); } @@ -267,11 +268,11 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, goto err_w_file; if (opt_sync_frm) { - if (my_sync(handler, MYF(MY_WME))) + if (mysql_file_sync(handler, MYF(MY_WME))) goto err_w_file; } - if (my_close(handler, MYF(MY_WME))) + if (mysql_file_close(handler, MYF(MY_WME))) { DBUG_RETURN(TRUE); } @@ -283,7 +284,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, char path_to[FN_REFLEN]; memcpy(path_to, path, path_end+1); path[path_end]='~'; - if (my_rename(path, path_to, MYF(MY_WME))) + if (mysql_file_rename(key_file_fileparser, path, path_to, MYF(MY_WME))) { DBUG_RETURN(TRUE); } @@ -292,7 +293,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, err_w_cache: end_io_cache(&file); err_w_file: - my_close(handler, MYF(MY_WME)); + mysql_file_close(handler, MYF(MY_WME)); DBUG_RETURN(TRUE); } @@ -321,7 +322,7 @@ my_bool rename_in_schema_file(THD *thd, build_table_filename(new_path, sizeof(new_path) - 1, new_db, new_name, reg_ext, 0); - if (my_rename(old_path, new_path, MYF(MY_WME))) + if (mysql_file_rename(key_file_frm, old_path, new_path, MYF(MY_WME))) return 1; /* check if arc_dir exists: disabled unused feature (see bug #17823). */ @@ -365,7 +366,8 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root, File file; DBUG_ENTER("sql_parse_prepare"); - if (!my_stat(file_name->str, &stat_info, MYF(MY_WME))) + if (!mysql_file_stat(key_file_fileparser, + file_name->str, &stat_info, MYF(MY_WME))) { DBUG_RETURN(0); } @@ -386,20 +388,21 @@ sql_parse_prepare(const LEX_STRING *file_name, MEM_ROOT *mem_root, DBUG_RETURN(0); } - if ((file= my_open(file_name->str, O_RDONLY | O_SHARE, MYF(MY_WME))) < 0) + if ((file= mysql_file_open(key_file_fileparser, file_name->str, + O_RDONLY | O_SHARE, MYF(MY_WME))) < 0) { DBUG_RETURN(0); } - if ((len= my_read(file, (uchar *)parser->buff, - stat_info.st_size, MYF(MY_WME))) == + if ((len= mysql_file_read(file, (uchar *)parser->buff, + stat_info.st_size, MYF(MY_WME))) == MY_FILE_ERROR) { - my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); DBUG_RETURN(0); } - if (my_close(file, MYF(MY_WME))) + if (mysql_file_close(file, MYF(MY_WME))) { DBUG_RETURN(0); } diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index c4df268279a..5f206f194e4 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2006 MySQL AB & Sasha +/* Copyright (C) 2001-2006 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,8 +39,8 @@ uint rpl_status=RPL_NULL; -pthread_mutex_t LOCK_rpl_status; -pthread_cond_t COND_rpl_status; +mysql_mutex_t LOCK_rpl_status; +mysql_cond_t COND_rpl_status; HASH slave_list; const char *rpl_role_type[] = {"MASTER","SLAVE",NullS}; @@ -107,11 +107,11 @@ static int init_failsafe_rpl_thread(THD* thd) void change_rpl_status(RPL_STATUS from_status, RPL_STATUS to_status) { - pthread_mutex_lock(&LOCK_rpl_status); + mysql_mutex_lock(&LOCK_rpl_status); if (rpl_status == from_status || rpl_status == RPL_ANY) rpl_status = to_status; - pthread_cond_signal(&COND_rpl_status); - pthread_mutex_unlock(&LOCK_rpl_status); + mysql_cond_signal(&COND_rpl_status); + mysql_mutex_unlock(&LOCK_rpl_status); } @@ -140,7 +140,7 @@ void unregister_slave(THD* thd, bool only_mine, bool need_mutex) if (thd->server_id) { if (need_mutex) - pthread_mutex_lock(&LOCK_slave_list); + mysql_mutex_lock(&LOCK_slave_list); SLAVE_INFO* old_si; if ((old_si = (SLAVE_INFO*)my_hash_search(&slave_list, @@ -149,7 +149,7 @@ void unregister_slave(THD* thd, bool only_mine, bool need_mutex) my_hash_delete(&slave_list, (uchar*)old_si); if (need_mutex) - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); } } @@ -170,7 +170,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) uchar *p= packet, *p_end= packet + packet_length; const char *errmsg= "Wrong parameters to function register_slave"; - if (check_access(thd, REPL_SLAVE_ACL, any_db,0,0,0,0)) + if (check_access(thd, REPL_SLAVE_ACL, any_db, NULL, NULL, 0, 0)) return 1; if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME)))) goto err2; @@ -189,10 +189,10 @@ int register_slave(THD* thd, uchar* packet, uint packet_length) si->master_id= server_id; si->thd= thd; - pthread_mutex_lock(&LOCK_slave_list); + mysql_mutex_lock(&LOCK_slave_list); unregister_slave(thd,0,0); res= my_hash_insert(&slave_list, (uchar*) si); - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); return res; err: @@ -215,12 +215,37 @@ extern "C" void slave_info_free(void *s) my_free(s, MYF(MY_WME)); } +#ifdef HAVE_PSI_INTERFACE +static PSI_mutex_key key_LOCK_slave_list; + +static PSI_mutex_info all_slave_list_mutexes[]= +{ + { &key_LOCK_slave_list, "LOCK_slave_list", PSI_FLAG_GLOBAL} +}; + +static void init_all_slave_list_mutexes(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_slave_list_mutexes); + PSI_server->register_mutex(category, all_slave_list_mutexes, count); +} +#endif /* HAVE_PSI_INTERFACE */ + void init_slave_list() { +#ifdef HAVE_PSI_INTERFACE + init_all_slave_list_mutexes(); +#endif + my_hash_init(&slave_list, system_charset_info, SLAVE_LIST_CHUNK, 0, 0, (my_hash_get_key) slave_list_key, (my_hash_free_key) slave_info_free, 0); - pthread_mutex_init(&LOCK_slave_list, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_slave_list, &LOCK_slave_list, MY_MUTEX_INIT_FAST); } void end_slave_list() @@ -229,7 +254,7 @@ void end_slave_list() if (my_hash_inited(&slave_list)) { my_hash_free(&slave_list); - pthread_mutex_destroy(&LOCK_slave_list); + mysql_mutex_destroy(&LOCK_slave_list); } } @@ -241,7 +266,7 @@ static int find_target_pos(LEX_MASTER_INFO *mi, IO_CACHE *log, char *errmsg) for (;;) { Log_event* ev; - if (!(ev = Log_event::read_log_event(log, (pthread_mutex_t*) 0, 0))) + if (!(ev= Log_event::read_log_event(log, (mysql_mutex_t*) 0, 0))) { if (log->error > 0) strmov(errmsg, "Binary log truncated in the middle of event"); @@ -283,7 +308,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) char last_log_name[FN_REFLEN]; IO_CACHE log; File file = -1, last_file = -1; - pthread_mutex_t *log_lock; + mysql_mutex_t *log_lock; const char* errmsg_p; Slave_log_event* sev = 0; my_off_t last_pos = 0; @@ -313,7 +338,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) bzero((char*) &log,sizeof(log)); log_lock = mysql_bin_log.get_log_lock(); - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); for (;;) { @@ -345,7 +370,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) goto err; } end_io_cache(&log); - (void) my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); if (init_io_cache(&log, (file = last_file), IO_SIZE, READ_CACHE, 0, 0, MYF(MY_WME))) { @@ -361,7 +386,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) switch (mysql_bin_log.find_next_log(&linfo, 1)) { case LOG_INFO_EOF: if (last_file >= 0) - (void)my_close(last_file, MYF(MY_WME)); + mysql_file_close(last_file, MYF(MY_WME)); last_file = -1; goto found_log; case 0: @@ -373,7 +398,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) end_io_cache(&log); if (last_file >= 0) - (void) my_close(last_file, MYF(MY_WME)); + mysql_file_close(last_file, MYF(MY_WME)); last_file = file; } @@ -386,15 +411,15 @@ found_log: mi_inited: error = 0; err: - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); end_io_cache(&log); pthread_mutex_lock(&LOCK_thread_count); thd->current_linfo = 0; pthread_mutex_unlock(&LOCK_thread_count); if (file >= 0) - (void) my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); if (last_file >= 0 && last_file != file) - (void) my_close(last_file, MYF(MY_WME)); + mysql_file_close(last_file, MYF(MY_WME)); DBUG_RETURN(error); } @@ -415,7 +440,7 @@ static Slave_log_event* find_slave_event(IO_CACHE* log, for (i = 0; i < 2; i++) { - if (!(ev = Log_event::read_log_event(log, (pthread_mutex_t*)0, 0))) + if (!(ev= Log_event::read_log_event(log, (mysql_mutex_t*)0, 0))) { my_snprintf(errmsg, SLAVE_ERRMSG_SIZE, "Error reading event in log '%s'", @@ -537,7 +562,7 @@ HOSTS"; goto err; } - pthread_mutex_lock(&LOCK_slave_list); + mysql_mutex_lock(&LOCK_slave_list); while ((row= mysql_fetch_row(res))) { @@ -552,14 +577,14 @@ HOSTS"; if (!(si = (SLAVE_INFO*)my_malloc(sizeof(SLAVE_INFO), MYF(MY_WME)))) { error= "the slave is out of memory"; - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); goto err; } si->server_id = log_server_id; if (my_hash_insert(&slave_list, (uchar*)si)) { error= "the slave is out of memory"; - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); goto err; } } @@ -573,7 +598,7 @@ HOSTS"; strmake(si->password, row[3], sizeof(si->password)-1); } } - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); err: if (res) @@ -611,13 +636,13 @@ pthread_handler_t handle_failsafe_rpl(void *arg) sql_print_error("Could not initialize failsafe replication thread"); goto err; } - pthread_mutex_lock(&LOCK_rpl_status); + mysql_mutex_lock(&LOCK_rpl_status); msg= thd->enter_cond(&COND_rpl_status, &LOCK_rpl_status, "Waiting for request"); while (!thd->killed && !abort_loop) { bool break_req_chain = 0; - pthread_cond_wait(&COND_rpl_status, &LOCK_rpl_status); + mysql_cond_wait(&COND_rpl_status, &LOCK_rpl_status); thd_proc_info(thd, "Processing request"); while (!break_req_chain) { @@ -680,7 +705,7 @@ bool show_slave_hosts(THD* thd) Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); - pthread_mutex_lock(&LOCK_slave_list); + mysql_mutex_lock(&LOCK_slave_list); for (uint i = 0; i < slave_list.records; ++i) { @@ -697,11 +722,11 @@ bool show_slave_hosts(THD* thd) protocol->store((uint32) si->master_id); if (protocol->write()) { - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); DBUG_RETURN(TRUE); } } - pthread_mutex_unlock(&LOCK_slave_list); + mysql_mutex_unlock(&LOCK_slave_list); my_eof(thd); DBUG_RETURN(FALSE); } diff --git a/sql/repl_failsafe.h b/sql/repl_failsafe.h index f140b026bc1..dd6770be0b4 100644 --- a/sql/repl_failsafe.h +++ b/sql/repl_failsafe.h @@ -1,7 +1,7 @@ #ifndef REPL_FAILSAFE_INCLUDED #define REPL_FAILSAFE_INCLUDED -/* Copyright (C) 2001-2005 MySQL AB & Sasha +/* Copyright (C) 2001-2005 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,8 +28,8 @@ typedef enum {RPL_AUTH_MASTER=0,RPL_IDLE_SLAVE,RPL_ACTIVE_SLAVE, RPL_ANY /* wild card used by change_rpl_status */ } RPL_STATUS; extern uint rpl_status; -extern pthread_mutex_t LOCK_rpl_status; -extern pthread_cond_t COND_rpl_status; +extern mysql_mutex_t LOCK_rpl_status; +extern mysql_cond_t COND_rpl_status; extern TYPELIB rpl_role_typelib, rpl_status_typelib; extern const char* rpl_role_type[], *rpl_status_type[]; diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 4f8c3f50ded..38382fd2a0e 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,21 +44,21 @@ Master_info::Master_info(bool is_slave_recovery) my_init_dynamic_array(&ignore_server_ids, sizeof(::server_id), 16, 16); bzero((char*) &file, sizeof(file)); - pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST); - pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST); - pthread_cond_init(&data_cond, NULL); - pthread_cond_init(&start_cond, NULL); - pthread_cond_init(&stop_cond, NULL); + mysql_mutex_init(key_master_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_master_info_data_lock, &data_lock, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_master_info_data_cond, &data_cond, NULL); + mysql_cond_init(key_master_info_start_cond, &start_cond, NULL); + mysql_cond_init(key_master_info_stop_cond, &stop_cond, NULL); } Master_info::~Master_info() { delete_dynamic(&ignore_server_ids); - pthread_mutex_destroy(&run_lock); - pthread_mutex_destroy(&data_lock); - pthread_cond_destroy(&data_cond); - pthread_cond_destroy(&start_cond); - pthread_cond_destroy(&stop_cond); + mysql_mutex_destroy(&run_lock); + mysql_mutex_destroy(&data_lock); + mysql_cond_destroy(&data_cond); + mysql_cond_destroy(&start_cond); + mysql_cond_destroy(&stop_cond); } /** @@ -175,7 +175,7 @@ int init_master_info(Master_info* mi, const char* master_info_fname, keep other threads from reading bogus info */ - pthread_mutex_lock(&mi->data_lock); + mysql_mutex_lock(&mi->data_lock); fd = mi->fd; /* does master.info exist ? */ @@ -184,7 +184,7 @@ int init_master_info(Master_info* mi, const char* master_info_fname, { if (abort_if_no_master_info_file) { - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(0); } /* @@ -192,8 +192,9 @@ int init_master_info(Master_info* mi, const char* master_info_fname, the old descriptor and re-create the old file */ if (fd >= 0) - my_close(fd, MYF(MY_WME)); - if ((fd = my_open(fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ) + mysql_file_close(fd, MYF(MY_WME)); + if ((fd= mysql_file_open(key_file_master_info, + fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ) { sql_print_error("Failed to create a new master info file (\ file '%s', errno %d)", fname, my_errno); @@ -217,7 +218,8 @@ file '%s')", fname); reinit_io_cache(&mi->file, READ_CACHE, 0L,0,0); else { - if ((fd = my_open(fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ) + if ((fd= mysql_file_open(key_file_master_info, + fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0 ) { sql_print_error("Failed to open the existing master info file (\ file '%s', errno %d)", fname, my_errno); @@ -369,7 +371,7 @@ file '%s')", fname); reinit_io_cache(&mi->file, WRITE_CACHE, 0L, 0, 1); if ((error=test(flush_master_info(mi, 1)))) sql_print_error("Failed to flush master info file"); - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(error); errwithmsg: @@ -378,11 +380,11 @@ errwithmsg: err: if (fd >= 0) { - my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); end_io_cache(&mi->file); } mi->fd= -1; - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(1); } @@ -494,7 +496,7 @@ void end_master_info(Master_info* mi) if (mi->fd >= 0) { end_io_cache(&mi->file); - (void)my_close(mi->fd, MYF(MY_WME)); + mysql_file_close(mi->fd, MYF(MY_WME)); mi->fd = -1; } mi->inited = 0; diff --git a/sql/rpl_mi.h b/sql/rpl_mi.h index 6e4e2f9cdc7..6dd9fab7904 100644 --- a/sql/rpl_mi.h +++ b/sql/rpl_mi.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -77,8 +77,8 @@ class Master_info : public Slave_reporting_capability File fd; // we keep the file open, so we need to remember the file pointer IO_CACHE file; - pthread_mutex_t data_lock,run_lock; - pthread_cond_t data_cond,start_cond,stop_cond; + mysql_mutex_t data_lock, run_lock; + mysql_cond_t data_cond, start_cond, stop_cond; THD *io_thd; MYSQL* mysql; uint32 file_id; /* for 3.23 load data infile */ diff --git a/sql/rpl_reporting.cc b/sql/rpl_reporting.cc index a09140de3c4..ae9d100eeb4 100644 --- a/sql/rpl_reporting.cc +++ b/sql/rpl_reporting.cc @@ -1,7 +1,29 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "mysql_priv.h" #include "rpl_reporting.h" +Slave_reporting_capability::Slave_reporting_capability(char const *thread_name) + : m_thread_name(thread_name) +{ + mysql_mutex_init(key_mutex_slave_reporting_capability_err_lock, + &err_lock, MY_MUTEX_INIT_FAST); +} + void Slave_reporting_capability::report(loglevel level, int err_code, const char *msg, ...) const @@ -13,7 +35,7 @@ Slave_reporting_capability::report(loglevel level, int err_code, va_list args; va_start(args, msg); - pthread_mutex_lock(&err_lock); + mysql_mutex_lock(&err_lock); switch (level) { case ERROR_LEVEL: @@ -39,7 +61,7 @@ Slave_reporting_capability::report(loglevel level, int err_code, my_vsnprintf(pbuff, pbuffsize, msg, args); - pthread_mutex_unlock(&err_lock); + mysql_mutex_unlock(&err_lock); va_end(args); /* If the msg string ends with '.', do not add a ',' it would be ugly */ @@ -51,5 +73,5 @@ Slave_reporting_capability::report(loglevel level, int err_code, Slave_reporting_capability::~Slave_reporting_capability() { - pthread_mutex_destroy(&err_lock); + mysql_mutex_destroy(&err_lock); } diff --git a/sql/rpl_reporting.h b/sql/rpl_reporting.h index ce33407e516..b8d9c049653 100644 --- a/sql/rpl_reporting.h +++ b/sql/rpl_reporting.h @@ -1,6 +1,21 @@ #ifndef RPL_REPORTING_H #define RPL_REPORTING_H +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + /** Maximum size of an error message from a slave thread. */ @@ -17,17 +32,13 @@ class Slave_reporting_capability { public: /** lock used to synchronize m_last_error on 'SHOW SLAVE STATUS' **/ - mutable pthread_mutex_t err_lock; + mutable mysql_mutex_t err_lock; /** Constructor. @param thread_name Printable name of the slave thread that is reporting. */ - Slave_reporting_capability(char const *thread_name) - : m_thread_name(thread_name) - { - pthread_mutex_init(&err_lock, MY_MUTEX_INIT_FAST); - } + Slave_reporting_capability(char const *thread_name); /** Writes a message and, if it's an error message, to Last_Error @@ -47,9 +58,9 @@ public: STATUS. */ void clear_error() { - pthread_mutex_lock(&err_lock); + mysql_mutex_lock(&err_lock); m_last_error.clear(); - pthread_mutex_unlock(&err_lock); + mysql_mutex_unlock(&err_lock); } /** diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 70d24f42985..a982cfd25a4 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,13 +54,15 @@ Relay_log_info::Relay_log_info(bool is_slave_recovery) bzero((char*) &info_file, sizeof(info_file)); bzero((char*) &cache_buf, sizeof(cache_buf)); cached_charset_invalidate(); - pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST); - pthread_mutex_init(&data_lock, MY_MUTEX_INIT_FAST); - pthread_mutex_init(&log_space_lock, MY_MUTEX_INIT_FAST); - pthread_cond_init(&data_cond, NULL); - pthread_cond_init(&start_cond, NULL); - pthread_cond_init(&stop_cond, NULL); - pthread_cond_init(&log_space_cond, NULL); + mysql_mutex_init(key_relay_log_info_run_lock, &run_lock, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_relay_log_info_data_lock, + &data_lock, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_relay_log_info_log_space_lock, + &log_space_lock, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_relay_log_info_data_cond, &data_cond, NULL); + mysql_cond_init(key_relay_log_info_start_cond, &start_cond, NULL); + mysql_cond_init(key_relay_log_info_stop_cond, &stop_cond, NULL); + mysql_cond_init(key_relay_log_info_log_space_cond, &log_space_cond, NULL); relay_log.init_pthread_objects(); DBUG_VOID_RETURN; } @@ -70,13 +72,13 @@ Relay_log_info::~Relay_log_info() { DBUG_ENTER("Relay_log_info::~Relay_log_info"); - pthread_mutex_destroy(&run_lock); - pthread_mutex_destroy(&data_lock); - pthread_mutex_destroy(&log_space_lock); - pthread_cond_destroy(&data_cond); - pthread_cond_destroy(&start_cond); - pthread_cond_destroy(&stop_cond); - pthread_cond_destroy(&log_space_cond); + mysql_mutex_destroy(&run_lock); + mysql_mutex_destroy(&data_lock); + mysql_mutex_destroy(&log_space_lock); + mysql_cond_destroy(&data_cond); + mysql_cond_destroy(&start_cond); + mysql_cond_destroy(&stop_cond); + mysql_cond_destroy(&log_space_cond); relay_log.cleanup(); DBUG_VOID_RETURN; } @@ -95,7 +97,7 @@ int init_relay_log_info(Relay_log_info* rli, if (rli->inited) // Set if this function called DBUG_RETURN(0); fn_format(fname, info_fname, mysql_data_home, "", 4+32); - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); info_fd = rli->info_fd; rli->cur_log_fd = -1; rli->slave_skip_counter=0; @@ -110,7 +112,7 @@ int init_relay_log_info(Relay_log_info* rli, if (fn_format(pattern, PREFIX_SQL_LOAD, pattern, "", MY_SAFE_PATH | MY_RETURN_REAL_PATH) == NullS) { - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); sql_print_error("Unable to use slave's temporary directory %s", slave_load_tmpdir); DBUG_RETURN(1); @@ -139,7 +141,7 @@ int init_relay_log_info(Relay_log_info* rli, if (opt_relay_logname && opt_relay_logname[strlen(opt_relay_logname) - 1] == FN_LIBCHAR) { - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); sql_print_error("Path '%s' is a directory name, please specify \ a file name for --relay-log option", opt_relay_logname); DBUG_RETURN(1); @@ -151,7 +153,7 @@ a file name for --relay-log option", opt_relay_logname); opt_relaylog_index_name[strlen(opt_relaylog_index_name) - 1] == FN_LIBCHAR) { - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); sql_print_error("Path '%s' is a directory name, please specify \ a file name for --relay-log-index option", opt_relaylog_index_name); DBUG_RETURN(1); @@ -188,7 +190,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name); (max_relay_log_size ? max_relay_log_size : max_binlog_size), 1, TRUE)) { - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); sql_print_error("Failed in open_log() called from init_relay_log_info()"); DBUG_RETURN(1); } @@ -203,8 +205,9 @@ a file name for --relay-log-index option", opt_relaylog_index_name); the old descriptor and re-create the old file */ if (info_fd >= 0) - my_close(info_fd, MYF(MY_WME)); - if ((info_fd = my_open(fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0) + mysql_file_close(info_fd, MYF(MY_WME)); + if ((info_fd= mysql_file_open(key_file_relay_log_info, + fname, O_CREAT|O_RDWR|O_BINARY, MYF(MY_WME))) < 0) { sql_print_error("Failed to create a new relay log info file (\ file '%s', errno %d)", fname, my_errno); @@ -238,7 +241,8 @@ file '%s', errno %d)", fname, my_errno); else { int error=0; - if ((info_fd = my_open(fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0) + if ((info_fd= mysql_file_open(key_file_relay_log_info, + fname, O_RDWR|O_BINARY, MYF(MY_WME))) < 0) { sql_print_error("\ Failed to open the existing relay log info file '%s' (errno %d)", @@ -255,10 +259,10 @@ Failed to open the existing relay log info file '%s' (errno %d)", if (error) { if (info_fd >= 0) - my_close(info_fd, MYF(0)); + mysql_file_close(info_fd, MYF(0)); rli->info_fd= -1; rli->relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT); - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); DBUG_RETURN(1); } } @@ -327,17 +331,17 @@ Failed to open the existing relay log info file '%s' (errno %d)", goto err; } rli->inited= 1; - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); DBUG_RETURN(error); err: sql_print_error("%s", msg); end_io_cache(&rli->info_file); if (info_fd >= 0) - my_close(info_fd, MYF(0)); + mysql_file_close(info_fd, MYF(0)); rli->info_fd= -1; rli->relay_log.close(LOG_CLOSE_INDEX | LOG_CLOSE_STOP_EVENT); - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); DBUG_RETURN(1); } @@ -346,7 +350,8 @@ static inline int add_relay_log(Relay_log_info* rli,LOG_INFO* linfo) { MY_STAT s; DBUG_ENTER("add_relay_log"); - if (!my_stat(linfo->log_file_name,&s,MYF(0))) + if (!mysql_file_stat(key_file_binlog, + linfo->log_file_name, &s, MYF(0))) { sql_print_error("log %s listed in the index, but failed to stat", linfo->log_file_name); @@ -446,10 +451,10 @@ int init_relay_log_pos(Relay_log_info* rli,const char* log, DBUG_PRINT("info", ("pos: %lu", (ulong) pos)); *errmsg=0; - pthread_mutex_t *log_lock=rli->relay_log.get_log_lock(); + mysql_mutex_t *log_lock= rli->relay_log.get_log_lock(); if (need_data_lock) - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); /* Slave threads are not the only users of init_relay_log_pos(). CHANGE MASTER @@ -469,13 +474,13 @@ int init_relay_log_pos(Relay_log_info* rli,const char* log, rli->relay_log.description_event_for_exec= new Format_description_log_event(3); - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); /* Close log file and free buffers if it's already open */ if (rli->cur_log_fd >= 0) { end_io_cache(&rli->cache_buf); - my_close(rli->cur_log_fd, MYF(MY_WME)); + mysql_file_close(rli->cur_log_fd, MYF(MY_WME)); rli->cur_log_fd = -1; } @@ -609,12 +614,12 @@ err: */ if (!relay_log_purge) rli->log_space_limit= 0; - pthread_cond_broadcast(&rli->data_cond); + mysql_cond_broadcast(&rli->data_cond); - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); if (need_data_lock) - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); if (!rli->relay_log.description_event_for_exec->is_valid() && !*errmsg) *errmsg= "Invalid Format_description log event; could be out of memory"; @@ -665,7 +670,7 @@ int Relay_log_info::wait_for_pos(THD* thd, String* log_name, log_name->c_ptr(), (ulong) log_pos, (ulong) timeout)); set_timespec(abstime,timeout); - pthread_mutex_lock(&data_lock); + mysql_mutex_lock(&data_lock); msg= thd->enter_cond(&data_cond, &data_lock, "Waiting for the slave SQL thread to " "advance position"); @@ -778,26 +783,26 @@ int Relay_log_info::wait_for_pos(THD* thd, String* log_name, DBUG_PRINT("info",("Waiting for master update")); /* - We are going to pthread_cond_(timed)wait(); if the SQL thread stops it + We are going to mysql_cond_(timed)wait(); if the SQL thread stops it will wake us up. */ if (timeout > 0) { /* - Note that pthread_cond_timedwait checks for the timeout + Note that mysql_cond_timedwait checks for the timeout before for the condition ; i.e. it returns ETIMEDOUT if the system time equals or exceeds the time specified by abstime before the condition variable is signaled or broadcast, _or_ if the absolute time specified by abstime has already passed at the time of the call. - For that reason, pthread_cond_timedwait will do the "timeoutting" job + For that reason, mysql_cond_timedwait will do the "timeoutting" job even if its condition is always immediately signaled (case of a loaded master). */ - error=pthread_cond_timedwait(&data_cond, &data_lock, &abstime); + error= mysql_cond_timedwait(&data_cond, &data_lock, &abstime); } else - pthread_cond_wait(&data_cond, &data_lock); + mysql_cond_wait(&data_cond, &data_lock); DBUG_PRINT("info",("Got signal of master update or timed out")); if (error == ETIMEDOUT || error == ETIME) { @@ -833,7 +838,7 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos, DBUG_ENTER("Relay_log_info::inc_group_relay_log_pos"); if (!skip_lock) - pthread_mutex_lock(&data_lock); + mysql_mutex_lock(&data_lock); inc_event_relay_log_pos(); group_relay_log_pos= event_relay_log_pos; strmake(group_relay_log_name,event_relay_log_name, @@ -877,9 +882,9 @@ void Relay_log_info::inc_group_relay_log_pos(ulonglong log_pos, { group_master_log_pos= log_pos; } - pthread_cond_broadcast(&data_cond); + mysql_cond_broadcast(&data_cond); if (!skip_lock) - pthread_mutex_unlock(&data_lock); + mysql_mutex_unlock(&data_lock); DBUG_VOID_RETURN; } @@ -948,7 +953,7 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset, DBUG_ASSERT(rli->mi->slave_running == 0); rli->slave_skip_counter=0; - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); /* we close the relay log fd possibly left open by the slave SQL thread, @@ -959,7 +964,7 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset, if (rli->cur_log_fd >= 0) { end_io_cache(&rli->cache_buf); - my_close(rli->cur_log_fd, MYF(MY_WME)); + mysql_file_close(rli->cur_log_fd, MYF(MY_WME)); rli->cur_log_fd= -1; } @@ -991,7 +996,7 @@ err: char buf[22]; #endif DBUG_PRINT("info",("log_space_total: %s",llstr(rli->log_space_total,buf))); - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); DBUG_RETURN(error); } diff --git a/sql/rpl_rli.h b/sql/rpl_rli.h index 33b708cb1bd..c7bef125d40 100644 --- a/sql/rpl_rli.h +++ b/sql/rpl_rli.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 MySQL AB +/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -123,17 +123,17 @@ public: TABLE *save_temporary_tables; /* - standard lock acquistion order to avoid deadlocks: + standard lock acquisition order to avoid deadlocks: run_lock, data_lock, relay_log.LOCK_log, relay_log.LOCK_index */ - pthread_mutex_t data_lock,run_lock; + mysql_mutex_t data_lock, run_lock; /* start_cond is broadcast when SQL thread is started stop_cond - when stopped data_cond - when data protected by data_lock changes */ - pthread_cond_t start_cond, stop_cond, data_cond; + mysql_cond_t start_cond, stop_cond, data_cond; /* parent Master_info structure */ Master_info *mi; @@ -215,8 +215,8 @@ public: volatile uint32 slave_skip_counter; volatile ulong abort_pos_wait; /* Incremented on change master */ volatile ulong slave_run_id; /* Incremented on slave start */ - pthread_mutex_t log_space_lock; - pthread_cond_t log_space_cond; + mysql_mutex_t log_space_lock; + mysql_cond_t log_space_cond; THD * sql_thd; #ifndef DBUG_OFF int events_till_abort; diff --git a/sql/set_var.cc b/sql/set_var.cc index 989934456df..73989b9c96f 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -38,16 +38,12 @@ static uchar *get_sys_var_length(const sys_var *var, size_t *length, sys_var_chain all_sys_vars = { NULL, NULL }; -int sys_var_init(DYNAMIC_ARRAY *long_options) +int sys_var_init() { - uint count= 0; - uint saved_elements= long_options->elements; - DBUG_ENTER("sys_var_init"); - for (sys_var *var=all_sys_vars.first; var; var= var->next, count++) - if (var->register_option(long_options)) - goto error; + /* Must be already initialized. */ + DBUG_ASSERT(system_charset_info != NULL); if (my_hash_init(&system_variable_hash, system_charset_info, 100, 0, 0, (my_hash_get_key) get_sys_var_length, 0, HASH_UNIQUE)) @@ -58,6 +54,25 @@ int sys_var_init(DYNAMIC_ARRAY *long_options) DBUG_RETURN(0); +error: + fprintf(stderr, "failed to initialize System variables"); + DBUG_RETURN(1); +} + +int sys_var_add_options(DYNAMIC_ARRAY *long_options, int parse_flags) +{ + uint saved_elements= long_options->elements; + + DBUG_ENTER("sys_var_add_options"); + + for (sys_var *var=all_sys_vars.first; var; var= var->next) + { + if (var->register_option(long_options, parse_flags)) + goto error; + } + + DBUG_RETURN(0); + error: fprintf(stderr, "failed to initialize System variables"); long_options->elements= saved_elements; @@ -99,6 +114,7 @@ void sys_var_end() @param deprecated_version if not 0 - when this variable will go away @param substitute if not 0 - what one should use instead when this deprecated variable + @param parse_flag either PARSE_EARLY or PARSE_NORMAL */ sys_var::sys_var(sys_var_chain *chain, const char *name_arg, const char *comment, int flags_arg, ptrdiff_t off, @@ -107,10 +123,11 @@ sys_var::sys_var(sys_var_chain *chain, const char *name_arg, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, on_update_function on_update_func, - uint deprecated_version, const char *substitute) : + uint deprecated_version, const char *substitute, + int parse_flag) : next(0), binlog_status(binlog_status_arg), - flags(flags_arg), show_val_type(show_val_type_arg), + flags(flags_arg), m_parse_flag(parse_flag), show_val_type(show_val_type_arg), guard(lock), offset(off), on_check(on_check_func), on_update(on_update_func), is_os_charset(FALSE) { @@ -203,7 +220,7 @@ uchar *sys_var::value_ptr(THD *thd, enum_var_type type, LEX_STRING *base) { if (type == OPT_GLOBAL || scope() == GLOBAL) { - safe_mutex_assert_owner(&LOCK_global_system_variables); + mysql_mutex_assert_owner(&LOCK_global_system_variables); AutoRLock lock(guard); return global_value_ptr(thd, base); } diff --git a/sql/set_var.h b/sql/set_var.h index d878e85cec0..4a212d3b685 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -1,6 +1,6 @@ #ifndef SET_VAR_INCLUDED #define SET_VAR_INCLUDED -/* Copyright 2000-2008 MySQL AB, 2009 Sun Microsystems, Inc. +/* Copyright (C) 2000-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -56,6 +56,8 @@ public: LEX_CSTRING name; enum flag_enum { GLOBAL, SESSION, ONLY_SESSION, SCOPE_MASK=1023, READONLY=1024, ALLOCATED=2048 }; + static const int PARSE_EARLY= 1; + static const int PARSE_NORMAL= 2; /** Enumeration type to indicate for a system variable whether it will be written to the binlog or not. @@ -68,6 +70,7 @@ protected: typedef bool (*on_update_function)(sys_var *self, THD *thd, enum_var_type type); int flags; ///< or'ed flag_enum values + int m_parse_flag; ///< either PARSE_EARLY or PARSE_NORMAL. const SHOW_TYPE show_val_type; ///< what value_ptr() returns for sql_show.cc my_option option; ///< min, max, default values are stored here PolyLock *guard; ///< *second* lock that protects the variable @@ -83,7 +86,7 @@ public: enum get_opt_arg_type getopt_arg_type, SHOW_TYPE show_val_type_arg, longlong def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, on_update_function on_update_func, - uint deprecated_version, const char *substitute); + uint deprecated_version, const char *substitute, int parse_flag); /** The instance should only be destroyed on shutdown, as it doesn't unlink itself from the chain. @@ -122,8 +125,11 @@ public: } return true; // keep gcc happy } - bool register_option(DYNAMIC_ARRAY *array) - { return option.id != -1 && insert_dynamic(array, (uchar*)&option); } + bool register_option(DYNAMIC_ARRAY *array, int parse_flags) + { + return (option.id != -1) && (m_parse_flag & parse_flags) && + insert_dynamic(array, (uchar*)&option); + } private: virtual bool do_check(THD *thd, set_var *var) = 0; @@ -289,7 +295,8 @@ extern sys_var *Sys_autocommit_ptr; CHARSET_INFO *get_old_charset_by_name(const char *old_name); -int sys_var_init(DYNAMIC_ARRAY *long_options); +int sys_var_init(); +int sys_var_add_options(DYNAMIC_ARRAY *long_options, int parse_flags); void sys_var_end(void); #endif diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index 69fd6e0fbe2..d19dd61bdde 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6266,3 +6266,8 @@ ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT eng "The syntax '%s' is deprecated and will be removed in MySQL %s." ger "Die Syntax '%s' ist veraltet und wird in MySQL %s entfernt." +ER_WRONG_NATIVE_TABLE_STRUCTURE + eng "Native table '%-.64s'.'%-.64s' has the wrong structure" + +ER_WRONG_PERFSCHEMA_USAGE + eng "Invalid performance_schema usage." diff --git a/sql/slave.cc b/sql/slave.cc index 4dea78596ba..654ccfe72b5 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -148,8 +148,8 @@ static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi); static Log_event* next_event(Relay_log_info* rli); static int queue_event(Master_info* mi,const char* buf,ulong event_len); static int terminate_slave_thread(THD *thd, - pthread_mutex_t *term_lock, - pthread_cond_t *term_cond, + mysql_mutex_t *term_lock, + mysql_cond_t *term_cond, volatile uint *slave_running, bool skip_lock); static bool check_io_slave_killed(THD *thd, Master_info *mi, const char *info); @@ -198,8 +198,8 @@ void lock_slave_threads(Master_info* mi) DBUG_ENTER("lock_slave_threads"); //TODO: see if we can do this without dual mutex - pthread_mutex_lock(&mi->run_lock); - pthread_mutex_lock(&mi->rli.run_lock); + mysql_mutex_lock(&mi->run_lock); + mysql_mutex_lock(&mi->rli.run_lock); DBUG_VOID_RETURN; } @@ -213,11 +213,32 @@ void unlock_slave_threads(Master_info* mi) DBUG_ENTER("unlock_slave_threads"); //TODO: see if we can do this without dual mutex - pthread_mutex_unlock(&mi->rli.run_lock); - pthread_mutex_unlock(&mi->run_lock); + mysql_mutex_unlock(&mi->rli.run_lock); + mysql_mutex_unlock(&mi->run_lock); DBUG_VOID_RETURN; } +#ifdef HAVE_PSI_INTERFACE +static PSI_thread_key key_thread_slave_io, key_thread_slave_sql; + +static PSI_thread_info all_slave_threads[]= +{ + { &key_thread_slave_io, "slave_io", PSI_FLAG_GLOBAL}, + { &key_thread_slave_sql, "slave_sql", PSI_FLAG_GLOBAL} +}; + +static void init_slave_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_slave_threads); + PSI_server->register_thread(category, all_slave_threads, count); +} +#endif /* HAVE_PSI_INTERFACE */ /* Initialize slave structures */ @@ -226,12 +247,16 @@ int init_slave() DBUG_ENTER("init_slave"); int error= 0; +#ifdef HAVE_PSI_INTERFACE + init_slave_psi_keys(); +#endif + /* This is called when mysqld starts. Before client connections are accepted. However bootstrap may conflict with us if it does START SLAVE. So it's safer to take the lock. */ - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); /* TODO: re-write this to interate through the list of files for multi-master @@ -288,7 +313,7 @@ int init_slave() } err: - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); DBUG_RETURN(error); } @@ -466,7 +491,7 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) if (!mi->inited) DBUG_RETURN(0); /* successfully do nothing */ int error,force_all = (thread_mask & SLAVE_FORCE_ALL); - pthread_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock; + mysql_mutex_t *sql_lock = &mi->rli.run_lock, *io_lock = &mi->run_lock; if (thread_mask & (SLAVE_IO|SLAVE_FORCE_ALL)) { @@ -530,19 +555,19 @@ int terminate_slave_threads(Master_info* mi,int thread_mask,bool skip_lock) */ static int terminate_slave_thread(THD *thd, - pthread_mutex_t *term_lock, - pthread_cond_t *term_cond, + mysql_mutex_t *term_lock, + mysql_cond_t *term_cond, volatile uint *slave_running, bool skip_lock) { DBUG_ENTER("terminate_slave_thread"); if (!skip_lock) { - pthread_mutex_lock(term_lock); + mysql_mutex_lock(term_lock); } else { - safe_mutex_assert_owner(term_lock); + mysql_mutex_assert_owner(term_lock); } if (!*slave_running) { @@ -552,7 +577,7 @@ terminate_slave_thread(THD *thd, if run_lock (term_lock) is acquired locally then either slave_running status is fine */ - pthread_mutex_unlock(term_lock); + mysql_mutex_unlock(term_lock); DBUG_RETURN(0); } else @@ -573,7 +598,7 @@ terminate_slave_thread(THD *thd, int error; DBUG_PRINT("loop", ("killing slave thread")); - pthread_mutex_lock(&thd->LOCK_thd_data); + mysql_mutex_lock(&thd->LOCK_thd_data); #ifndef DONT_USE_THR_ALARM /* Error codes from pthread_kill are: @@ -584,7 +609,7 @@ terminate_slave_thread(THD *thd, DBUG_ASSERT(err != EINVAL); #endif thd->awake(THD::NOT_KILLED); - pthread_mutex_unlock(&thd->LOCK_thd_data); + mysql_mutex_unlock(&thd->LOCK_thd_data); /* There is a small chance that slave thread might miss the first @@ -592,21 +617,25 @@ terminate_slave_thread(THD *thd, */ struct timespec abstime; set_timespec(abstime,2); - error= pthread_cond_timedwait(term_cond, term_lock, &abstime); + error= mysql_cond_timedwait(term_cond, term_lock, &abstime); DBUG_ASSERT(error == ETIMEDOUT || error == 0); } DBUG_ASSERT(*slave_running == 0); if (!skip_lock) - pthread_mutex_unlock(term_lock); + mysql_mutex_unlock(term_lock); DBUG_RETURN(0); } -int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, - pthread_mutex_t *cond_lock, - pthread_cond_t *start_cond, +int start_slave_thread( +#ifdef HAVE_PSI_INTERFACE + PSI_thread_key thread_key, +#endif + pthread_handler h_func, mysql_mutex_t *start_lock, + mysql_mutex_t *cond_lock, + mysql_cond_t *start_cond, volatile uint *slave_running, volatile ulong *slave_run_id, Master_info* mi) @@ -618,13 +647,13 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, DBUG_ASSERT(mi->inited); if (start_lock) - pthread_mutex_lock(start_lock); + mysql_mutex_lock(start_lock); if (!server_id) { if (start_cond) - pthread_cond_broadcast(start_cond); + mysql_cond_broadcast(start_cond); if (start_lock) - pthread_mutex_unlock(start_lock); + mysql_mutex_unlock(start_lock); sql_print_error("Server id not set, will not start slave"); DBUG_RETURN(ER_BAD_SLAVE); } @@ -632,17 +661,18 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, if (*slave_running) { if (start_cond) - pthread_cond_broadcast(start_cond); + mysql_cond_broadcast(start_cond); if (start_lock) - pthread_mutex_unlock(start_lock); + mysql_mutex_unlock(start_lock); DBUG_RETURN(ER_SLAVE_MUST_STOP); } start_id= *slave_run_id; DBUG_PRINT("info",("Creating new slave thread")); - if (pthread_create(&th, &connection_attrib, h_func, (void*)mi)) + if (mysql_thread_create(thread_key, + &th, &connection_attrib, h_func, (void*)mi)) { if (start_lock) - pthread_mutex_unlock(start_lock); + mysql_mutex_unlock(start_lock); DBUG_RETURN(ER_SLAVE_THREAD); } if (start_cond && cond_lock) // caller has cond_lock @@ -653,19 +683,19 @@ int start_slave_thread(pthread_handler h_func, pthread_mutex_t *start_lock, DBUG_PRINT("sleep",("Waiting for slave thread to start")); const char* old_msg = thd->enter_cond(start_cond,cond_lock, "Waiting for slave thread to start"); - pthread_cond_wait(start_cond, cond_lock); + mysql_cond_wait(start_cond, cond_lock); thd->exit_cond(old_msg); - pthread_mutex_lock(cond_lock); // re-acquire it as exit_cond() released + mysql_mutex_lock(cond_lock); // re-acquire it as exit_cond() released if (thd->killed) { if (start_lock) - pthread_mutex_unlock(start_lock); + mysql_mutex_unlock(start_lock); DBUG_RETURN(thd->killed_errno()); } } } if (start_lock) - pthread_mutex_unlock(start_lock); + mysql_mutex_unlock(start_lock); DBUG_RETURN(0); } @@ -683,8 +713,8 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, Master_info* mi, const char* master_info_fname, const char* slave_info_fname, int thread_mask) { - pthread_mutex_t *lock_io=0,*lock_sql=0,*lock_cond_io=0,*lock_cond_sql=0; - pthread_cond_t* cond_io=0,*cond_sql=0; + mysql_mutex_t *lock_io=0, *lock_sql=0, *lock_cond_io=0, *lock_cond_sql=0; + mysql_cond_t* cond_io=0, *cond_sql=0; int error=0; DBUG_ENTER("start_slave_threads"); @@ -702,16 +732,24 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, } if (thread_mask & SLAVE_IO) - error=start_slave_thread(handle_slave_io,lock_io,lock_cond_io, - cond_io, - &mi->slave_running, &mi->slave_run_id, - mi); + error= start_slave_thread( +#ifdef HAVE_PSI_INTERFACE + key_thread_slave_io, +#endif + handle_slave_io, lock_io, lock_cond_io, + cond_io, + &mi->slave_running, &mi->slave_run_id, + mi); if (!error && (thread_mask & SLAVE_SQL)) { - error=start_slave_thread(handle_slave_sql,lock_sql,lock_cond_sql, - cond_sql, - &mi->rli.slave_running, &mi->rli.slave_run_id, - mi); + error= start_slave_thread( +#ifdef HAVE_PSI_INTERFACE + key_thread_slave_sql, +#endif + handle_slave_sql, lock_sql, lock_cond_sql, + cond_sql, + &mi->rli.slave_running, &mi->rli.slave_run_id, + mi); if (error) terminate_slave_threads(mi, thread_mask & SLAVE_IO, !need_slave_mutex); } @@ -748,7 +786,7 @@ void end_slave() will make us wait until slave threads have started, and START SLAVE returns, then we terminate them here. */ - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (active_mi) { /* @@ -758,7 +796,7 @@ void end_slave() */ terminate_slave_threads(active_mi,SLAVE_FORCE_ALL); } - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); DBUG_VOID_RETURN; } @@ -773,14 +811,14 @@ void end_slave() */ void close_active_mi() { - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (active_mi) { end_master_info(active_mi); delete active_mi; active_mi= 0; } - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); } static bool io_slave_killed(THD* thd, Master_info* mi) @@ -1479,7 +1517,7 @@ static bool wait_for_relay_log_space(Relay_log_info* rli) THD* thd = mi->io_thd; DBUG_ENTER("wait_for_relay_log_space"); - pthread_mutex_lock(&rli->log_space_lock); + mysql_mutex_lock(&rli->log_space_lock); save_proc_info= thd->enter_cond(&rli->log_space_cond, &rli->log_space_lock, "\ @@ -1487,7 +1525,7 @@ Waiting for the slave SQL thread to free enough relay log space"); while (rli->log_space_limit < rli->log_space_total && !(slave_killed=io_slave_killed(thd,mi)) && !rli->ignore_log_space_limit) - pthread_cond_wait(&rli->log_space_cond, &rli->log_space_lock); + mysql_cond_wait(&rli->log_space_cond, &rli->log_space_lock); thd->exit_cond(save_proc_info); DBUG_RETURN(slave_killed); } @@ -1509,11 +1547,11 @@ Waiting for the slave SQL thread to free enough relay log space"); static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi) { Relay_log_info *rli= &mi->rli; - pthread_mutex_t *log_lock= rli->relay_log.get_log_lock(); + mysql_mutex_t *log_lock= rli->relay_log.get_log_lock(); DBUG_ENTER("write_ignored_events_info_to_relay_log"); DBUG_ASSERT(thd == mi->io_thd); - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); if (rli->ign_master_log_name_end[0]) { DBUG_PRINT("info",("writing a Rotate event to track down ignored events")); @@ -1522,7 +1560,7 @@ static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi) Rotate_log_event::DUP_NAME); rli->ign_master_log_name_end[0]= 0; /* can unlock before writing as slave SQL thd will soon see our Rotate */ - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); if (likely((bool)ev)) { ev->server_id= 0; // don't be ignored by slave SQL thread @@ -1544,7 +1582,7 @@ static void write_ignored_events_info_to_relay_log(THD *thd, Master_info *mi) " SHOW SLAVE STATUS may be inaccurate"); } else - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); DBUG_VOID_RETURN; } @@ -1715,14 +1753,14 @@ bool show_master_info(THD* thd, Master_info* mi) slave_running can be accessed without run_lock but not other non-volotile members like mi->io_thd, which is guarded by the mutex. */ - pthread_mutex_lock(&mi->run_lock); + mysql_mutex_lock(&mi->run_lock); protocol->store(mi->io_thd ? mi->io_thd->proc_info : "", &my_charset_bin); - pthread_mutex_unlock(&mi->run_lock); + mysql_mutex_unlock(&mi->run_lock); - pthread_mutex_lock(&mi->data_lock); - pthread_mutex_lock(&mi->rli.data_lock); - pthread_mutex_lock(&mi->err_lock); - pthread_mutex_lock(&mi->rli.err_lock); + mysql_mutex_lock(&mi->data_lock); + mysql_mutex_lock(&mi->rli.data_lock); + mysql_mutex_lock(&mi->err_lock); + mysql_mutex_lock(&mi->rli.err_lock); protocol->store(mi->host, &my_charset_bin); protocol->store(mi->user, &my_charset_bin); protocol->store((uint32) mi->port); @@ -1849,10 +1887,10 @@ bool show_master_info(THD* thd, Master_info* mi) // Master_Server_id protocol->store((uint32) mi->master_id); - pthread_mutex_unlock(&mi->rli.err_lock); - pthread_mutex_unlock(&mi->err_lock); - pthread_mutex_unlock(&mi->rli.data_lock); - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->rli.err_lock); + mysql_mutex_unlock(&mi->err_lock); + mysql_mutex_unlock(&mi->rli.data_lock); + mysql_mutex_unlock(&mi->data_lock); if (my_net_write(&thd->net, (uchar*) thd->packet.ptr(), packet->length())) DBUG_RETURN(TRUE); @@ -2228,7 +2266,7 @@ int apply_event_and_update_pos(Log_event* ev, THD* thd, Relay_log_info* rli) int reason= ev->shall_skip(rli); if (reason == Log_event::EVENT_SKIP_COUNT) sql_slave_skip_counter= --rli->slave_skip_counter; - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); if (reason == Log_event::EVENT_SKIP_NOT) exec_res= ev->apply_event(rli); @@ -2334,7 +2372,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) event execution. But we will release it in places where we will wait for something for example inside of next_event(). */ - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); Log_event * ev = next_event(rli); @@ -2342,7 +2380,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) if (sql_slave_killed(thd,rli)) { - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); delete ev; DBUG_RETURN(1); } @@ -2365,7 +2403,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) error in query execution to be printed. */ rli->abort_slave= 1; - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); delete ev; DBUG_RETURN(1); } @@ -2383,7 +2421,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) { DBUG_ASSERT(thd->transaction.all.modified_non_trans_table); rli->abort_slave= 1; - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); delete ev; rli->inc_event_relay_log_pos(); DBUG_RETURN(0); @@ -2447,10 +2485,10 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) /* chance for concurrent connection to get more locks */ safe_sleep(thd, min(rli->trans_retries, MAX_SLAVE_RETRY_PAUSE), (CHECK_KILLED_FUNC)sql_slave_killed, (void*)rli); - pthread_mutex_lock(&rli->data_lock); // because of SHOW STATUS + mysql_mutex_lock(&rli->data_lock); // because of SHOW STATUS rli->trans_retries++; rli->retried_trans++; - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); DBUG_PRINT("info", ("Slave retries transaction " "rli->trans_retries: %lu", rli->trans_retries)); } @@ -2478,7 +2516,7 @@ static int exec_relay_log_event(THD* thd, Relay_log_info* rli) } DBUG_RETURN(exec_res); } - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); rli->report(ERROR_LEVEL, ER_SLAVE_RELAY_LOG_READ_FAILURE, ER(ER_SLAVE_RELAY_LOG_READ_FAILURE), "\ Could not parse relay log event entry. The possible reasons are: the master's \ @@ -2609,7 +2647,7 @@ pthread_handler_t handle_slave_io(void *arg) mysql= NULL ; retry_count= 0; - pthread_mutex_lock(&mi->run_lock); + mysql_mutex_lock(&mi->run_lock); /* Inform waiting threads that slave has started */ mi->slave_run_id++; @@ -2626,8 +2664,8 @@ pthread_handler_t handle_slave_io(void *arg) mi->clear_error(); if (init_slave_thread(thd, SLAVE_THD_IO)) { - pthread_cond_broadcast(&mi->start_cond); - pthread_mutex_unlock(&mi->run_lock); + mysql_cond_broadcast(&mi->start_cond); + mysql_mutex_unlock(&mi->run_lock); sql_print_error("Failed during slave I/O thread initialization"); goto err; } @@ -2636,8 +2674,8 @@ pthread_handler_t handle_slave_io(void *arg) pthread_mutex_unlock(&LOCK_thread_count); mi->slave_running = 1; mi->abort_slave = 0; - pthread_mutex_unlock(&mi->run_lock); - pthread_cond_broadcast(&mi->start_cond); + mysql_mutex_unlock(&mi->run_lock); + mysql_cond_broadcast(&mi->start_cond); DBUG_PRINT("master_info",("log_file_name: '%s' position: %s", mi->master_log_name, @@ -2920,7 +2958,7 @@ err: } write_ignored_events_info_to_relay_log(thd, mi); thd_proc_info(thd, "Waiting for slave mutex on exit"); - pthread_mutex_lock(&mi->run_lock); + mysql_mutex_lock(&mi->run_lock); /* Forget the relay log's format */ delete mi->rli.relay_log.description_event_for_queue; @@ -2942,9 +2980,9 @@ err: is important. Otherwise a killer_thread can execute between the calls and delete the mi structure leading to a crash! (see BUG#25306 for details) */ - pthread_cond_broadcast(&mi->stop_cond); // tell the world we are done + mysql_cond_broadcast(&mi->stop_cond); // tell the world we are done DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5);); - pthread_mutex_unlock(&mi->run_lock); + mysql_mutex_unlock(&mi->run_lock); DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); @@ -2981,16 +3019,17 @@ int check_temp_dir(char* tmp_file) /* Check permissions to create a file. */ - if ((fd= my_create(tmp_file, CREATE_MODE, - O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, - MYF(MY_WME))) < 0) + if ((fd= mysql_file_create(key_file_misc, + tmp_file, CREATE_MODE, + O_WRONLY | O_BINARY | O_EXCL | O_NOFOLLOW, + MYF(MY_WME))) < 0) DBUG_RETURN(1); /* Clean up. */ - my_close(fd, MYF(0)); - my_delete(tmp_file, MYF(0)); + mysql_file_close(fd, MYF(0)); + mysql_file_delete(key_file_misc, tmp_file, MYF(0)); DBUG_RETURN(0); } @@ -3016,7 +3055,7 @@ pthread_handler_t handle_slave_sql(void *arg) DBUG_ENTER("handle_slave_sql"); DBUG_ASSERT(rli->inited); - pthread_mutex_lock(&rli->run_lock); + mysql_mutex_lock(&rli->run_lock); DBUG_ASSERT(!rli->slave_running); errmsg= 0; #ifndef DBUG_OFF @@ -3038,8 +3077,8 @@ pthread_handler_t handle_slave_sql(void *arg) TODO: this is currently broken - slave start and change master will be stuck if we fail here */ - pthread_cond_broadcast(&rli->start_cond); - pthread_mutex_unlock(&rli->run_lock); + mysql_cond_broadcast(&rli->start_cond); + mysql_mutex_unlock(&rli->run_lock); rli->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, "Failed during slave thread initialization"); goto err; @@ -3059,8 +3098,8 @@ pthread_handler_t handle_slave_sql(void *arg) Seconds_Behind_Master grows. No big deal. */ rli->abort_slave = 0; - pthread_mutex_unlock(&rli->run_lock); - pthread_cond_broadcast(&rli->start_cond); + mysql_mutex_unlock(&rli->run_lock); + mysql_cond_broadcast(&rli->start_cond); /* Reset errors for a clean start (otherwise, if the master is idle, the SQL @@ -3075,9 +3114,9 @@ pthread_handler_t handle_slave_sql(void *arg) rli->clear_error(); //tell the I/O thread to take relay_log_space_limit into account from now on - pthread_mutex_lock(&rli->log_space_lock); + mysql_mutex_lock(&rli->log_space_lock); rli->ignore_log_space_limit= 0; - pthread_mutex_unlock(&rli->log_space_lock); + mysql_mutex_unlock(&rli->log_space_lock); rli->trans_retries= 0; // start from "no error" DBUG_PRINT("info", ("rli->trans_retries: %lu", rli->trans_retries)); @@ -3151,17 +3190,17 @@ log '%s' at position %s, relay log '%s' position: %s", RPL_LOG_NAME, First check until condition - probably there is nothing to execute. We do not want to wait for next event in this case. */ - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); if (rli->until_condition != Relay_log_info::UNTIL_NONE && rli->is_until_satisfied(thd, NULL)) { char buf[22]; sql_print_information("Slave SQL thread stopped because it reached its" " UNTIL position %s", llstr(rli->until_pos(), buf)); - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); goto err; } - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); /* Read queries from the IO/THREAD until this thread is killed */ @@ -3264,9 +3303,9 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ thd->set_query(NULL, 0); thd->reset_db(NULL, 0); thd_proc_info(thd, "Waiting for slave mutex on exit"); - pthread_mutex_lock(&rli->run_lock); + mysql_mutex_lock(&rli->run_lock); /* We need data_lock, at least to wake up any waiting master_pos_wait() */ - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); DBUG_ASSERT(rli->slave_running == 1); // tracking buffer overrun /* When master_pos_wait() wakes up it will check this and terminate */ rli->slave_running= 0; @@ -3274,9 +3313,9 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ delete rli->relay_log.description_event_for_exec; rli->relay_log.description_event_for_exec= 0; /* Wake up master_pos_wait() */ - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); DBUG_PRINT("info",("Signaling possibly waiting master_pos_wait() functions")); - pthread_cond_broadcast(&rli->data_cond); + mysql_cond_broadcast(&rli->data_cond); rli->ignore_log_space_limit= 0; /* don't need any lock */ /* we die so won't remember charset - re-update them on next thread start */ rli->cached_charset_invalidate(); @@ -3302,9 +3341,9 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ is important. Otherwise a killer_thread can execute between the calls and delete the mi structure leading to a crash! (see BUG#25306 for details) */ - pthread_cond_broadcast(&rli->stop_cond); + mysql_cond_broadcast(&rli->stop_cond); DBUG_EXECUTE_IF("simulate_slave_delay_at_terminate_bug38694", sleep(5);); - pthread_mutex_unlock(&rli->run_lock); // tell the world we are done + mysql_mutex_unlock(&rli->run_lock); // tell the world we are done DBUG_LEAVE; // Must match DBUG_ENTER() my_thread_end(); @@ -3447,7 +3486,7 @@ err: static int process_io_rotate(Master_info *mi, Rotate_log_event *rev) { DBUG_ENTER("process_io_rotate"); - safe_mutex_assert_owner(&mi->data_lock); + mysql_mutex_assert_owner(&mi->data_lock); if (unlikely(!rev->is_valid())) DBUG_RETURN(1); @@ -3543,7 +3582,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, DBUG_RETURN(1); } - pthread_mutex_lock(&mi->data_lock); + mysql_mutex_lock(&mi->data_lock); ev->log_pos= mi->master_log_pos; /* 3.23 events don't contain log_pos */ switch (ev->get_type_code()) { case STOP_EVENT: @@ -3554,7 +3593,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, if (unlikely(process_io_rotate(mi,(Rotate_log_event*)ev))) { delete ev; - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(1); } inc_pos= 0; @@ -3575,7 +3614,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, delete ev; mi->master_log_pos += inc_pos; DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); my_free((char*)tmp_buf, MYF(0)); DBUG_RETURN(error); } @@ -3594,7 +3633,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, if (unlikely(rli->relay_log.append(ev))) { delete ev; - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(1); } rli->relay_log.harvest_bytes_written(&rli->log_space_total); @@ -3602,7 +3641,7 @@ static int queue_binlog_ver_1_event(Master_info *mi, const char *buf, delete ev; mi->master_log_pos+= inc_pos; DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(0); } @@ -3630,7 +3669,7 @@ static int queue_binlog_ver_3_event(Master_info *mi, const char *buf, my_free((char*) tmp_buf, MYF(MY_ALLOW_ZERO_PTR)); DBUG_RETURN(1); } - pthread_mutex_lock(&mi->data_lock); + mysql_mutex_lock(&mi->data_lock); switch (ev->get_type_code()) { case STOP_EVENT: goto err; @@ -3638,7 +3677,7 @@ static int queue_binlog_ver_3_event(Master_info *mi, const char *buf, if (unlikely(process_io_rotate(mi,(Rotate_log_event*)ev))) { delete ev; - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(1); } inc_pos= 0; @@ -3650,7 +3689,7 @@ static int queue_binlog_ver_3_event(Master_info *mi, const char *buf, if (unlikely(rli->relay_log.append(ev))) { delete ev; - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(1); } rli->relay_log.harvest_bytes_written(&rli->log_space_total); @@ -3658,7 +3697,7 @@ static int queue_binlog_ver_3_event(Master_info *mi, const char *buf, mi->master_log_pos+= inc_pos; err: DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos)); - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_RETURN(0); } @@ -3708,7 +3747,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) String error_msg; ulong inc_pos; Relay_log_info *rli= &mi->rli; - pthread_mutex_t *log_lock= rli->relay_log.get_log_lock(); + mysql_mutex_t *log_lock= rli->relay_log.get_log_lock(); ulong s_id; DBUG_ENTER("queue_event"); @@ -3719,7 +3758,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) DBUG_RETURN(queue_old_event(mi,buf,event_len)); LINT_INIT(inc_pos); - pthread_mutex_lock(&mi->data_lock); + mysql_mutex_lock(&mi->data_lock); switch (buf[EVENT_TYPE_OFFSET]) { case STOP_EVENT: @@ -3855,7 +3894,7 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) direct master (an unsupported, useless setup!). */ - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); s_id= uint4korr(buf + SERVER_ID_OFFSET); if ((s_id == ::server_id && !mi->rli.replicate_same_server_id) || /* @@ -3917,12 +3956,12 @@ static int queue_event(Master_info* mi,const char* buf, ulong event_len) } rli->ign_master_log_name_end[0]= 0; // last event is not ignored } - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); skip_relay_logging: err: - pthread_mutex_unlock(&mi->data_lock); + mysql_mutex_unlock(&mi->data_lock); DBUG_PRINT("info", ("error: %d", error)); if (error) mi->report(ERROR_LEVEL, error, ER(error), @@ -3942,13 +3981,13 @@ void end_relay_log_info(Relay_log_info* rli) if (rli->info_fd >= 0) { end_io_cache(&rli->info_file); - (void) my_close(rli->info_fd, MYF(MY_WME)); + mysql_file_close(rli->info_fd, MYF(MY_WME)); rli->info_fd = -1; } if (rli->cur_log_fd >= 0) { end_io_cache(&rli->cache_buf); - (void)my_close(rli->cur_log_fd, MYF(MY_WME)); + mysql_file_close(rli->cur_log_fd, MYF(MY_WME)); rli->cur_log_fd = -1; } rli->inited = 0; @@ -4304,7 +4343,7 @@ static Log_event* next_event(Relay_log_info* rli) { Log_event* ev; IO_CACHE* cur_log = rli->cur_log; - pthread_mutex_t *log_lock = rli->relay_log.get_log_lock(); + mysql_mutex_t *log_lock = rli->relay_log.get_log_lock(); const char* errmsg=0; THD* thd = rli->sql_thd; DBUG_ENTER("next_event"); @@ -4321,9 +4360,9 @@ static Log_event* next_event(Relay_log_info* rli) so we assume calling function acquired this mutex for us and we will hold it for the most of the loop below However, we will release it whenever it is worth the hassle, and in the cases when we go into a - pthread_cond_wait() with the non-data_lock mutex + mysql_cond_wait() with the non-data_lock mutex */ - safe_mutex_assert_owner(&rli->data_lock); + mysql_mutex_assert_owner(&rli->data_lock); while (!sql_slave_killed(thd,rli)) { @@ -4342,7 +4381,7 @@ static Log_event* next_event(Relay_log_info* rli) if ((hot_log = (cur_log != &rli->cache_buf))) { DBUG_ASSERT(rli->cur_log_fd == -1); // foreign descriptor - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); /* Reading xxx_file_id is safe because the log will only @@ -4352,7 +4391,7 @@ static Log_event* next_event(Relay_log_info* rli) { // The master has switched to a new log file; Reopen the old log file cur_log=reopen_relay_log(rli, &errmsg); - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); if (!cur_log) // No more log files goto err; hot_log=0; // Using old binary log @@ -4399,7 +4438,7 @@ static Log_event* next_event(Relay_log_info* rli) */ rli->future_event_relay_log_pos= my_b_tell(cur_log); if (hot_log) - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); DBUG_RETURN(ev); } DBUG_ASSERT(thd==rli->sql_thd); @@ -4409,7 +4448,7 @@ static Log_event* next_event(Relay_log_info* rli) { errmsg = "slave SQL thread aborted because of I/O error"; if (hot_log) - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); goto err; } if (!cur_log->error) /* EOF */ @@ -4456,7 +4495,7 @@ static Log_event* next_event(Relay_log_info* rli) 0, rli->ign_master_log_pos_end, Rotate_log_event::DUP_NAME); rli->ign_master_log_name_end[0]= 0; - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); if (unlikely(!ev)) { errmsg= "Slave SQL thread failed to create a Rotate event " @@ -4471,7 +4510,7 @@ static Log_event* next_event(Relay_log_info* rli) We can, and should release data_lock while we are waiting for update. If we do not, show slave status will block */ - pthread_mutex_unlock(&rli->data_lock); + mysql_mutex_unlock(&rli->data_lock); /* Possible deadlock : @@ -4497,7 +4536,7 @@ static Log_event* next_event(Relay_log_info* rli) be stopped, and the SQL thread sets ignore_log_space_limit to 0 when it stops. */ - pthread_mutex_lock(&rli->log_space_lock); + mysql_mutex_lock(&rli->log_space_lock); // prevent the I/O thread from blocking next times rli->ignore_log_space_limit= 1; /* @@ -4506,12 +4545,12 @@ static Log_event* next_event(Relay_log_info* rli) ~Relay_log_info(), i.e. when rli is destroyed, and rli will not be destroyed before we exit the present function. */ - pthread_mutex_unlock(&rli->log_space_lock); - pthread_cond_broadcast(&rli->log_space_cond); + mysql_mutex_unlock(&rli->log_space_lock); + mysql_cond_broadcast(&rli->log_space_cond); // Note that wait_for_update_relay_log unlocks lock_log ! rli->relay_log.wait_for_update_relay_log(rli->sql_thd); // re-acquire data lock since we released it earlier - pthread_mutex_lock(&rli->data_lock); + mysql_mutex_lock(&rli->data_lock); rli->last_master_timestamp= save_timestamp; continue; } @@ -4522,7 +4561,7 @@ static Log_event* next_event(Relay_log_info* rli) */ end_io_cache(cur_log); DBUG_ASSERT(rli->cur_log_fd >= 0); - my_close(rli->cur_log_fd, MYF(MY_WME)); + mysql_file_close(rli->cur_log_fd, MYF(MY_WME)); rli->cur_log_fd = -1; if (relay_log_purge) @@ -4579,7 +4618,7 @@ static Log_event* next_event(Relay_log_info* rli) DBUG_PRINT("info",("hot_log: %d",hot_log)); if (!hot_log) /* if hot_log, we already have this mutex */ - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); if (rli->relay_log.is_active(rli->linfo.log_file_name)) { #ifdef EXTRA_DEBUG @@ -4600,13 +4639,16 @@ static Log_event* next_event(Relay_log_info* rli) */ if (check_binlog_magic(cur_log,&errmsg)) { - if (!hot_log) pthread_mutex_unlock(log_lock); + if (!hot_log) + mysql_mutex_unlock(log_lock); goto err; } - if (!hot_log) pthread_mutex_unlock(log_lock); + if (!hot_log) + mysql_mutex_unlock(log_lock); continue; } - if (!hot_log) pthread_mutex_unlock(log_lock); + if (!hot_log) + mysql_mutex_unlock(log_lock); /* if we get here, the log was not hot, so we will have to open it ourselves. We are sure that the log is still not hot now (a log can get @@ -4629,7 +4671,7 @@ static Log_event* next_event(Relay_log_info* rli) TODO: come up with something better to handle this error */ if (hot_log) - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); sql_print_error("Slave SQL thread: I/O error reading \ event(errno: %d cur_log->error: %d)", my_errno,cur_log->error); diff --git a/sql/slave.h b/sql/slave.h index 69290ecac0a..421f838f188 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -160,12 +160,17 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, inside the start_lock section, but at the same time we want a pthread_cond_wait() on start_cond,start_lock */ -int start_slave_thread(pthread_handler h_func, pthread_mutex_t* start_lock, - pthread_mutex_t *cond_lock, - pthread_cond_t* start_cond, - volatile uint *slave_running, - volatile ulong *slave_run_id, - Master_info* mi); +int start_slave_thread( +#ifdef HAVE_PSI_INTERFACE + PSI_thread_key thread_key, +#endif + pthread_handler h_func, + mysql_mutex_t *start_lock, + mysql_mutex_t *cond_lock, + mysql_cond_t *start_cond, + volatile uint *slave_running, + volatile ulong *slave_run_id, + Master_info *mi); /* If fd is -1, dump to NET */ int mysql_table_dump(THD* thd, const char* db, diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 4cbae0bbb5a..1f5ac826bdf 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -371,23 +371,23 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) DBUG_PRINT("info",("user table fields: %d, password length: %d", table->s->fields, password_length)); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); if (password_length < SCRAMBLED_PASSWORD_CHAR_LENGTH) { if (opt_secure_auth) { - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); sql_print_error("Fatal error: mysql.user table is in old format, " "but server started with --secure-auth option."); goto end; } mysql_user_table_is_in_short_password_format= true; if (global_system_variables.old_passwords) - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); else { global_system_variables.old_passwords= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); sql_print_warning("mysql.user table is not updated to new password format; " "Disabling new password usage until " "mysql_fix_privilege_tables is run"); @@ -397,7 +397,7 @@ static my_bool acl_load(THD *thd, TABLE_LIST *tables) else { mysql_user_table_is_in_short_password_format= false; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); } allow_all_hosts=0; @@ -689,7 +689,7 @@ my_bool acl_reload(THD *thd) } if ((old_initialized=initialized)) - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); old_acl_hosts=acl_hosts; old_acl_users=acl_users; @@ -716,7 +716,7 @@ my_bool acl_reload(THD *thd) delete_dynamic(&old_acl_dbs); } if (old_initialized) - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); end: close_thread_tables(thd); DBUG_RETURN(return_val); @@ -868,7 +868,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, DBUG_RETURN(0); } - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); /* Find acl entry in user database. Note, that find_acl_user is not the same, @@ -1047,7 +1047,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, else *sctx->priv_host= 0; } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_RETURN(res); } @@ -1094,7 +1094,7 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host, DBUG_RETURN(FALSE); } - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); sctx->master_access= 0; sctx->db_access= 0; @@ -1148,7 +1148,7 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host, else *sctx->priv_host= 0; } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_RETURN(res); } @@ -1169,7 +1169,7 @@ static void acl_update_user(const char *user, const char *host, USER_RESOURCES *mqh, ulong privileges) { - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); for (uint i=0 ; i < acl_users.elements ; i++) { @@ -1221,7 +1221,7 @@ static void acl_insert_user(const char *user, const char *host, { ACL_USER acl_user; - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); acl_user.user=*user ? strdup_root(&mem,user) : 0; update_hostname(&acl_user.host, *host ? strdup_root(&mem, host): 0); @@ -1252,7 +1252,7 @@ static void acl_insert_user(const char *user, const char *host, static void acl_update_db(const char *user, const char *host, const char *db, ulong privileges) { - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); for (uint i=0 ; i < acl_dbs.elements ; i++) { @@ -1297,7 +1297,7 @@ static void acl_insert_db(const char *user, const char *host, const char *db, ulong privileges) { ACL_DB acl_db; - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); acl_db.user=strdup_root(&mem,user); update_hostname(&acl_db.host, *host ? strdup_root(&mem,host) : 0); acl_db.db=strdup_root(&mem,db); @@ -1327,7 +1327,7 @@ ulong acl_get(const char *host, const char *ip, acl_entry *entry; DBUG_ENTER("acl_get"); - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); end=strmov((tmp_db=strmov(strmov(key, ip ? ip : "")+1,user)+1),db); if (lower_case_table_names) { @@ -1339,7 +1339,7 @@ ulong acl_get(const char *host, const char *ip, key_length))) { db_access=entry->access; - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_PRINT("exit", ("access: 0x%lx", db_access)); DBUG_RETURN(db_access); } @@ -1393,7 +1393,7 @@ exit: memcpy((uchar*) entry->key,key,key_length); acl_cache->add(entry); } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_PRINT("exit", ("access: 0x%lx", db_access & host_access)); DBUG_RETURN(db_access & host_access); } @@ -1475,12 +1475,12 @@ bool acl_check_host(const char *host, const char *ip) { if (allow_all_hosts) return 0; - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); if ((host && my_hash_search(&acl_check_hosts,(uchar*) host,strlen(host))) || (ip && my_hash_search(&acl_check_hosts,(uchar*) ip, strlen(ip)))) { - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); return 0; // Found host } for (uint i=0 ; i < acl_wild_hosts.elements ; i++) @@ -1488,11 +1488,11 @@ bool acl_check_host(const char *host, const char *ip) acl_host_and_ip *acl=dynamic_element(&acl_wild_hosts,i,acl_host_and_ip*); if (compare_hostname(acl, host, ip)) { - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); return 0; // Host ok } } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); return 1; // Host is not allowed } @@ -1528,7 +1528,7 @@ int check_change_password(THD *thd, const char *host, const char *user, my_strcasecmp(system_charset_info, host, thd->security_ctx->priv_host))) { - if (check_access(thd, UPDATE_ACL, "mysql",0,1,0,0)) + if (check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 0)) return(1); } if (!thd->slave_thread && !thd->security_ctx->user[0]) @@ -1606,11 +1606,11 @@ bool change_password(THD *thd, const char *host, const char *user, if (!(table= open_ltable(thd, &tables, TL_WRITE, 0))) DBUG_RETURN(1); - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); ACL_USER *acl_user; if (!(acl_user= find_acl_user(host, user, TRUE))) { - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); my_message(ER_PASSWORD_NO_MATCH, ER(ER_PASSWORD_NO_MATCH), MYF(0)); goto end; } @@ -1622,12 +1622,12 @@ bool change_password(THD *thd, const char *host, const char *user, acl_user->user ? acl_user->user : "", new_password, new_password_len)) { - pthread_mutex_unlock(&acl_cache->lock); /* purecov: deadcode */ + mysql_mutex_unlock(&acl_cache->lock); /* purecov: deadcode */ goto end; } acl_cache->clear(1); // Clear locked hostname cache - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); result= 0; if (mysql_bin_log.is_open()) { @@ -1668,9 +1668,9 @@ bool is_acl_user(const char *host, const char *user) if (!initialized) return TRUE; - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); res= find_acl_user(host, user, TRUE) != NULL; - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); return res; } @@ -1685,7 +1685,7 @@ find_acl_user(const char *host, const char *user, my_bool exact) DBUG_ENTER("find_acl_user"); DBUG_PRINT("enter",("host: '%s' user: '%s'",host,user)); - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); for (uint i=0 ; i < acl_users.elements ; i++) { @@ -1947,7 +1947,7 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, LEX *lex= thd->lex; DBUG_ENTER("replace_user_table"); - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); if (combo.password.str && combo.password.str[0]) { @@ -3147,8 +3147,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, if (!revoke_grant) create_new_users= test_if_create_new_users(thd); bool result= FALSE; - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); MEM_ROOT *old_root= thd->mem_root; thd->mem_root= &memex; grant_version++; @@ -3253,14 +3253,14 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, } } thd->mem_root= old_root; - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); if (!result) /* success */ { result= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); if (!result) /* success */ my_ok(thd); @@ -3357,8 +3357,8 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, if (!revoke_grant) create_new_users= test_if_create_new_users(thd); - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); MEM_ROOT *old_root= thd->mem_root; thd->mem_root= &memex; @@ -3419,7 +3419,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, } } thd->mem_root= old_root; - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); if (write_to_binlog) { @@ -3427,7 +3427,7 @@ bool mysql_routine_grant(THD *thd, TABLE_LIST *table_list, bool is_proc, result= TRUE; } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); /* Tables are automatically closed */ DBUG_RETURN(result); @@ -3499,8 +3499,8 @@ bool mysql_grant(THD *thd, const char *db, List &list, create_new_users= test_if_create_new_users(thd); /* go through users in user_list */ - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); grant_version++; int result=0; @@ -3539,14 +3539,14 @@ bool mysql_grant(THD *thd, const char *db, List &list, } } } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); if (!result) { result= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); if (!result) @@ -3810,7 +3810,7 @@ static my_bool grant_reload_procs_priv(THD *thd) DBUG_RETURN(TRUE); } - rw_wrlock(&LOCK_grant); + mysql_rwlock_wrlock(&LOCK_grant); /* Save a copy of the current hash if we need to undo the grant load */ old_proc_priv_hash= proc_priv_hash; old_func_priv_hash= func_priv_hash; @@ -3828,7 +3828,7 @@ static my_bool grant_reload_procs_priv(THD *thd) my_hash_free(&old_proc_priv_hash); my_hash_free(&old_func_priv_hash); } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); DBUG_RETURN(return_val); @@ -3876,7 +3876,7 @@ my_bool grant_reload(THD *thd) if (simple_open_n_lock_tables(thd, tables)) goto end; - rw_wrlock(&LOCK_grant); + mysql_rwlock_wrlock(&LOCK_grant); old_column_priv_hash= column_priv_hash; /* @@ -3898,7 +3898,7 @@ my_bool grant_reload(THD *thd) my_hash_free(&old_column_priv_hash); free_root(&old_mem,MYF(0)); } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); /* @@ -3908,9 +3908,9 @@ my_bool grant_reload(THD *thd) if (grant_reload_procs_priv(thd)) return_val= 1; - rw_wrlock(&LOCK_grant); + mysql_rwlock_wrlock(&LOCK_grant); grant_version++; - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); end: DBUG_RETURN(return_val); @@ -3962,6 +3962,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, TABLE_LIST *table, *first_not_own_table= thd->lex->first_not_own_table(); Security_context *sctx= thd->security_ctx; uint i; + ulong orig_want_access= want_access; DBUG_ENTER("check_grant"); DBUG_ASSERT(number > 0); @@ -3986,7 +3987,7 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, table->grant.orig_want_privilege= (want_access & ~SHOW_VIEW_ACL); } - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); for (table= tables; table && number-- && table != first_not_own_table; table= table->next_global) @@ -3995,6 +3996,33 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, sctx = test(table->security_ctx) ? table->security_ctx : thd->security_ctx; + const ACL_internal_table_access *access; + access= get_cached_table_access(&table->grant.m_internal, + table->get_db_name(), + table->get_table_name()); + + if (access) + { + switch(access->check(orig_want_access, &table->grant.privilege)) + { + case ACL_INTERNAL_ACCESS_GRANTED: + /* + Currently, + - the information_schema does not subclass ACL_internal_table_access, + there are no per table privilege checks for I_S, + - the performance schema does use per tables checks, but at most + returns 'CHECK_GRANT', and never 'ACCESS_GRANTED'. + so this branch is not used. + */ + DBUG_ASSERT(0); + case ACL_INTERNAL_ACCESS_DENIED: + goto err; + case ACL_INTERNAL_ACCESS_CHECK_GRANT: + break; + } + } + + want_access= orig_want_access; want_access&= ~sctx->master_access; if (!want_access) continue; // ok @@ -4047,11 +4075,11 @@ bool check_grant(THD *thd, ulong want_access, TABLE_LIST *tables, goto err; // impossible } } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); DBUG_RETURN(FALSE); err: - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); if (!no_errors) // Not a silent skip of table { char command[128]; @@ -4066,96 +4094,6 @@ err: } -/** - Check if all tables in the table list has any of the requested table level - privileges matching the current user. - - @param thd A pointer to the thread context. - @param required_access Set of privileges to compare against. - @param tables[in,out] A list of tables to be checked. - - @note If the table grant hash contains any grant table, this table will be - attached to the corresponding TABLE_LIST object in 'tables'. - - @return - @retval TRUE There is a privilege on the table level granted to the - current user. - @retval FALSE There are no privileges on the table level granted to the - current user. -*/ - -bool has_any_table_level_privileges(THD *thd, ulong required_access, - TABLE_LIST *tables) -{ - - Security_context *sctx; - GRANT_TABLE *grant_table; - TABLE_LIST *table; - - /* For each table in tables */ - for (table= tables; table; table= table->next_global) - { - /* - If this table is a VIEW, then it will supply its own security context. - This is because VIEWs can have a DEFINER or an INVOKER security role. - */ - sctx= table->security_ctx ? table->security_ctx : thd->security_ctx; - - /* - Get privileges from table_priv and column_priv tables by searching - the cache. - */ - rw_rdlock(&LOCK_grant); - grant_table= table_hash_search(sctx->host, sctx->ip, - table->db, sctx->priv_user, - table->table_name,0); - rw_unlock(&LOCK_grant); - - /* Stop if there are no grants for the current user */ - if (!grant_table) - return FALSE; - - /* - Save a pointer to the found grant_table in the table object. - This pointer can later be used to verify other access requirements - without having to look up the grant table in the hash. - */ - table->grant.grant_table= grant_table; - table->grant.version= grant_version; - table->grant.privilege|= grant_table->privs; - /* - Save all privileges which might be subject to column privileges - but not which aren't yet granted by table level ACLs. - This is can later be used for column privilege checks. - */ - table->grant.want_privilege= ((required_access & COL_ACLS) - & ~table->grant.privilege); - - /* - If the requested privileges share any intersection with the current - table privileges we have found at least one common privilege on the - table level. - */ - if (grant_table->privs & required_access) - continue; /* Check next table */ - - /* - There are no table level privileges which satisfies any of the - requested privileges. There might still be column privileges which - does though. - */ - return FALSE; - } - - /* - All tables in TABLE_LIST satisfy the requirement of having any - privilege on the table level. - */ - - return TRUE; -} - - /* Check column rights in given security context @@ -4187,7 +4125,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, if (!want_access) DBUG_RETURN(0); // Already checked - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); /* reload table if someone has modified any grants */ @@ -4205,12 +4143,12 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant, grant_column=column_hash_search(grant_table, name, length); if (grant_column && !(~grant_column->rights & want_access)) { - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); DBUG_RETURN(0); } err: - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); char command[128]; get_privilege_desc(command, sizeof(command), want_access); my_error(ER_COLUMNACCESS_DENIED_ERROR, MYF(0), @@ -4325,7 +4263,7 @@ bool check_grant_all_columns(THD *thd, ulong want_access_arg, */ bool using_column_privileges= FALSE; - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); for (; !fields->end_of_fields(); fields->next()) { @@ -4366,11 +4304,11 @@ bool check_grant_all_columns(THD *thd, ulong want_access_arg, goto err; } } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); return 0; err: - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); char command[128]; get_privilege_desc(command, sizeof(command), want_access); @@ -4428,7 +4366,7 @@ bool check_grant_db(THD *thd,const char *db) len= (uint) (strmov(strmov(helping, sctx->priv_user) + 1, db) - helping) + 1; - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); for (uint idx=0 ; idx < column_priv_hash.records ; idx++) { @@ -4448,7 +4386,7 @@ bool check_grant_db(THD *thd,const char *db) error= check_grant_db_routine(thd, db, &proc_priv_hash) && check_grant_db_routine(thd, db, &func_priv_hash); - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); return error; } @@ -4484,7 +4422,7 @@ bool check_grant_routine(THD *thd, ulong want_access, if (!want_access) DBUG_RETURN(0); // ok - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); for (table= procs; table; table= table->next_global) { GRANT_NAME *grant_proc; @@ -4498,10 +4436,10 @@ bool check_grant_routine(THD *thd, ulong want_access, goto err; } } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); DBUG_RETURN(0); err: - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); if (!no_errors) { char buff[1024]; @@ -4542,13 +4480,13 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, bool no_routine_acl= 1; GRANT_NAME *grant_proc; Security_context *sctx= thd->security_ctx; - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); if ((grant_proc= routine_hash_search(sctx->priv_host, sctx->ip, db, sctx->priv_user, name, is_proc, 0))) no_routine_acl= !(grant_proc->privs & SHOW_PROC_ACLS); - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); return no_routine_acl; } @@ -4564,7 +4502,7 @@ ulong get_table_grant(THD *thd, TABLE_LIST *table) const char *db = table->db ? table->db : thd->db; GRANT_TABLE *grant_table; - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); #ifdef EMBEDDED_LIBRARY grant_table= NULL; #else @@ -4576,7 +4514,7 @@ ulong get_table_grant(THD *thd, TABLE_LIST *table) if (grant_table) table->grant.privilege|= grant_table->privs; privilege= table->grant.privilege; - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); return privilege; } @@ -4607,7 +4545,7 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant, GRANT_COLUMN *grant_column; ulong priv; - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); /* reload table if someone has modified any grants */ if (grant->version != grant_version) { @@ -4630,7 +4568,7 @@ ulong get_column_grant(THD *thd, GRANT_INFO *grant, else priv= (grant->privilege | grant_table->privs | grant_column->rights); } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); return priv; } @@ -4697,14 +4635,14 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) DBUG_RETURN(TRUE); } - rw_rdlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_rdlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); acl_user= find_acl_user(lex_user->host.str, lex_user->user.str, TRUE); if (!acl_user) { - pthread_mutex_unlock(&acl_cache->lock); - rw_unlock(&LOCK_grant); + mysql_mutex_unlock(&acl_cache->lock); + mysql_rwlock_unlock(&LOCK_grant); my_error(ER_NONEXISTING_GRANT, MYF(0), lex_user->user.str, lex_user->host.str); @@ -4721,8 +4659,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) if (protocol->send_result_set_metadata(&field_list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) { - pthread_mutex_unlock(&acl_cache->lock); - rw_unlock(&LOCK_grant); + mysql_mutex_unlock(&acl_cache->lock); + mysql_rwlock_unlock(&LOCK_grant); DBUG_RETURN(TRUE); } @@ -5032,8 +4970,8 @@ bool mysql_show_grants(THD *thd,LEX_USER *lex_user) } end: - pthread_mutex_unlock(&acl_cache->lock); - rw_unlock(&LOCK_grant); + mysql_mutex_unlock(&acl_cache->lock); + mysql_rwlock_unlock(&LOCK_grant); my_eof(thd); DBUG_RETURN(error); @@ -5157,14 +5095,14 @@ void get_mqh(const char *user, const char *host, USER_CONN *uc) { ACL_USER *acl_user; - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); if (initialized && (acl_user= find_acl_user(host,user, FALSE))) uc->user_resources= acl_user->user_resource; else bzero((char*) &uc->user_resources, sizeof(uc->user_resources)); - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); } /* @@ -5250,7 +5188,7 @@ ACL_USER *check_acl_user(LEX_USER *user_name, ACL_USER *acl_user= 0; uint counter; - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); for (counter= 0 ; counter < acl_users.elements ; counter++) { @@ -5519,7 +5457,7 @@ static int handle_grant_struct(uint struct_no, bool drop, LINT_INIT(user); LINT_INIT(host); - safe_mutex_assert_owner(&acl_cache->lock); + mysql_mutex_assert_owner(&acl_cache->lock); /* Get the number of elements in the in-memory structure. */ switch (struct_no) { @@ -5829,8 +5767,8 @@ bool mysql_create_user(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) DBUG_RETURN(result != 1); - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); while ((tmp_user_name= user_list++)) { @@ -5860,7 +5798,7 @@ bool mysql_create_user(THD *thd, List &list) } } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); if (result) my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr_safe()); @@ -5868,7 +5806,7 @@ bool mysql_create_user(THD *thd, List &list) if (some_users_created) result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); DBUG_RETURN(result); } @@ -5911,8 +5849,8 @@ bool mysql_drop_user(THD *thd, List &list) thd->variables.sql_mode&= ~MODE_PAD_CHAR_TO_FULL_LENGTH; - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); while ((tmp_user_name= user_list++)) { @@ -5933,7 +5871,7 @@ bool mysql_drop_user(THD *thd, List &list) /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ rebuild_check_host(); - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); if (result) my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr_safe()); @@ -5941,7 +5879,7 @@ bool mysql_drop_user(THD *thd, List &list) if (some_users_deleted) result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); thd->variables.sql_mode= old_sql_mode; DBUG_RETURN(result); @@ -5983,8 +5921,8 @@ bool mysql_rename_user(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) DBUG_RETURN(result != 1); - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); while ((tmp_user_from= user_list++)) { @@ -6018,7 +5956,7 @@ bool mysql_rename_user(THD *thd, List &list) /* Rebuild 'acl_check_hosts' since 'acl_users' has been modified */ rebuild_check_host(); - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); if (result) my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr_safe()); @@ -6026,7 +5964,7 @@ bool mysql_rename_user(THD *thd, List &list) if (some_users_renamed && mysql_bin_log.is_open()) result |= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); DBUG_RETURN(result); } @@ -6064,8 +6002,8 @@ bool mysql_revoke_all(THD *thd, List &list) if ((result= open_grant_tables(thd, tables))) DBUG_RETURN(result != 1); - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); LEX_USER *lex_user, *tmp_lex_user; List_iterator user_list(list); @@ -6204,12 +6142,12 @@ bool mysql_revoke_all(THD *thd, List &list) } while (revoked); } - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); int binlog_error= write_bin_log(thd, FALSE, thd->query(), thd->query_length()); - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); /* error for writing binary log has already been reported */ @@ -6314,8 +6252,8 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, /* Be sure to pop this before exiting this scope! */ thd->push_internal_handler(&error_handler); - rw_wrlock(&LOCK_grant); - pthread_mutex_lock(&acl_cache->lock); + mysql_rwlock_wrlock(&LOCK_grant); + mysql_mutex_lock(&acl_cache->lock); /* This statement will be replicated as a statement, even when using @@ -6353,8 +6291,8 @@ bool sp_revoke_privileges(THD *thd, const char *sp_db, const char *sp_name, } } while (revoked); - pthread_mutex_unlock(&acl_cache->lock); - rw_unlock(&LOCK_grant); + mysql_mutex_unlock(&acl_cache->lock); + mysql_rwlock_unlock(&LOCK_grant); close_thread_tables(thd); thd->pop_internal_handler(); @@ -6394,7 +6332,7 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, combo->user.str= sctx->user; - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); if ((au= find_acl_user(combo->host.str=(char*)sctx->host_or_ip,combo->user.str,FALSE))) goto found_acl; @@ -6405,11 +6343,11 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, if((au= find_acl_user(combo->host.str=(char*)"%", combo->user.str, FALSE))) goto found_acl; - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_RETURN(TRUE); found_acl: - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); bzero((char*)tables, sizeof(TABLE_LIST)); user_list.empty(); @@ -6562,13 +6500,14 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond) ulong want_access; char buff[100]; TABLE *table= tables->table; - bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); + bool no_global_access= check_access(thd, SELECT_ACL, "mysql", + NULL, NULL, 1, 1); char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_user_privileges"); if (!initialized) DBUG_RETURN(0); - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); for (counter=0 ; counter < acl_users.elements ; counter++) { @@ -6618,7 +6557,7 @@ int fill_schema_user_privileges(THD *thd, TABLE_LIST *tables, COND *cond) } } err: - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_RETURN(error); #else @@ -6636,13 +6575,14 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond) ulong want_access; char buff[100]; TABLE *table= tables->table; - bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); + bool no_global_access= check_access(thd, SELECT_ACL, "mysql", + NULL, NULL, 1, 1); char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_schema_privileges"); if (!initialized) DBUG_RETURN(0); - pthread_mutex_lock(&acl_cache->lock); + mysql_mutex_lock(&acl_cache->lock); for (counter=0 ; counter < acl_dbs.elements ; counter++) { @@ -6695,7 +6635,7 @@ int fill_schema_schema_privileges(THD *thd, TABLE_LIST *tables, COND *cond) } } err: - pthread_mutex_unlock(&acl_cache->lock); + mysql_mutex_unlock(&acl_cache->lock); DBUG_RETURN(error); #else @@ -6711,11 +6651,12 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond) uint index; char buff[100]; TABLE *table= tables->table; - bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); + bool no_global_access= check_access(thd, SELECT_ACL, "mysql", + NULL, NULL, 1, 1); char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_table_privileges"); - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); for (index=0 ; index < column_priv_hash.records ; index++) { @@ -6778,7 +6719,7 @@ int fill_schema_table_privileges(THD *thd, TABLE_LIST *tables, COND *cond) } } err: - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); DBUG_RETURN(error); #else @@ -6794,11 +6735,12 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) uint index; char buff[100]; TABLE *table= tables->table; - bool no_global_access= check_access(thd, SELECT_ACL, "mysql",0,1,1,0); + bool no_global_access= check_access(thd, SELECT_ACL, "mysql", + NULL, NULL, 1, 1); char *curr_host= thd->security_ctx->priv_host_name(); DBUG_ENTER("fill_schema_table_privileges"); - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); for (index=0 ; index < column_priv_hash.records ; index++) { @@ -6859,7 +6801,7 @@ int fill_schema_column_privileges(THD *thd, TABLE_LIST *tables, COND *cond) } } err: - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); DBUG_RETURN(error); #else @@ -6911,7 +6853,7 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, grant->privilege|= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, 0); /* table privileges */ - rw_rdlock(&LOCK_grant); + mysql_rwlock_rdlock(&LOCK_grant); if (grant->version != grant_version) { grant->grant_table= @@ -6924,7 +6866,7 @@ void fill_effective_table_privileges(THD *thd, GRANT_INFO *grant, { grant->privilege|= grant->grant_table->privs; } - rw_unlock(&LOCK_grant); + mysql_rwlock_unlock(&LOCK_grant); DBUG_PRINT("info", ("privilege 0x%lx", grant->privilege)); DBUG_VOID_RETURN; @@ -6943,3 +6885,104 @@ bool check_routine_level_acl(THD *thd, const char *db, const char *name, } #endif + +struct ACL_internal_schema_registry_entry +{ + const LEX_STRING *m_name; + const ACL_internal_schema_access *m_access; +}; + +/** + Internal schema registered. + Currently, this is only: + - performance_schema + - information_schema, + This can be reused later for: + - mysql +*/ +static ACL_internal_schema_registry_entry registry_array[2]; +static uint m_registry_array_size= 0; + +/** + Add an internal schema to the registry. + @param name the schema name + @param access the schema ACL specific rules +*/ +void ACL_internal_schema_registry::register_schema + (const LEX_STRING *name, const ACL_internal_schema_access *access) +{ + DBUG_ASSERT(m_registry_array_size < array_elements(registry_array)); + + /* Not thread safe, and does not need to be. */ + registry_array[m_registry_array_size].m_name= name; + registry_array[m_registry_array_size].m_access= access; + m_registry_array_size++; +} + +/** + Search per internal schema ACL by name. + @param name a schema name + @return per schema rules, or NULL +*/ +const ACL_internal_schema_access * +ACL_internal_schema_registry::lookup(const char *name) +{ + DBUG_ASSERT(name != NULL); + + uint i; + + for (i= 0; istr, + name) == 0) + return registry_array[i].m_access; + } + return NULL; +} + +/** + Get a cached internal schema access. + @param grant_internal_info the cache + @param schema_name the name of the internal schema +*/ +const ACL_internal_schema_access * +get_cached_schema_access(GRANT_INTERNAL_INFO *grant_internal_info, + const char *schema_name) +{ + if (grant_internal_info) + { + if (! grant_internal_info->m_schema_lookup_done) + { + grant_internal_info->m_schema_access= + ACL_internal_schema_registry::lookup(schema_name); + grant_internal_info->m_schema_lookup_done= TRUE; + } + return grant_internal_info->m_schema_access; + } + return ACL_internal_schema_registry::lookup(schema_name); +} + +/** + Get a cached internal table access. + @param grant_internal_info the cache + @param schema_name the name of the internal schema + @param table_name the name of the internal table +*/ +const ACL_internal_table_access * +get_cached_table_access(GRANT_INTERNAL_INFO *grant_internal_info, + const char *schema_name, + const char *table_name) +{ + DBUG_ASSERT(grant_internal_info); + if (! grant_internal_info->m_table_lookup_done) + { + const ACL_internal_schema_access *schema_access; + schema_access= get_cached_schema_access(grant_internal_info, schema_name); + if (schema_access) + grant_internal_info->m_table_access= schema_access->lookup(table_name); + grant_internal_info->m_table_lookup_done= TRUE; + } + return grant_internal_info->m_table_access; +} + + diff --git a/sql/sql_acl.h b/sql/sql_acl.h index 59409299f73..8d521be2bc4 100644 --- a/sql/sql_acl.h +++ b/sql/sql_acl.h @@ -1,7 +1,7 @@ #ifndef SQL_ACL_INCLUDED #define SQL_ACL_INCLUDED -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -278,12 +278,139 @@ bool sp_grant_privileges(THD *thd, const char *sp_db, const char *sp_name, bool check_routine_level_acl(THD *thd, const char *db, const char *name, bool is_proc); bool is_acl_user(const char *host, const char *user); -bool has_any_table_level_privileges(THD *thd, ulong required_access, - TABLE_LIST *tables); #ifdef NO_EMBEDDED_ACCESS_CHECKS #define check_grant(A,B,C,D,E,F) 0 #define check_grant_db(A,B) 0 -#define has_any_table_level_privileges(A,B,C) 0 #endif + +/** + Result of an access check for an internal schema or table. + Internal ACL checks are always performed *before* using + the grant tables. + This mechanism enforces that the server implementation has full + control on its internal tables. + Depending on the internal check result, the server implementation + can choose to: + - always allow access, + - always deny access, + - delegate the decision to the database administrator, + by using the grant tables. +*/ +enum ACL_internal_access_result +{ + /** + Access granted for all the requested privileges, + do not use the grant tables. + This flag is used only for the INFORMATION_SCHEMA privileges, + for compatibility reasons. + */ + ACL_INTERNAL_ACCESS_GRANTED, + /** Access denied, do not use the grant tables. */ + ACL_INTERNAL_ACCESS_DENIED, + /** No decision yet, use the grant tables. */ + ACL_INTERNAL_ACCESS_CHECK_GRANT +}; + +/** + Per internal table ACL access rules. + This class is an interface. + Per table(s) specific access rule should be implemented in a subclass. + @sa ACL_internal_schema_access +*/ +class ACL_internal_table_access +{ +public: + ACL_internal_table_access() + {} + + virtual ~ACL_internal_table_access() + {} + + /** + Check access to an internal table. + When a privilege is granted, this method add the requested privilege + to save_priv. + @param want_access the privileges requested + @param [in, out] save_priv the privileges granted + @return + @retval ACL_INTERNAL_ACCESS_GRANTED All the requested privileges + are granted, and saved in save_priv. + @retval ACL_INTERNAL_ACCESS_DENIED At least one of the requested + privileges was denied. + @retval ACL_INTERNAL_ACCESS_CHECK_GRANT No requested privilege + was denied, and grant should be checked for at least one + privilege. Requested privileges that are granted, if any, are saved + in save_priv. + */ + virtual ACL_internal_access_result check(ulong want_access, + ulong *save_priv) const= 0; +}; + +/** + Per internal schema ACL access rules. + This class is an interface. + Each per schema specific access rule should be implemented + in a different subclass, and registered. + Per schema access rules can control: + - every schema privileges on schema.* + - every table privileges on schema.table + @sa ACL_internal_schema_registry +*/ +class ACL_internal_schema_access +{ +public: + ACL_internal_schema_access() + {} + + virtual ~ACL_internal_schema_access() + {} + + /** + Check access to an internal schema. + @param want_access the privileges requested + @param [in, out] save_priv the privileges granted + @return + @retval ACL_INTERNAL_ACCESS_GRANTED All the requested privileges + are granted, and saved in save_priv. + @retval ACL_INTERNAL_ACCESS_DENIED At least one of the requested + privileges was denied. + @retval ACL_INTERNAL_ACCESS_CHECK_GRANT No requested privilege + was denied, and grant should be checked for at least one + privilege. Requested privileges that are granted, if any, are saved + in save_priv. + */ + virtual ACL_internal_access_result check(ulong want_access, + ulong *save_priv) const= 0; + + /** + Search for per table ACL access rules by table name. + @param name the table name + @return per table access rules, or NULL + */ + virtual const ACL_internal_table_access *lookup(const char *name) const= 0; +}; + +/** + A registry for per internal schema ACL. + An 'internal schema' is a database schema maintained by the + server implementation, such as 'performance_schema' and 'INFORMATION_SCHEMA'. +*/ +class ACL_internal_schema_registry +{ +public: + static void register_schema(const LEX_STRING *name, + const ACL_internal_schema_access *access); + static const ACL_internal_schema_access *lookup(const char *name); +}; + +const ACL_internal_schema_access * +get_cached_schema_access(GRANT_INTERNAL_INFO *grant_internal_info, + const char *schema_name); + +const ACL_internal_table_access * +get_cached_table_access(GRANT_INTERNAL_INFO *grant_internal_info, + const char *schema_name, + const char *table_name); + #endif /* SQL_ACL_INCLUDED */ diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 348f4305b02..a287fd533b7 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -100,7 +100,7 @@ TABLE *unused_tables; /* Used by mysql_test */ HASH open_cache; /* Used by mysql_test */ static HASH table_def_cache; static TABLE_SHARE *oldest_unused_share, end_of_unused_share; -static pthread_mutex_t LOCK_table_share; +static mysql_mutex_t LOCK_table_share; static bool table_def_inited= 0; static int open_unireg_entry(THD *thd, TABLE *entry, TABLE_LIST *table_list, @@ -272,10 +272,10 @@ static void table_def_free_entry(TABLE_SHARE *share) if (share->prev) { /* remove from old_unused_share list */ - pthread_mutex_lock(&LOCK_table_share); + mysql_mutex_lock(&LOCK_table_share); *share->prev= share->next; share->next->prev= share->prev; - pthread_mutex_unlock(&LOCK_table_share); + mysql_mutex_unlock(&LOCK_table_share); } free_table_share(share); DBUG_VOID_RETURN; @@ -285,7 +285,7 @@ static void table_def_free_entry(TABLE_SHARE *share) bool table_def_init(void) { table_def_inited= 1; - pthread_mutex_init(&LOCK_table_share, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_table_share, &LOCK_table_share, MY_MUTEX_INIT_FAST); oldest_unused_share= &end_of_unused_share; end_of_unused_share.prev= &oldest_unused_share; @@ -301,7 +301,7 @@ void table_def_free(void) if (table_def_inited) { table_def_inited= 0; - pthread_mutex_destroy(&LOCK_table_share); + mysql_mutex_destroy(&LOCK_table_share); my_hash_free(&table_def_cache); } DBUG_VOID_RETURN; @@ -361,7 +361,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key, Lock mutex to be able to read table definition from file without conflicts */ - (void) pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); /* We assign a new table id under the protection of the LOCK_open and @@ -392,7 +392,7 @@ TABLE_SHARE *get_table_share(THD *thd, TABLE_LIST *table_list, char *key, share->ref_count++; // Mark in use DBUG_PRINT("exit", ("share: 0x%lx ref_count: %u", (ulong) share, share->ref_count)); - (void) pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); DBUG_RETURN(share); found: @@ -402,18 +402,18 @@ found: */ /* We must do a lock to ensure that the structure is initialized */ - (void) pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); if (share->error) { /* Table definition contained an error */ open_table_error(share, share->error, share->open_errno, share->errarg); - (void) pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); DBUG_RETURN(0); } if (share->is_view && !(db_flags & OPEN_VIEW)) { open_table_error(share, 1, ENOENT, 0); - (void) pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); DBUG_RETURN(0); } @@ -424,20 +424,20 @@ found: Unlink share from this list */ DBUG_PRINT("info", ("Unlinking from not used list")); - pthread_mutex_lock(&LOCK_table_share); + mysql_mutex_lock(&LOCK_table_share); *share->prev= share->next; share->next->prev= share->prev; share->next= 0; share->prev= 0; - pthread_mutex_unlock(&LOCK_table_share); + mysql_mutex_unlock(&LOCK_table_share); } - (void) pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); /* Free cache if too big */ while (table_def_cache.records > table_def_size && oldest_unused_share->next) { - pthread_mutex_lock(&oldest_unused_share->mutex); + mysql_mutex_lock(&oldest_unused_share->mutex); my_hash_delete(&table_def_cache, (uchar*) oldest_unused_share); } @@ -568,7 +568,7 @@ void release_table_share(TABLE_SHARE *share, enum release_type type) mysql_mutex_assert_owner(&LOCK_open); - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); if (!--share->ref_count) { if (share->version != refresh_version) @@ -579,12 +579,12 @@ void release_table_share(TABLE_SHARE *share, enum release_type type) DBUG_PRINT("info",("moving share to unused list")); DBUG_ASSERT(share->next == 0); - pthread_mutex_lock(&LOCK_table_share); + mysql_mutex_lock(&LOCK_table_share); share->prev= end_of_unused_share.prev; *end_of_unused_share.prev= share; end_of_unused_share.prev= &share->next; share->next= &end_of_unused_share; - pthread_mutex_unlock(&LOCK_table_share); + mysql_mutex_unlock(&LOCK_table_share); to_be_deleted= (table_def_cache.records > table_def_size); } @@ -596,7 +596,7 @@ void release_table_share(TABLE_SHARE *share, enum release_type type) my_hash_delete(&table_def_cache, (uchar*) share); DBUG_VOID_RETURN; } - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); DBUG_VOID_RETURN; } @@ -880,7 +880,7 @@ bool close_cached_tables(THD *thd, TABLE_LIST *tables, bool have_lock, /* Free table shares */ while (oldest_unused_share->next) { - pthread_mutex_lock(&oldest_unused_share->mutex); + mysql_mutex_lock(&oldest_unused_share->mutex); (void) my_hash_delete(&table_def_cache, (uchar*) oldest_unused_share); } DBUG_PRINT("tcache", ("incremented global refresh_version to: %lu", @@ -2866,7 +2866,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root, */ if (table->in_use != thd) { - /* wait_for_conditionwill unlock LOCK_open for us */ + /* wait_for_condition will unlock LOCK_open for us */ wait_for_condition(thd, &LOCK_open, &COND_refresh); } else @@ -4459,6 +4459,7 @@ thr_lock_type read_lock_type_for_table(THD *thd, TABLE *table) bool log_on= mysql_bin_log.is_open() && (thd->variables.option_bits & OPTION_BIN_LOG); ulong binlog_format= thd->variables.binlog_format; if ((log_on == FALSE) || (binlog_format == BINLOG_FORMAT_ROW) || + (table->s->table_category == TABLE_CATEGORY_LOG) || (table->s->table_category == TABLE_CATEGORY_PERFORMANCE)) return TL_READ; else @@ -5168,9 +5169,12 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables) void* prev_ht= NULL; for (TABLE_LIST *table= tables; table; table= table->next_global) { + TABLE_CATEGORY category; if (table->placeholder()) continue; - if (table->table->s->table_category == TABLE_CATEGORY_PERFORMANCE) + category= table->table->s->table_category; + if ((category == TABLE_CATEGORY_LOG) || + (category == TABLE_CATEGORY_PERFORMANCE)) thd->lex->set_stmt_unsafe(); if (table->lock_type >= TL_WRITE_ALLOW_WRITE) { @@ -5595,7 +5599,7 @@ bool rm_temporary_table(handlerton *base, char *path) DBUG_ENTER("rm_temporary_table"); strmov(ext= strend(path), reg_ext); - if (my_delete(path,MYF(0))) + if (mysql_file_delete(key_file_frm, path, MYF(0))) error=1; /* purecov: inspected */ *ext= 0; // remove extension file= get_new_handler((TABLE_SHARE*) 0, current_thd->mem_root, base); @@ -8384,7 +8388,7 @@ my_bool mysql_rm_tmp_tables(void) So we hide error messages which happnes during deleting of these files(MYF(0)). */ - (void) my_delete(filePath, MYF(0)); + (void) mysql_file_delete(key_file_misc, filePath, MYF(0)); } } my_dirend(dirp); @@ -8562,7 +8566,7 @@ bool remove_table_from_cache(THD *thd, const char *db, const char *table_name, share->version= 0; // Mark for delete if (share->ref_count == 0) { - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); my_hash_delete(&table_def_cache, (uchar*) share); } } @@ -9021,19 +9025,18 @@ open_system_table_for_update(THD *thd, TABLE_LIST *one_table) } /** - Open a performance schema table. + Open a log table. Opening such tables is performed internally in the server implementation, and is a 'nested' open, since some tables might be already opened by the current thread. The thread context before this call is saved, and is restored - when calling close_performance_schema_table(). + when calling close_log_table(). @param thd The current thread - @param one_table Performance schema table to open + @param one_table Log table to open @param backup [out] Temporary storage used to save the thread context */ TABLE * -open_performance_schema_table(THD *thd, TABLE_LIST *one_table, - Open_tables_state *backup) +open_log_table(THD *thd, TABLE_LIST *one_table, Open_tables_state *backup) { uint flags= ( MYSQL_LOCK_IGNORE_GLOBAL_READ_LOCK | MYSQL_LOCK_IGNORE_GLOBAL_READ_ONLY | @@ -9042,13 +9045,13 @@ open_performance_schema_table(THD *thd, TABLE_LIST *one_table, TABLE *table; /* Save value that is changed in mysql_lock_tables() */ ulonglong save_utime_after_lock= thd->utime_after_lock; - DBUG_ENTER("open_performance_schema_table"); + DBUG_ENTER("open_log_table"); thd->reset_n_backup_open_tables_state(backup); if ((table= open_ltable(thd, one_table, one_table->lock_type, flags))) { - DBUG_ASSERT(table->s->table_category == TABLE_CATEGORY_PERFORMANCE); + DBUG_ASSERT(table->s->table_category == TABLE_CATEGORY_LOG); /* Make sure all columns get assigned to a default value */ table->use_all_columns(); table->no_replicate= 1; @@ -9076,18 +9079,18 @@ open_performance_schema_table(THD *thd, TABLE_LIST *one_table, } /** - Close a performance schema table. - The last table opened by open_performance_schema_table() + Close a log table. + The last table opened by open_log_table() is closed, then the thread context is restored. @param thd The current thread @param backup [in] the context to restore. */ -void close_performance_schema_table(THD *thd, Open_tables_state *backup) +void close_log_table(THD *thd, Open_tables_state *backup) { bool found_old_table; /* - If open_performance_schema_table() fails, + If open_log_table() fails, this function should not be called. */ DBUG_ASSERT(thd->lock != NULL); diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc index 07d36b1551a..0fd8d6e9b0f 100644 --- a/sql/sql_cache.cc +++ b/sql/sql_cache.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -341,18 +341,14 @@ TODO list: #endif #if !defined(EXTRA_DBUG) && !defined(DBUG_OFF) -#define MUTEX_LOCK(M) { DBUG_PRINT("lock", ("mutex lock 0x%lx", (ulong)(M))); \ - pthread_mutex_lock(M);} -#define MUTEX_UNLOCK(M) {DBUG_PRINT("lock", ("mutex unlock 0x%lx",\ - (ulong)(M))); pthread_mutex_unlock(M);} #define RW_WLOCK(M) {DBUG_PRINT("lock", ("rwlock wlock 0x%lx",(ulong)(M))); \ - if (!rw_wrlock(M)) DBUG_PRINT("lock", ("rwlock wlock ok")); \ + if (!mysql_rwlock_wrlock(M)) DBUG_PRINT("lock", ("rwlock wlock ok")); \ else DBUG_PRINT("lock", ("rwlock wlock FAILED %d", errno)); } #define RW_RLOCK(M) {DBUG_PRINT("lock", ("rwlock rlock 0x%lx", (ulong)(M))); \ - if (!rw_rdlock(M)) DBUG_PRINT("lock", ("rwlock rlock ok")); \ + if (!mysql_rwlock_rdlock(M)) DBUG_PRINT("lock", ("rwlock rlock ok")); \ else DBUG_PRINT("lock", ("rwlock wlock FAILED %d", errno)); } #define RW_UNLOCK(M) {DBUG_PRINT("lock", ("rwlock unlock 0x%lx",(ulong)(M))); \ - if (!rw_unlock(M)) DBUG_PRINT("lock", ("rwlock unlock ok")); \ + if (!mysql_rwlock_unlock(M)) DBUG_PRINT("lock", ("rwlock unlock ok")); \ else DBUG_PRINT("lock", ("rwlock unlock FAILED %d", errno)); } #define BLOCK_LOCK_WR(B) {DBUG_PRINT("lock", ("%d LOCK_WR 0x%lx",\ __LINE__,(ulong)(B))); \ @@ -395,11 +391,9 @@ static void debug_wait_for_kill(const char *info) } #else -#define MUTEX_LOCK(M) pthread_mutex_lock(M) -#define MUTEX_UNLOCK(M) pthread_mutex_unlock(M) -#define RW_WLOCK(M) rw_wrlock(M) -#define RW_RLOCK(M) rw_rdlock(M) -#define RW_UNLOCK(M) rw_unlock(M) +#define RW_WLOCK(M) mysql_rwlock_wrlock(M) +#define RW_RLOCK(M) mysql_rwlock_rdlock(M) +#define RW_UNLOCK(M) mysql_rwlock_unlock(M) #define BLOCK_LOCK_WR(B) B->query()->lock_writing() #define BLOCK_LOCK_RD(B) B->query()->lock_reading() #define BLOCK_UNLOCK_WR(B) B->query()->unlock_writing() @@ -430,7 +424,7 @@ bool Query_cache::try_lock(bool use_timeout) bool interrupt= FALSE; DBUG_ENTER("Query_cache::try_lock"); - pthread_mutex_lock(&structure_guard_mutex); + mysql_mutex_lock(&structure_guard_mutex); while (1) { if (m_cache_lock_status == Query_cache::UNLOCKED) @@ -463,8 +457,8 @@ bool Query_cache::try_lock(bool use_timeout) { struct timespec waittime; set_timespec_nsec(waittime,(ulong)(50000000L)); /* Wait for 50 msec */ - int res= pthread_cond_timedwait(&COND_cache_status_changed, - &structure_guard_mutex,&waittime); + int res= mysql_cond_timedwait(&COND_cache_status_changed, + &structure_guard_mutex, &waittime); if (res == ETIMEDOUT) { interrupt= TRUE; @@ -473,11 +467,11 @@ bool Query_cache::try_lock(bool use_timeout) } else { - pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); + mysql_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); } } } - pthread_mutex_unlock(&structure_guard_mutex); + mysql_mutex_unlock(&structure_guard_mutex); DBUG_RETURN(interrupt); } @@ -498,9 +492,9 @@ void Query_cache::lock_and_suspend(void) { DBUG_ENTER("Query_cache::lock_and_suspend"); - pthread_mutex_lock(&structure_guard_mutex); + mysql_mutex_lock(&structure_guard_mutex); while (m_cache_lock_status != Query_cache::UNLOCKED) - pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); + mysql_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); m_cache_lock_status= Query_cache::LOCKED_NO_WAIT; #ifndef DBUG_OFF THD *thd= current_thd; @@ -508,8 +502,8 @@ void Query_cache::lock_and_suspend(void) m_cache_lock_thread_id= thd->thread_id; #endif /* Wake up everybody, a whole cache flush is starting! */ - pthread_cond_broadcast(&COND_cache_status_changed); - pthread_mutex_unlock(&structure_guard_mutex); + mysql_cond_broadcast(&COND_cache_status_changed); + mysql_mutex_unlock(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -526,16 +520,16 @@ void Query_cache::lock(void) { DBUG_ENTER("Query_cache::lock"); - pthread_mutex_lock(&structure_guard_mutex); + mysql_mutex_lock(&structure_guard_mutex); while (m_cache_lock_status != Query_cache::UNLOCKED) - pthread_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); + mysql_cond_wait(&COND_cache_status_changed, &structure_guard_mutex); m_cache_lock_status= Query_cache::LOCKED; #ifndef DBUG_OFF THD *thd= current_thd; if (thd) m_cache_lock_thread_id= thd->thread_id; #endif - pthread_mutex_unlock(&structure_guard_mutex); + mysql_mutex_unlock(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -548,7 +542,7 @@ void Query_cache::lock(void) void Query_cache::unlock(void) { DBUG_ENTER("Query_cache::unlock"); - pthread_mutex_lock(&structure_guard_mutex); + mysql_mutex_lock(&structure_guard_mutex); #ifndef DBUG_OFF THD *thd= current_thd; if (thd) @@ -558,8 +552,8 @@ void Query_cache::unlock(void) m_cache_lock_status == Query_cache::LOCKED_NO_WAIT); m_cache_lock_status= Query_cache::UNLOCKED; DBUG_PRINT("Query_cache",("Sending signal")); - pthread_cond_signal(&COND_cache_status_changed); - pthread_mutex_unlock(&structure_guard_mutex); + mysql_cond_signal(&COND_cache_status_changed); + mysql_mutex_unlock(&structure_guard_mutex); DBUG_VOID_RETURN; } @@ -728,7 +722,7 @@ inline void Query_cache_query::lock_writing() my_bool Query_cache_query::try_lock_writing() { DBUG_ENTER("Query_cache_block::try_lock_writing"); - if (rw_trywrlock(&lock)!=0) + if (mysql_rwlock_trywrlock(&lock) != 0) { DBUG_PRINT("info", ("can't lock rwlock")); DBUG_RETURN(0); @@ -760,7 +754,7 @@ void Query_cache_query::init_n_lock() { DBUG_ENTER("Query_cache_query::init_n_lock"); res=0; wri = 0; len = 0; - my_rwlock_init(&lock, NULL); + mysql_rwlock_init(key_rwlock_query_cache_query_lock, &lock); lock_writing(); DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx", (long) (((uchar*) this) - @@ -780,7 +774,7 @@ void Query_cache_query::unlock_n_destroy() active semaphore */ this->unlock_writing(); - rwlock_destroy(&lock); + mysql_rwlock_destroy(&lock); DBUG_VOID_RETURN; } @@ -1984,8 +1978,8 @@ void Query_cache::destroy() free_cache(); unlock(); - pthread_cond_destroy(&COND_cache_status_changed); - pthread_mutex_destroy(&structure_guard_mutex); + mysql_cond_destroy(&COND_cache_status_changed); + mysql_mutex_destroy(&structure_guard_mutex); initialized = 0; } DBUG_VOID_RETURN; @@ -1999,8 +1993,10 @@ void Query_cache::destroy() void Query_cache::init() { DBUG_ENTER("Query_cache::init"); - pthread_mutex_init(&structure_guard_mutex,MY_MUTEX_INIT_FAST); - pthread_cond_init(&COND_cache_status_changed, NULL); + mysql_mutex_init(key_structure_guard_mutex, + &structure_guard_mutex, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_COND_cache_status_changed, + &COND_cache_status_changed, NULL); m_cache_lock_status= Query_cache::UNLOCKED; initialized = 1; /* @@ -3846,7 +3842,7 @@ my_bool Query_cache::move_by_type(uchar **border, } while ( result_block != first_result_block ); } Query_cache_query *new_query= ((Query_cache_query *) new_block->data()); - my_rwlock_init(&new_query->lock, NULL); + mysql_rwlock_init(key_rwlock_query_cache_query_lock, &new_query->lock); /* If someone is writing to this block, inform the writer that the block diff --git a/sql/sql_cache.h b/sql/sql_cache.h index 33e535b2580..9d1f32d6ef1 100644 --- a/sql/sql_cache.h +++ b/sql/sql_cache.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2006 MySQL AB +/* Copyright (C) 2001-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -137,7 +137,7 @@ struct Query_cache_block struct Query_cache_query { ulonglong limit_found_rows; - rw_lock_t lock; + mysql_rwlock_t lock; Query_cache_block *res; Query_cache_tls *wri; ulong len; @@ -277,7 +277,7 @@ private: #ifndef DBUG_OFF my_thread_id m_cache_lock_thread_id; #endif - pthread_cond_t COND_cache_status_changed; + mysql_cond_t COND_cache_status_changed; enum Cache_lock_status { UNLOCKED, LOCKED_NO_WAIT, LOCKED }; Cache_lock_status m_cache_lock_status; @@ -302,7 +302,7 @@ protected: is other threads that were going to do cache flush---they'll wait till the end of a flush operation. */ - pthread_mutex_t structure_guard_mutex; + mysql_mutex_t structure_guard_mutex; uchar *cache; // cache memory Query_cache_block *first_block; // physical location block list Query_cache_block *queries_blocks; // query list (LIFO) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 53a96f8b9d9..2a82b0058da 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -268,8 +268,8 @@ const char *set_thd_proc_info(THD *thd, const char *info, } extern "C" -const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond, - pthread_mutex_t *mutex, const char *msg) +const char* thd_enter_cond(MYSQL_THD thd, mysql_cond_t *cond, + mysql_mutex_t *mutex, const char *msg) { if (!thd) thd= current_thd; @@ -385,7 +385,7 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, str.append(proc_info); } - pthread_mutex_lock(&thd->LOCK_thd_data); + mysql_mutex_lock(&thd->LOCK_thd_data); if (thd->query()) { @@ -397,7 +397,7 @@ char *thd_security_context(THD *thd, char *buffer, unsigned int length, str.append(thd->query(), len); } - pthread_mutex_unlock(&thd->LOCK_thd_data); + mysql_mutex_unlock(&thd->LOCK_thd_data); if (str.c_ptr_safe() == buffer) return buffer; @@ -536,7 +536,7 @@ THD::THD() #ifdef SIGNAL_WITH_VIO_CLOSE active_vio = 0; #endif - pthread_mutex_init(&LOCK_thd_data, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_thd_data, &LOCK_thd_data, MY_MUTEX_INIT_FAST); /* Variables with default values */ proc_info="login"; @@ -885,7 +885,7 @@ extern "C" THD *_current_thd_noinline(void) void THD::init(void) { - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); plugin_thdvar_init(this); /* variables= global_system_variables above has reset @@ -893,7 +893,7 @@ void THD::init(void) avoid temporary tables replication failure. */ variables.pseudo_thread_id= thread_id; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); server_status= SERVER_STATUS_AUTOCOMMIT; if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; @@ -1023,8 +1023,8 @@ THD::~THD() THD_CHECK_SENTRY(this); DBUG_ENTER("~THD()"); /* Ensure that no one is using THD */ - pthread_mutex_lock(&LOCK_thd_data); - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); add_to_status(&global_status_var, &status_var); /* Close connection */ @@ -1048,7 +1048,7 @@ THD::~THD() safeFree(db); free_root(&transaction.mem_root,MYF(0)); mysys_var=0; // Safety (shouldn't be needed) - pthread_mutex_destroy(&LOCK_thd_data); + mysql_mutex_destroy(&LOCK_thd_data); #ifndef DBUG_OFF dbug_sentry= THD_SENTRY_GONE; #endif @@ -1121,7 +1121,7 @@ void THD::awake(THD::killed_state state_to_set) DBUG_ENTER("THD::awake"); DBUG_PRINT("enter", ("this: 0x%lx", (long) this)); THD_CHECK_SENTRY(this); - safe_mutex_assert_owner(&LOCK_thd_data); + mysql_mutex_assert_owner(&LOCK_thd_data); killed= state_to_set; if (state_to_set != THD::KILL_QUERY) @@ -1524,7 +1524,7 @@ int THD::send_explain_fields(select_result *result) void THD::close_active_vio() { DBUG_ENTER("close_active_vio"); - safe_mutex_assert_owner(&LOCK_thd_data); + mysql_mutex_assert_owner(&LOCK_thd_data); #ifndef EMBEDDED_LIBRARY if (active_vio) { @@ -1756,8 +1756,9 @@ void select_to_file::send_error(uint errcode,const char *err) if (file > 0) { (void) end_io_cache(&cache); - (void) my_close(file,MYF(0)); - (void) my_delete(path,MYF(0)); // Delete file on error + mysql_file_close(file, MYF(0)); + /* Delete file on error */ + mysql_file_delete(key_select_to_file, path, MYF(0)); file= -1; } } @@ -1766,7 +1767,7 @@ void select_to_file::send_error(uint errcode,const char *err) bool select_to_file::send_eof() { int error= test(end_io_cache(&cache)); - if (my_close(file,MYF(MY_WME))) + if (mysql_file_close(file, MYF(MY_WME))) error= 1; if (!error) { @@ -1788,7 +1789,7 @@ void select_to_file::cleanup() if (file >= 0) { (void) end_io_cache(&cache); - (void) my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); file= -1; } path[0]= '\0'; @@ -1801,7 +1802,7 @@ select_to_file::~select_to_file() if (file >= 0) { // This only happens in case of error (void) end_io_cache(&cache); - (void) my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); file= -1; } } @@ -1865,7 +1866,8 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange, return -1; } /* Create the file world readable */ - if ((file= my_create(path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) + if ((file= mysql_file_create(key_select_to_file, + path, 0666, O_WRONLY|O_EXCL, MYF(MY_WME))) < 0) return file; #ifdef HAVE_FCHMOD (void) fchmod(file, 0666); // Because of umask() @@ -1874,8 +1876,9 @@ static File create_file(THD *thd, char *path, sql_exchange *exchange, #endif if (init_io_cache(cache, file, 0L, WRITE_CACHE, 0L, 1, MYF(MY_WME))) { - my_close(file, MYF(0)); - my_delete(path, MYF(0)); // Delete file on error, it was just created + mysql_file_close(file, MYF(0)); + /* Delete file on error, it was just created */ + mysql_file_delete(key_select_to_file, path, MYF(0)); return -1; } return file; @@ -2668,7 +2671,7 @@ int Statement_map::insert(THD *thd, Statement *statement) my_error(ER_OUT_OF_RESOURCES, MYF(0)); goto err_names_hash; } - pthread_mutex_lock(&LOCK_prepared_stmt_count); + mysql_mutex_lock(&LOCK_prepared_stmt_count); /* We don't check that prepared_stmt_count is <= max_prepared_stmt_count because we would like to allow to lower the total limit @@ -2678,13 +2681,13 @@ int Statement_map::insert(THD *thd, Statement *statement) */ if (prepared_stmt_count >= max_prepared_stmt_count) { - pthread_mutex_unlock(&LOCK_prepared_stmt_count); + mysql_mutex_unlock(&LOCK_prepared_stmt_count); my_error(ER_MAX_PREPARED_STMT_COUNT_REACHED, MYF(0), max_prepared_stmt_count); goto err_max; } prepared_stmt_count++; - pthread_mutex_unlock(&LOCK_prepared_stmt_count); + mysql_mutex_unlock(&LOCK_prepared_stmt_count); last_found_statement= statement; return 0; @@ -2717,20 +2720,20 @@ void Statement_map::erase(Statement *statement) my_hash_delete(&names_hash, (uchar *) statement); my_hash_delete(&st_hash, (uchar *) statement); - pthread_mutex_lock(&LOCK_prepared_stmt_count); + mysql_mutex_lock(&LOCK_prepared_stmt_count); DBUG_ASSERT(prepared_stmt_count > 0); prepared_stmt_count--; - pthread_mutex_unlock(&LOCK_prepared_stmt_count); + mysql_mutex_unlock(&LOCK_prepared_stmt_count); } void Statement_map::reset() { /* Must be first, hash_free will reset st_hash.records */ - pthread_mutex_lock(&LOCK_prepared_stmt_count); + mysql_mutex_lock(&LOCK_prepared_stmt_count); DBUG_ASSERT(prepared_stmt_count >= st_hash.records); prepared_stmt_count-= st_hash.records; - pthread_mutex_unlock(&LOCK_prepared_stmt_count); + mysql_mutex_unlock(&LOCK_prepared_stmt_count); my_hash_reset(&names_hash); my_hash_reset(&st_hash); @@ -2741,10 +2744,10 @@ void Statement_map::reset() Statement_map::~Statement_map() { /* Must go first, hash_free will reset st_hash.records */ - pthread_mutex_lock(&LOCK_prepared_stmt_count); + mysql_mutex_lock(&LOCK_prepared_stmt_count); DBUG_ASSERT(prepared_stmt_count >= st_hash.records); prepared_stmt_count-= st_hash.records; - pthread_mutex_unlock(&LOCK_prepared_stmt_count); + mysql_mutex_unlock(&LOCK_prepared_stmt_count); my_hash_free(&names_hash); my_hash_free(&st_hash); @@ -3248,9 +3251,9 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup) void THD::set_statement(Statement *stmt) { - pthread_mutex_lock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); Statement::set_statement(stmt); - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); } @@ -3258,9 +3261,9 @@ void THD::set_statement(Statement *stmt) void THD::set_query(char *query_arg, uint32 query_length_arg) { - pthread_mutex_lock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); set_query_inner(query_arg, query_length_arg); - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); } /** Assign a new value to thd->query and thd->query_id. */ @@ -3268,19 +3271,19 @@ void THD::set_query(char *query_arg, uint32 query_length_arg) void THD::set_query_and_id(char *query_arg, uint32 query_length_arg, query_id_t new_query_id) { - pthread_mutex_lock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); set_query_inner(query_arg, query_length_arg); query_id= new_query_id; - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); } /** Assign a new value to thd->query_id. */ void THD::set_query_id(query_id_t new_query_id) { - pthread_mutex_lock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); query_id= new_query_id; - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); } @@ -3313,7 +3316,7 @@ void mark_transaction_to_rollback(THD *thd, bool all) Handling of XA id cacheing ***************************************************************************/ -pthread_mutex_t LOCK_xid_cache; +mysql_mutex_t LOCK_xid_cache; HASH xid_cache; extern "C" uchar *xid_get_hash_key(const uchar *, size_t *, my_bool); @@ -3332,9 +3335,34 @@ void xid_free_hash(void *ptr) my_free((uchar*)ptr, MYF(0)); } +#ifdef HAVE_PSI_INTERFACE +static PSI_mutex_key key_LOCK_xid_cache; + +static PSI_mutex_info all_xid_mutexes[]= +{ + { &key_LOCK_xid_cache, "LOCK_xid_cache", PSI_FLAG_GLOBAL} +}; + +static void init_xid_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_xid_mutexes); + PSI_server->register_mutex(category, all_xid_mutexes, count); +} +#endif /* HAVE_PSI_INTERFACE */ + bool xid_cache_init() { - pthread_mutex_init(&LOCK_xid_cache, MY_MUTEX_INIT_FAST); +#ifdef HAVE_PSI_INTERFACE + init_xid_psi_keys(); +#endif + + mysql_mutex_init(key_LOCK_xid_cache, &LOCK_xid_cache, MY_MUTEX_INIT_FAST); return my_hash_init(&xid_cache, &my_charset_bin, 100, 0, 0, xid_get_hash_key, xid_free_hash, 0) != 0; } @@ -3344,16 +3372,16 @@ void xid_cache_free() if (my_hash_inited(&xid_cache)) { my_hash_free(&xid_cache); - pthread_mutex_destroy(&LOCK_xid_cache); + mysql_mutex_destroy(&LOCK_xid_cache); } } XID_STATE *xid_cache_search(XID *xid) { - pthread_mutex_lock(&LOCK_xid_cache); + mysql_mutex_lock(&LOCK_xid_cache); XID_STATE *res=(XID_STATE *)my_hash_search(&xid_cache, xid->key(), xid->key_length()); - pthread_mutex_unlock(&LOCK_xid_cache); + mysql_mutex_unlock(&LOCK_xid_cache); return res; } @@ -3362,7 +3390,7 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state) { XID_STATE *xs; my_bool res; - pthread_mutex_lock(&LOCK_xid_cache); + mysql_mutex_lock(&LOCK_xid_cache); if (my_hash_search(&xid_cache, xid->key(), xid->key_length())) res=0; else if (!(xs=(XID_STATE *)my_malloc(sizeof(*xs), MYF(MY_WME)))) @@ -3374,27 +3402,27 @@ bool xid_cache_insert(XID *xid, enum xa_states xa_state) xs->in_thd=0; res=my_hash_insert(&xid_cache, (uchar*)xs); } - pthread_mutex_unlock(&LOCK_xid_cache); + mysql_mutex_unlock(&LOCK_xid_cache); return res; } bool xid_cache_insert(XID_STATE *xid_state) { - pthread_mutex_lock(&LOCK_xid_cache); + mysql_mutex_lock(&LOCK_xid_cache); DBUG_ASSERT(my_hash_search(&xid_cache, xid_state->xid.key(), xid_state->xid.key_length())==0); my_bool res=my_hash_insert(&xid_cache, (uchar*)xid_state); - pthread_mutex_unlock(&LOCK_xid_cache); + mysql_mutex_unlock(&LOCK_xid_cache); return res; } void xid_cache_delete(XID_STATE *xid_state) { - pthread_mutex_lock(&LOCK_xid_cache); + mysql_mutex_lock(&LOCK_xid_cache); my_hash_delete(&xid_cache, (uchar *)xid_state); - pthread_mutex_unlock(&LOCK_xid_cache); + mysql_mutex_unlock(&LOCK_xid_cache); } /* diff --git a/sql/sql_class.h b/sql/sql_class.h index 03f06e5aa26..b3cc1fc68c0 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -775,7 +775,7 @@ typedef struct st_xid_state { uint rm_error; } XID_STATE; -extern pthread_mutex_t LOCK_xid_cache; +extern mysql_mutex_t LOCK_xid_cache; extern HASH xid_cache; bool xid_cache_init(void); void xid_cache_free(void); @@ -1236,7 +1236,7 @@ public: - thd->mysys_var (used by KILL statement and shutdown). Is locked when THD is deleted. */ - pthread_mutex_t LOCK_thd_data; + mysql_mutex_t LOCK_thd_data; /* all prepared statements and cursors of this connection */ Statement_map stmt_map; @@ -1810,15 +1810,15 @@ public: #ifdef SIGNAL_WITH_VIO_CLOSE inline void set_active_vio(Vio* vio) { - pthread_mutex_lock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); active_vio = vio; - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); } inline void clear_active_vio() { - pthread_mutex_lock(&LOCK_thd_data); + mysql_mutex_lock(&LOCK_thd_data); active_vio = 0; - pthread_mutex_unlock(&LOCK_thd_data); + mysql_mutex_unlock(&LOCK_thd_data); } void close_active_vio(); #endif @@ -1865,12 +1865,6 @@ public: proc_info = msg; return old_msg; } - inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t *mutex, - const char *msg) - { - /* TO BE REMOVED: temporary helper, to help with merges */ - return enter_cond((mysql_cond_t*) cond, (mysql_mutex_t*) mutex, msg); - } inline void exit_cond(const char* old_msg) { /* diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index a966d4a6bd4..ccc176624ed 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 MySQL AB +/* Copyright (C) 2007 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ static int get_or_create_user_conn(THD *thd, const char *user, user_len= strlen(user); temp_len= (strmov(strmov(temp_user, user)+1, host) - temp_user)+1; - (void) pthread_mutex_lock(&LOCK_user_conn); + mysql_mutex_lock(&LOCK_user_conn); if (!(uc = (struct user_conn *) my_hash_search(&hash_user_connections, (uchar*) temp_user, temp_len))) { @@ -91,7 +91,7 @@ static int get_or_create_user_conn(THD *thd, const char *user, thd->user_connect=uc; uc->connections++; end: - (void) pthread_mutex_unlock(&LOCK_user_conn); + mysql_mutex_unlock(&LOCK_user_conn); return return_val; } @@ -120,7 +120,7 @@ int check_for_max_user_connections(THD *thd, USER_CONN *uc) int error=0; DBUG_ENTER("check_for_max_user_connections"); - (void) pthread_mutex_lock(&LOCK_user_conn); + mysql_mutex_lock(&LOCK_user_conn); if (global_system_variables.max_user_connections && !uc->user_resources.user_conn && global_system_variables.max_user_connections < (uint) uc->connections) @@ -161,7 +161,7 @@ end: */ thd->user_connect= NULL; } - (void) pthread_mutex_unlock(&LOCK_user_conn); + mysql_mutex_unlock(&LOCK_user_conn); DBUG_RETURN(error); } @@ -187,14 +187,14 @@ end: void decrease_user_connections(USER_CONN *uc) { DBUG_ENTER("decrease_user_connections"); - (void) pthread_mutex_lock(&LOCK_user_conn); + mysql_mutex_lock(&LOCK_user_conn); DBUG_ASSERT(uc->connections); if (!--uc->connections && !mqh_used) { /* Last connection for user; Delete it */ (void) my_hash_delete(&hash_user_connections,(uchar*) uc); } - (void) pthread_mutex_unlock(&LOCK_user_conn); + mysql_mutex_unlock(&LOCK_user_conn); DBUG_VOID_RETURN; } @@ -242,7 +242,7 @@ bool check_mqh(THD *thd, uint check_command) DBUG_ENTER("check_mqh"); DBUG_ASSERT(uc != 0); - (void) pthread_mutex_lock(&LOCK_user_conn); + mysql_mutex_lock(&LOCK_user_conn); time_out_user_resource_limits(thd, uc); @@ -269,7 +269,7 @@ bool check_mqh(THD *thd, uint check_command) } } end: - (void) pthread_mutex_unlock(&LOCK_user_conn); + mysql_mutex_unlock(&LOCK_user_conn); DBUG_RETURN(error); } @@ -330,9 +330,9 @@ check_user(THD *thd, enum enum_server_command command, #else my_bool opt_secure_auth_local; - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); opt_secure_auth_local= opt_secure_auth; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); /* If the server is running in secure auth mode, short scrambles are @@ -409,10 +409,10 @@ check_user(THD *thd, enum enum_server_command command, if (check_count) { - pthread_mutex_lock(&LOCK_connection_count); + mysql_mutex_lock(&LOCK_connection_count); bool count_ok= connection_count <= max_connections || (thd->main_security_ctx.master_access & SUPER_ACL); - pthread_mutex_unlock(&LOCK_connection_count); + mysql_mutex_unlock(&LOCK_connection_count); if (!count_ok) { // too many connections @@ -557,7 +557,7 @@ void free_max_user_conn(void) void reset_mqh(LEX_USER *lu, bool get_them= 0) { #ifndef NO_EMBEDDED_ACCESS_CHECKS - (void) pthread_mutex_lock(&LOCK_user_conn); + mysql_mutex_lock(&LOCK_user_conn); if (lu) // for GRANT { USER_CONN *uc; @@ -591,7 +591,7 @@ void reset_mqh(LEX_USER *lu, bool get_them= 0) uc->conn_per_hour=0; } } - (void) pthread_mutex_unlock(&LOCK_user_conn); + mysql_mutex_unlock(&LOCK_user_conn); #endif /* NO_EMBEDDED_ACCESS_CHECKS */ } @@ -1107,6 +1107,16 @@ pthread_handler_t handle_one_connection(void *arg) { THD *thd= (THD*) arg; + mysql_thread_set_psi_id(thd->thread_id); + + do_handle_one_connection(thd); + return 0; +} + +void do_handle_one_connection(THD *thd_arg) +{ + THD *thd= thd_arg; + thd->thr_create_utime= my_micro_time(); if (thread_scheduler.init_new_connection_thread()) @@ -1114,7 +1124,7 @@ pthread_handler_t handle_one_connection(void *arg) close_connection(thd, ER_OUT_OF_RESOURCES, 1); statistic_increment(aborted_connects,&LOCK_status); thread_scheduler.end_thread(thd,0); - return 0; + return; } /* @@ -1141,7 +1151,7 @@ pthread_handler_t handle_one_connection(void *arg) */ thd->thread_stack= (char*) &thd; if (setup_connection_thread_globals(thd)) - return 0; + return; for (;;) { @@ -1167,7 +1177,7 @@ pthread_handler_t handle_one_connection(void *arg) end_thread: close_connection(thd, 0, 1); if (thread_scheduler.end_thread(thd,1)) - return 0; // Probably no-threads + return; // Probably no-threads /* If end_thread() returns, we are either running with diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 9368053c658..71ea1a37cdc 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -341,7 +341,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, MY_RETURN_REAL_PATH); #if !defined(__WIN__) && ! defined(__NETWARE__) MY_STAT stat_info; - if (!my_stat(name,&stat_info,MYF(MY_WME))) + if (!mysql_file_stat(key_file_load, name, &stat_info, MYF(MY_WME))) DBUG_RETURN(TRUE); // if we are not in slave thread, the file must be: @@ -394,7 +394,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, } } - if ((file=my_open(name,O_RDONLY,MYF(MY_WME))) < 0) + if ((file= mysql_file_open(key_file_load, + name, O_RDONLY, MYF(MY_WME))) < 0) DBUG_RETURN(TRUE); } @@ -412,8 +413,8 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, info.escape_char, read_file_from_client, is_fifo); if (read_info.error) { - if (file >= 0) - my_close(file,MYF(0)); // no files in net reading + if (file >= 0) + mysql_file_close(file, MYF(0)); // no files in net reading DBUG_RETURN(TRUE); // Can't allocate buffers } @@ -484,7 +485,7 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, table->next_number_field=0; } if (file >= 0) - my_close(file,MYF(0)); + mysql_file_close(file, MYF(0)); free_blobs(table); /* if pack_blob was used */ table->copy_blobs=0; thd->count_cuted_fields= CHECK_FIELD_IGNORE; diff --git a/sql/sql_manager.cc b/sql/sql_manager.cc index b082f65bfb9..4f3e4e1c6d1 100644 --- a/sql/sql_manager.cc +++ b/sql/sql_manager.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000, 2002, 2005 MySQL AB +/* Copyright (C) 2000, 2002, 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,8 +28,8 @@ static bool volatile manager_thread_in_use; static bool abort_manager; pthread_t manager_thread; -pthread_mutex_t LOCK_manager; -pthread_cond_t COND_manager; +mysql_mutex_t LOCK_manager; +mysql_cond_t COND_manager; struct handler_cb { struct handler_cb *next; @@ -42,7 +42,7 @@ bool mysql_manager_submit(void (*action)()) { bool result= FALSE; struct handler_cb * volatile *cb; - pthread_mutex_lock(&LOCK_manager); + mysql_mutex_lock(&LOCK_manager); cb= &cb_list; while (*cb && (*cb)->action != action) cb= &(*cb)->next; @@ -57,7 +57,7 @@ bool mysql_manager_submit(void (*action)()) (*cb)->action= action; } } - pthread_mutex_unlock(&LOCK_manager); + mysql_mutex_unlock(&LOCK_manager); return result; } @@ -76,7 +76,7 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused))) for (;;) { - pthread_mutex_lock(&LOCK_manager); + mysql_mutex_lock(&LOCK_manager); /* XXX: This will need to be made more general to handle different * polling needs. */ if (flush_time) @@ -87,19 +87,19 @@ pthread_handler_t handle_manager(void *arg __attribute__((unused))) reset_flush_time = FALSE; } while ((!error || error == EINTR) && !abort_manager) - error= pthread_cond_timedwait(&COND_manager, &LOCK_manager, &abstime); + error= mysql_cond_timedwait(&COND_manager, &LOCK_manager, &abstime); } else { while ((!error || error == EINTR) && !abort_manager) - error= pthread_cond_wait(&COND_manager, &LOCK_manager); + error= mysql_cond_wait(&COND_manager, &LOCK_manager); } if (cb == NULL) { cb= cb_list; cb_list= NULL; } - pthread_mutex_unlock(&LOCK_manager); + mysql_mutex_unlock(&LOCK_manager); if (abort_manager) break; @@ -134,7 +134,8 @@ void start_handle_manager() if (flush_time && flush_time != ~(ulong) 0L) { pthread_t hThread; - if (pthread_create(&hThread,&connection_attrib,handle_manager,0)) + if (mysql_thread_create(key_thread_handle_manager, + &hThread, &connection_attrib, handle_manager, 0)) sql_print_warning("Can't create handle_manager thread"); } DBUG_VOID_RETURN; @@ -146,14 +147,14 @@ void stop_handle_manager() { DBUG_ENTER("stop_handle_manager"); abort_manager = true; - pthread_mutex_lock(&LOCK_manager); + mysql_mutex_lock(&LOCK_manager); if (manager_thread_in_use) { DBUG_PRINT("quit", ("initiate shutdown of handle manager thread: 0x%lx", (ulong)manager_thread)); - pthread_cond_signal(&COND_manager); + mysql_cond_signal(&COND_manager); } - pthread_mutex_unlock(&LOCK_manager); + mysql_mutex_unlock(&LOCK_manager); DBUG_VOID_RETURN; } diff --git a/sql/sql_map.cc b/sql/sql_map.cc index 7f77ce1212d..e4e85c51d17 100644 --- a/sql/sql_map.cc +++ b/sql/sql_map.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2001, 2004-2005 MySQL AB +/* Copyright (C) 2000-2001, 2004-2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,10 +32,10 @@ mapped_files::mapped_files(const char * filename,uchar *magic,uint magic_length) error=0; map=0; size=0; - if ((file=my_open(name,O_RDONLY,MYF(MY_WME))) >= 0) + if ((file= mysql_file_open(key_file_map, name, O_RDONLY, MYF(MY_WME))) >= 0) { struct stat stat_buf; - if (!fstat(file,&stat_buf)) + if (!fstat(file, &stat_buf)) { if (!(map=(uchar*) my_mmap(0,(size_t)(size= stat_buf.st_size),PROT_READ, MAP_SHARED | MAP_NORESERVE,file, @@ -53,7 +53,7 @@ mapped_files::mapped_files(const char * filename,uchar *magic,uint magic_length) } if (!map) { - (void) my_close(file,MYF(0)); + (void) mysql_file_close(file, MYF(0)); file= -1; } } @@ -67,7 +67,7 @@ mapped_files::~mapped_files() if (file >= 0) { (void) my_munmap((char*) map,(size_t)size); - (void) my_close(file,MYF(0)); + (void) mysql_file_close(file, MYF(0)); file= -1; map=0; } my_free(name,MYF(0)); @@ -85,7 +85,7 @@ static I_List maps_in_use; mapped_files *map_file(const char * name,uchar *magic,uint magic_length) { #ifdef HAVE_MMAP - pthread_mutex_lock(&LOCK_mapped_file); + mysql_mutex_lock(&LOCK_mapped_file); I_List_iterator list(maps_in_use); mapped_files *map; char path[FN_REFLEN]; @@ -108,7 +108,7 @@ mapped_files *map_file(const char * name,uchar *magic,uint magic_length) if (!map->map) my_error(ER_NO_FILE_MAPPING, MYF(0), path, map->error); } - pthread_mutex_unlock(&LOCK_mapped_file); + mysql_mutex_unlock(&LOCK_mapped_file); return map; #else return NULL; @@ -122,10 +122,10 @@ mapped_files *map_file(const char * name,uchar *magic,uint magic_length) void unmap_file(mapped_files *map) { #ifdef HAVE_MMAP - pthread_mutex_lock(&LOCK_mapped_file); + mysql_mutex_lock(&LOCK_mapped_file); if (!map->use_count--) delete map; - pthread_mutex_unlock(&LOCK_mapped_file); + mysql_mutex_unlock(&LOCK_mapped_file); #endif } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 63a8c17e145..49d18cbe5d7 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -376,15 +376,15 @@ bool is_log_table_write_query(enum enum_sql_command command) } void execute_init_command(THD *thd, LEX_STRING *init_command, - rw_lock_t *var_lock) + mysql_rwlock_t *var_lock) { Vio* save_vio; ulong save_client_capabilities; - rw_rdlock(var_lock); + mysql_rwlock_rdlock(var_lock); if (!init_command->length) { - rw_unlock(var_lock); + mysql_rwlock_unlock(var_lock); return; } @@ -395,7 +395,7 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, */ size_t len= init_command->length; char *buf= thd->strmake(init_command->str, len); - rw_unlock(var_lock); + mysql_rwlock_unlock(var_lock); #if defined(ENABLED_PROFILING) thd->profiling.start_new_query(); @@ -423,7 +423,7 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, static void handle_bootstrap_impl(THD *thd) { - FILE *file=bootstrap_file; + MYSQL_FILE *file= bootstrap_file; char *buff; const char* found_semicolon= NULL; @@ -448,12 +448,12 @@ static void handle_bootstrap_impl(THD *thd) buff= (char*) thd->net.buff; thd->init_for_queries(); - while (fgets(buff, thd->net.max_packet, file)) + while (mysql_file_fgets(buff, thd->net.max_packet, file)) { - char *query, *res; - /* strlen() can't be deleted because fgets() doesn't return length */ + char *query; + /* strlen() can't be deleted because mysql_file_fgets() doesn't return length */ ulong length= (ulong) strlen(buff); - while (buff[length-1] != '\n' && !feof(file)) + while (buff[length-1] != '\n' && !mysql_file_feof(file)) { /* We got only a part of the current string. Will try to increase @@ -467,7 +467,7 @@ static void handle_bootstrap_impl(THD *thd) break; } buff= (char*) thd->net.buff; - res= fgets(buff + length, thd->net.max_packet - length, file); + mysql_file_fgets(buff + length, thd->net.max_packet - length, file); length+= (ulong) strlen(buff + length); /* purecov: end */ } @@ -529,6 +529,14 @@ pthread_handler_t handle_bootstrap(void *arg) { THD *thd=(THD*) arg; + mysql_thread_set_psi_id(thd->thread_id); + + do_handle_bootstrap(thd); + return 0; +} + +void do_handle_bootstrap(THD *thd) +{ /* The following must be called before DBUG_ENTER */ thd->thread_stack= (char*) &thd; if (my_thread_init() || thd->store_globals()) @@ -557,7 +565,7 @@ end: pthread_exit(0); #endif - return 0; + return; } @@ -1225,8 +1233,10 @@ bool dispatch_command(enum enum_server_command command, THD *thd, if (lower_case_table_names) my_casedn_str(files_charset_info, table_list.table_name); - if (check_access(thd,SELECT_ACL,table_list.db,&table_list.grant.privilege, - 0, 0, test(table_list.schema_table))) + if (check_access(thd, SELECT_ACL, table_list.db, + &table_list.grant.privilege, + &table_list.grant.m_internal, + 0, 0)) break; if (check_grant(thd, SELECT_ACL, &table_list, TRUE, UINT_MAX, FALSE)) break; @@ -2113,7 +2123,7 @@ mysql_execute_command(THD *thd) privileges_requested, all_tables, FALSE, UINT_MAX, FALSE); else - res= check_access(thd, privileges_requested, any_db, 0, 0, 0, 0); + res= check_access(thd, privileges_requested, any_db, NULL, NULL, 0, 0); if (res) break; @@ -2253,8 +2263,9 @@ case SQLCOM_PREPARE: { DBUG_ASSERT(first_table == all_tables && first_table != 0); if (check_access(thd, INDEX_ACL, first_table->db, - &first_table->grant.privilege, 0, 0, - test(first_table->schema_table))) + &first_table->grant.privilege, + &first_table->grant.m_internal, + 0, 0)) goto error; res= mysql_assign_to_keycache(thd, first_table, &lex->ident); break; @@ -2263,8 +2274,9 @@ case SQLCOM_PREPARE: { DBUG_ASSERT(first_table == all_tables && first_table != 0); if (check_access(thd, INDEX_ACL, first_table->db, - &first_table->grant.privilege, 0, 0, - test(first_table->schema_table))) + &first_table->grant.privilege, + &first_table->grant.m_internal, + 0, 0)) goto error; res = mysql_preload_keys(thd, first_table); break; @@ -2274,9 +2286,9 @@ case SQLCOM_PREPARE: { if (check_global_access(thd, SUPER_ACL)) goto error; - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); res = change_master(thd,active_mi); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); break; } case SQLCOM_SHOW_SLAVE_STAT: @@ -2284,7 +2296,7 @@ case SQLCOM_PREPARE: /* Accept one of two privileges */ if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL)) goto error; - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (active_mi != NULL) { res = show_master_info(thd, active_mi); @@ -2295,7 +2307,7 @@ case SQLCOM_PREPARE: WARN_NO_MASTER_INFO, ER(WARN_NO_MASTER_INFO)); my_ok(thd); } - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); break; } case SQLCOM_SHOW_MASTER_STAT: @@ -2607,9 +2619,9 @@ end_with_restore_list: #ifdef HAVE_REPLICATION case SQLCOM_SLAVE_START: { - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); start_slave(thd,active_mi,1 /* net report*/); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); break; } case SQLCOM_SLAVE_STOP: @@ -2633,9 +2645,9 @@ end_with_restore_list: goto error; } { - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); stop_slave(thd,active_mi,1/* net report*/); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); break; } #endif /* HAVE_REPLICATION */ @@ -2666,10 +2678,13 @@ end_with_restore_list: /* Must be set in the parser */ DBUG_ASSERT(select_lex->db); if (check_access(thd, priv_needed, first_table->db, - &first_table->grant.privilege, 0, 0, - test(first_table->schema_table)) || - check_access(thd,INSERT_ACL | CREATE_ACL,select_lex->db,&priv,0,0, - is_schema_db(select_lex->db))|| + &first_table->grant.privilege, + &first_table->grant.m_internal, + 0, 0) || + check_access(thd, INSERT_ACL | CREATE_ACL, select_lex->db, + &priv, + NULL, /* Do not use first_table->grant with select_lex->db */ + 0, 0) || check_merge_table_access(thd, first_table->db, (TABLE_LIST *) create_info.merge_list.first)) @@ -2726,10 +2741,13 @@ end_with_restore_list: for (table= first_table; table; table= table->next_local->next_local) { if (check_access(thd, ALTER_ACL | DROP_ACL, table->db, - &table->grant.privilege,0,0, test(table->schema_table)) || - check_access(thd, INSERT_ACL | CREATE_ACL, table->next_local->db, - &table->next_local->grant.privilege, 0, 0, - test(table->next_local->schema_table))) + &table->grant.privilege, + &table->grant.m_internal, + 0, 0) || + check_access(thd, INSERT_ACL | CREATE_ACL, table->next_local->db, + &table->next_local->grant.privilege, + &table->next_local->grant.m_internal, + 0, 0)) goto error; TABLE_LIST old_list, new_list; /* @@ -2797,42 +2815,13 @@ end_with_restore_list: } else { - ulong save_priv; - /* - If it is an INFORMATION_SCHEMA table, SELECT_ACL privilege is the - only privilege allowed. For any other privilege check_access() - reports an error. That's how internal implementation protects - INFORMATION_SCHEMA from updates. - - For ordinary tables any privilege from the SHOW_CREATE_TABLE_ACLS - set is sufficient. + The fact that check_some_access() returned FALSE does not mean that + access is granted. We need to check if first_table->grant.privilege + contains any table-specific privilege. */ - - ulong check_privs= test(first_table->schema_table) ? - SELECT_ACL : SHOW_CREATE_TABLE_ACLS; - - if (check_access(thd, check_privs, first_table->db, - &save_priv, FALSE, FALSE, - test(first_table->schema_table))) - goto error; - - /* - save_priv contains any privileges actually granted by check_access - (i.e. save_priv contains global (user- and database-level) - privileges). - - The fact that check_access() returned FALSE does not mean that - access is granted. We need to check if save_priv contains any - table-specific privilege. If not, we need to check table-level - privileges. - - If there are no global privileges and no table-level privileges, - access is denied. - */ - - if (!(save_priv & (SHOW_CREATE_TABLE_ACLS)) && - !has_any_table_level_privileges(thd, SHOW_CREATE_TABLE_ACLS, first_table)) + if (check_some_access(thd, SHOW_CREATE_TABLE_ACLS, first_table) || + (first_table->grant.privilege & SHOW_CREATE_TABLE_ACLS) == 0) { my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0), "SHOW", thd->security_ctx->priv_user, @@ -3338,7 +3327,7 @@ end_with_restore_list: goto error; #else { - if (check_access(thd, FILE_ACL, any_db,0,0,0,0)) + if (check_access(thd, FILE_ACL, any_db, NULL, NULL, 0, 0)) goto error; res= ha_show_status(thd, lex->create_info.db_type, HA_ENGINE_LOGS); break; @@ -3507,8 +3496,7 @@ end_with_restore_list: break; } #endif - if (check_access(thd,CREATE_ACL,lex->name.str, 0, 1, 0, - is_schema_db(lex->name.str))) + if (check_access(thd, CREATE_ACL, lex->name.str, NULL, NULL, 1, 0)) break; res= mysql_create_db(thd,(lower_case_table_names == 2 ? alias : lex->name.str), &create_info, 0); @@ -3542,8 +3530,7 @@ end_with_restore_list: break; } #endif - if (check_access(thd,DROP_ACL,lex->name.str,0,1,0, - is_schema_db(lex->name.str))) + if (check_access(thd, DROP_ACL, lex->name.str, NULL, NULL, 1, 0)) break; if (thd->locked_tables || thd->active_transaction()) { @@ -3577,9 +3564,9 @@ end_with_restore_list: my_error(ER_WRONG_DB_NAME, MYF(0), db->str); break; } - if (check_access(thd, ALTER_ACL, db->str, 0, 1, 0, is_schema_db(db->str)) || - check_access(thd, DROP_ACL, db->str, 0, 1, 0, is_schema_db(db->str)) || - check_access(thd, CREATE_ACL, db->str, 0, 1, 0, is_schema_db(db->str))) + if (check_access(thd, ALTER_ACL, db->str, NULL, NULL, 1, 0) || + check_access(thd, DROP_ACL, db->str, NULL, NULL, 1, 0) || + check_access(thd, CREATE_ACL, db->str, NULL, NULL, 1, 0)) { res= 1; break; @@ -3622,7 +3609,7 @@ end_with_restore_list: break; } #endif - if (check_access(thd, ALTER_ACL, db->str, 0, 1, 0, is_schema_db(db->str))) + if (check_access(thd, ALTER_ACL, db->str, NULL, NULL, 1, 0)) break; if (thd->locked_tables || thd->active_transaction()) { @@ -3707,7 +3694,7 @@ end_with_restore_list: #endif case SQLCOM_CREATE_FUNCTION: // UDF function { - if (check_access(thd,INSERT_ACL,"mysql",0,1,0,0)) + if (check_access(thd, INSERT_ACL, "mysql", NULL, NULL, 1, 0)) break; #ifdef HAVE_DLOPEN if (!(res = mysql_create_function(thd, &lex->udf))) @@ -3721,7 +3708,7 @@ end_with_restore_list: #ifndef NO_EMBEDDED_ACCESS_CHECKS case SQLCOM_CREATE_USER: { - if (check_access(thd, INSERT_ACL, "mysql", 0, 1, 1, 0) && + if (check_access(thd, INSERT_ACL, "mysql", NULL, NULL, 1, 1) && check_global_access(thd,CREATE_USER_ACL)) break; if (end_active_trans(thd)) @@ -3733,7 +3720,7 @@ end_with_restore_list: } case SQLCOM_DROP_USER: { - if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 1, 0) && + if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 1) && check_global_access(thd,CREATE_USER_ACL)) break; if (end_active_trans(thd)) @@ -3745,7 +3732,7 @@ end_with_restore_list: } case SQLCOM_RENAME_USER: { - if (check_access(thd, UPDATE_ACL, "mysql", 0, 1, 1, 0) && + if (check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 1) && check_global_access(thd,CREATE_USER_ACL)) break; if (end_active_trans(thd)) @@ -3759,7 +3746,7 @@ end_with_restore_list: { if (end_active_trans(thd)) goto error; - if (check_access(thd, UPDATE_ACL, "mysql", 0, 1, 1, 0) && + if (check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 1) && check_global_access(thd,CREATE_USER_ACL)) break; /* Conditionally writes to binlog */ @@ -3774,11 +3761,10 @@ end_with_restore_list: goto error; if (check_access(thd, lex->grant | lex->grant_tot_col | GRANT_ACL, - first_table ? first_table->db : select_lex->db, - first_table ? &first_table->grant.privilege : 0, - first_table ? 0 : 1, 0, - first_table ? (bool) first_table->schema_table : - select_lex->db ? is_schema_db(select_lex->db) : 0)) + first_table ? first_table->db : select_lex->db, + first_table ? &first_table->grant.privilege : NULL, + first_table ? &first_table->grant.m_internal : NULL, + first_table ? 0 : 1, 0)) goto error; if (thd->security_ctx->user) // If not replication @@ -3805,7 +3791,7 @@ end_with_restore_list: // TODO: use check_change_password() if (is_acl_user(user->host.str, user->user.str) && user->password.str && - check_access(thd, UPDATE_ACL,"mysql",0,1,1,0)) + check_access(thd, UPDATE_ACL, "mysql", NULL, NULL, 1, 1)) { my_message(ER_PASSWORD_NOT_ALLOWED, ER(ER_PASSWORD_NOT_ALLOWED), MYF(0)); @@ -3937,7 +3923,7 @@ end_with_restore_list: goto error; if ((thd->security_ctx->priv_user && !strcmp(thd->security_ctx->priv_user, grant_user->user.str)) || - !check_access(thd, SELECT_ACL, "mysql",0,1,0,0)) + !check_access(thd, SELECT_ACL, "mysql", NULL, NULL, 1, 0)) { res = mysql_show_grants(thd, grant_user); } @@ -4121,8 +4107,8 @@ end_with_restore_list: goto create_sp_error; } - if (check_access(thd, CREATE_PROC_ACL, lex->sphead->m_db.str, 0, 0, 0, - is_schema_db(lex->sphead->m_db.str))) + if (check_access(thd, CREATE_PROC_ACL, lex->sphead->m_db.str, + NULL, NULL, 0, 0)) goto create_sp_error; if (end_active_trans(thd)) @@ -4447,7 +4433,7 @@ create_sp_error: lex->spname->m_name.length); if (udf) { - if (check_access(thd, DELETE_ACL, "mysql", 0, 1, 0, 0)) + if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0)) goto error; if (!(res = mysql_drop_function(thd, &lex->spname->m_name))) @@ -5006,8 +4992,9 @@ bool check_single_table_access(THD *thd, ulong privilege, db_name= all_tables->db; if (check_access(thd, privilege, db_name, - &all_tables->grant.privilege, 0, no_errors, - test(all_tables->schema_table))) + &all_tables->grant.privilege, + &all_tables->grant.m_internal, + 0, no_errors)) goto deny; /* Show only 1 table for check_grant */ @@ -5073,17 +5060,17 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables) @param want_access The requested access privileges. @param db A pointer to the Db name. @param[out] save_priv A pointer to the granted privileges will be stored. + @param grant_internal_info A pointer to the internal grant cache. @param dont_check_global_grants True if no global grants are checked. @param no_error True if no errors should be sent to the client. - @param schema_db True if the db specified belongs to the meta data tables. 'save_priv' is used to save the User-table (global) and Db-table grants for the supplied db name. Note that we don't store db level grants if the global grants is enough to satisfy the request AND the global grants contains a SELECT grant. - A meta data table (from INFORMATION_SCHEMA) can always be accessed with - a SELECT_ACL. + For internal databases (INFORMATION_SCHEMA, PERFORMANCE_SCHEMA), + additional rules apply, see ACL_internal_schema_access. @see check_grant @@ -5095,7 +5082,8 @@ bool check_one_table_access(THD *thd, ulong privilege, TABLE_LIST *all_tables) bool check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, - bool dont_check_global_grants, bool no_errors, bool schema_db) + GRANT_INTERNAL_INFO *grant_internal_info, + bool dont_check_global_grants, bool no_errors) { Security_context *sctx= thd->security_ctx; ulong db_access; @@ -5118,7 +5106,10 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, if (save_priv) *save_priv=0; else + { save_priv= &dummy; + dummy= 0; + } thd_proc_info(thd, "checking permissions"); if ((!db || !db[0]) && !thd->db && !dont_check_global_grants) @@ -5130,55 +5121,65 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, DBUG_RETURN(TRUE); /* purecov: tested */ } - if (schema_db) + if ((db != NULL) && (db != any_db)) { - /* - We don't allow any simple privileges but SELECT_ACL or CREATE_VIEW_ACL - on the information_schema database. - */ - want_access &= ~SELECT_ACL; - if (want_access & DB_ACLS) + const ACL_internal_schema_access *access; + access= get_cached_schema_access(grant_internal_info, db); + if (access) { - if (!no_errors) + switch (access->check(want_access, save_priv)) { - const char *db_name= db ? db : thd->db; - my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - sctx->priv_user, sctx->priv_host, db_name); + case ACL_INTERNAL_ACCESS_GRANTED: + /* + All the privileges requested have been granted internally. + [out] *save_privileges= Internal privileges. + */ + DBUG_RETURN(FALSE); + case ACL_INTERNAL_ACCESS_DENIED: + if (! no_errors) + { + my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), + sctx->priv_user, sctx->priv_host, db); + } + DBUG_RETURN(TRUE); + case ACL_INTERNAL_ACCESS_CHECK_GRANT: + /* + Only some of the privilege requested have been granted internally, + proceed with the remaining bits of the request (want_access). + */ + want_access&= ~(*save_priv); + break; } - /* - Access denied; - [out] *save_privileges= 0 - */ - DBUG_RETURN(TRUE); - } - else - { - /* Access granted */ - *save_priv= SELECT_ACL; - DBUG_RETURN(FALSE); } } if ((sctx->master_access & want_access) == want_access) { - /* get access for current db */ - db_access= sctx->db_access; /* 1. If we don't have a global SELECT privilege, we have to get the database specific access rights to be able to handle queries of type UPDATE t1 SET a=1 WHERE b > 0 2. Change db access if it isn't current db which is being addressed */ - if (!(sctx->master_access & SELECT_ACL) && - (db && (!thd->db || db_is_pattern || strcmp(db,thd->db)))) - db_access=acl_get(sctx->host, sctx->ip, sctx->priv_user, db, - db_is_pattern); - - /* - The effective privileges are the union of the global privileges - and the the intersection of db- and host-privileges. - */ - *save_priv=sctx->master_access | db_access; + if (!(sctx->master_access & SELECT_ACL)) + { + if (db && (!thd->db || db_is_pattern || strcmp(db, thd->db))) + db_access= acl_get(sctx->host, sctx->ip, sctx->priv_user, db, + db_is_pattern); + else + { + /* get access for current db */ + db_access= sctx->db_access; + } + /* + The effective privileges are the union of the global privileges + and the intersection of db- and host-privileges, + plus the internal privileges. + */ + *save_priv|= sctx->master_access | db_access; + } + else + *save_priv|= sctx->master_access; DBUG_RETURN(FALSE); } if (((want_access & ~sctx->master_access) & ~DB_ACLS) || @@ -5214,10 +5215,10 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, /* Save the union of User-table and the intersection between Db-table and - Host-table privileges. + Host-table privileges, with the already saved internal privileges. */ db_access= (db_access | sctx->master_access); - *save_priv= db_access; + *save_priv|= db_access; /* We need to investigate column- and table access if all requested privileges @@ -5238,14 +5239,14 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, { /* Ok; but need to check table- and column privileges. - [out] *save_privileges is (User-priv | (Db-priv & Host-priv)) + [out] *save_privileges is (User-priv | (Db-priv & Host-priv) | Internal-priv) */ DBUG_RETURN(FALSE); } /* Access is denied; - [out] *save_privileges is (User-priv | (Db-priv & Host-priv)) + [out] *save_privileges is (User-priv | (Db-priv & Host-priv) | Internal-priv) */ DBUG_PRINT("error",("Access denied")); if (!no_errors) @@ -5261,6 +5262,18 @@ check_access(THD *thd, ulong want_access, const char *db, ulong *save_priv, static bool check_show_access(THD *thd, TABLE_LIST *table) { + /* + This is a SHOW command using an INFORMATION_SCHEMA table. + check_access() has not been called for 'table', + and SELECT is currently always granted on the I_S, so we automatically + grant SELECT on table here, to bypass a call to check_access(). + Note that not calling check_access(table) is an optimization, + which needs to be revisited if the INFORMATION_SCHEMA does + not always automatically grant SELECT but use the grant tables. + See Bug#38837 need a way to disable information_schema for security + */ + table->grant.privilege= SELECT_ACL; + switch (get_schema_table_idx(table->schema_table)) { case SCH_SCHEMATA: return (specialflag & SPECIAL_SKIP_SHOW_DB) && @@ -5277,8 +5290,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table) DBUG_ASSERT(dst_db_name); if (check_access(thd, SELECT_ACL, dst_db_name, - &thd->col_access, FALSE, FALSE, - is_schema_db(dst_db_name))) + &thd->col_access, NULL, FALSE, FALSE)) return TRUE; if (!thd->col_access && check_grant_db(thd, dst_db_name)) @@ -5302,8 +5314,9 @@ static bool check_show_access(THD *thd, TABLE_LIST *table) DBUG_ASSERT(dst_table); if (check_access(thd, SELECT_ACL, dst_table->db, - &dst_table->grant.privilege, FALSE, FALSE, - test(dst_table->schema_table))) + &dst_table->grant.privilege, + &dst_table->grant.m_internal, + FALSE, FALSE)) return TRUE; /* Access denied */ /* @@ -5383,23 +5396,6 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables, else sctx= backup_ctx; - /* - Always allow SELECT on schema tables. This is done by removing the - required SELECT_ACL privilege in the want_access parameter. - Disallow any other DDL or DML operation on any schema table. - */ - if (tables->schema_table) - { - want_access &= ~SELECT_ACL; - if (want_access & DB_ACLS) - { - if (!no_errors) - my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), - sctx->priv_user, sctx->priv_host, - INFORMATION_SCHEMA_NAME.str); - goto deny; - } - } /* Register access for view underlying table. Remove SHOW_VIEW_ACL, because it will be checked during making view @@ -5420,18 +5416,11 @@ check_table_access(THD *thd, ulong requirements,TABLE_LIST *tables, (int)tables->table->s->tmp_table)) continue; thd->security_ctx= sctx; - if ((sctx->master_access & want_access) == want_access && - thd->db) - tables->grant.privilege= want_access; - else if (tables->db && thd->db && strcmp(tables->db, thd->db) == 0) - { - if (check_access(thd, want_access, tables->get_db_name(), - &tables->grant.privilege, 0, no_errors, - test(tables->schema_table))) - goto deny; // Access denied - } - else if (check_access(thd, want_access, tables->get_db_name(), - &tables->grant.privilege, 0, no_errors, 0)) + + if (check_access(thd, want_access, tables->get_db_name(), + &tables->grant.privilege, + &tables->grant.m_internal, + 0, no_errors)) goto deny; } thd->security_ctx= backup_ctx; @@ -5459,11 +5448,20 @@ check_routine_access(THD *thd, ulong want_access,char *db, char *name, calculating db_access) under the assumption that it's common to give persons global right to execute all stored SP (but not necessary to create them). + Note that this effectively bypasses the ACL_internal_schema_access checks + that are implemented for the INFORMATION_SCHEMA and PERFORMANCE_SCHEMA, + which are located in check_access(). + Since the I_S and P_S do not contain routines, this bypass is ok, + as long as this code path is not abused to create routines. + The assert enforce that. */ + DBUG_ASSERT((want_access & CREATE_PROC_ACL) == 0); if ((thd->security_ctx->master_access & want_access) == want_access) tables->grant.privilege= want_access; - else if (check_access(thd,want_access,db,&tables->grant.privilege, - 0, no_errors, 0)) + else if (check_access(thd, want_access, db, + &tables->grant.privilege, + &tables->grant.m_internal, + 0, no_errors)) return TRUE; return check_grant_routine(thd, want_access, tables, is_proc, no_errors); @@ -5487,13 +5485,18 @@ bool check_some_routine_access(THD *thd, const char *db, const char *name, bool is_proc) { ulong save_priv; + /* + The following test is just a shortcut for check_access() (to avoid + calculating db_access) + Note that this effectively bypasses the ACL_internal_schema_access checks + that are implemented for the INFORMATION_SCHEMA and PERFORMANCE_SCHEMA, + which are located in check_access(). + Since the I_S and P_S do not contain routines, this bypass is ok, + as it only opens SHOW_PROC_ACLS. + */ if (thd->security_ctx->master_access & SHOW_PROC_ACLS) return FALSE; - /* - There are no routines in information_schema db. So we can safely - pass zero to last paramter of check_access function - */ - if (!check_access(thd, SHOW_PROC_ACLS, db, &save_priv, 0, 1, 0) || + if (!check_access(thd, SHOW_PROC_ACLS, db, &save_priv, NULL, 0, 1) || (save_priv & SHOW_PROC_ACLS)) return FALSE; return check_routine_level_acl(thd, db, name, is_proc); @@ -5523,8 +5526,9 @@ bool check_some_access(THD *thd, ulong want_access, TABLE_LIST *table) if (access & want_access) { if (!check_access(thd, access, table->db, - &table->grant.privilege, 0, 1, - test(table->schema_table)) && + &table->grant.privilege, + &table->grant.m_internal, + 0, 1) && !check_grant(thd, access, table, FALSE, 1, TRUE)) DBUG_RETURN(0); } @@ -6864,9 +6868,9 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, mysql_bin_log.rotate_and_purge(RP_FORCE_ROTATE); } #ifdef HAVE_REPLICATION - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); rotate_relay_log(active_mi); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); #endif /* flush slow and general logs */ @@ -6969,10 +6973,10 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables, if (options & REFRESH_SLAVE) { tmp_write_to_binlog= 0; - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); if (reset_slave(thd, active_mi)) result=1; - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); } #endif if (options & REFRESH_USER_RESOURCES) @@ -7007,7 +7011,7 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query) continue; if (tmp->thread_id == id) { - pthread_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete + mysql_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete break; } } @@ -7040,7 +7044,7 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query) } else error=ER_KILL_DENIED_ERROR; - pthread_mutex_unlock(&tmp->LOCK_thd_data); + mysql_mutex_unlock(&tmp->LOCK_thd_data); } DBUG_PRINT("exit", ("%d", error)); DBUG_RETURN(error); @@ -7221,12 +7225,14 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables) if (table->derived) table->grant.privilege= SELECT_ACL; else if ((check_access(thd, UPDATE_ACL, table->db, - &table->grant.privilege, 0, 1, - test(table->schema_table)) || + &table->grant.privilege, + &table->grant.m_internal, + 0, 1) || check_grant(thd, UPDATE_ACL, table, FALSE, 1, TRUE)) && (check_access(thd, SELECT_ACL, table->db, - &table->grant.privilege, 0, 0, - test(table->schema_table)) || + &table->grant.privilege, + &table->grant.m_internal, + 0, 0) || check_grant(thd, SELECT_ACL, table, FALSE, 1, FALSE))) DBUG_RETURN(TRUE); @@ -7243,8 +7249,9 @@ bool multi_update_precheck(THD *thd, TABLE_LIST *tables) if (!table->table_in_first_from_clause) { if (check_access(thd, SELECT_ACL, table->db, - &table->grant.privilege, 0, 0, - test(table->schema_table)) || + &table->grant.privilege, + &table->grant.m_internal, + 0, 0) || check_grant(thd, SELECT_ACL, table, FALSE, 1, FALSE)) DBUG_RETURN(TRUE); } @@ -7525,8 +7532,9 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables, (select_lex->item_list.elements ? INSERT_ACL : 0); if (check_access(thd, want_priv, create_table->db, - &create_table->grant.privilege, 0, 0, - test(create_table->schema_table)) || + &create_table->grant.privilege, + &create_table->grant.m_internal, + 0, 0) || check_merge_table_access(thd, create_table->db, (TABLE_LIST *) lex->create_info.merge_list.first)) diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index a5ae5d24796..91cf0333fb5 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -1880,7 +1880,7 @@ end: static int add_write(File fptr, const char *buf, uint len) { - uint ret_code= my_write(fptr, (const uchar*)buf, len, MYF(MY_FNABP)); + uint ret_code= mysql_file_write(fptr, (const uchar*)buf, len, MYF(MY_FNABP)); if (likely(ret_code == 0)) return 0; @@ -2592,10 +2592,11 @@ char *generate_partition_syntax(partition_info *part_info, } if (err) goto close_file; - buffer_length= my_seek(fptr, 0L,MY_SEEK_END,MYF(0)); + buffer_length= mysql_file_seek(fptr, 0L, MY_SEEK_END, MYF(0)); if (unlikely(buffer_length == MY_FILEPOS_ERROR)) goto close_file; - if (unlikely(my_seek(fptr, 0L, MY_SEEK_SET, MYF(0)) == MY_FILEPOS_ERROR)) + if (unlikely(mysql_file_seek(fptr, 0L, MY_SEEK_SET, MYF(0)) + == MY_FILEPOS_ERROR)) goto close_file; *buf_length= (uint)buffer_length; if (use_sql_alloc) @@ -2605,7 +2606,7 @@ char *generate_partition_syntax(partition_info *part_info, if (!buf) goto close_file; - if (unlikely(my_read(fptr, (uchar*)buf, *buf_length, MYF(MY_FNABP)))) + if (unlikely(mysql_file_read(fptr, (uchar*)buf, *buf_length, MYF(MY_FNABP)))) { if (!use_sql_alloc) my_free(buf, MYF(0)); @@ -2616,7 +2617,7 @@ char *generate_partition_syntax(partition_info *part_info, buf[*buf_length]= 0; close_file: - my_close(fptr, MYF(0)); + mysql_file_close(fptr, MYF(0)); DBUG_RETURN(buf); } @@ -5962,7 +5963,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt) DBUG_ENTER("write_log_drop_shadow_frm"); build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, lpt); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); if (write_log_replace_delete_frm(lpt, 0UL, NULL, (const char*)shadow_path, FALSE)) goto error; @@ -5970,13 +5971,13 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt) if (write_execute_ddl_log_entry(log_entry->entry_pos, FALSE, &exec_log_entry)) goto error; - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); set_part_info_exec_log_entry(part_info, exec_log_entry); DBUG_RETURN(FALSE); error: release_part_info_log_entries(part_info->first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->first_log_entry= NULL; my_error(ER_DDL_LOG_ERROR, MYF(0)); DBUG_RETURN(TRUE); @@ -6010,7 +6011,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt) build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0); build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, lpt); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); if (write_log_replace_delete_frm(lpt, 0UL, shadow_path, path, TRUE)) goto error; log_entry= part_info->first_log_entry; @@ -6019,12 +6020,12 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt) FALSE, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(FALSE); error: release_part_info_log_entries(part_info->first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->first_log_entry= old_first_log_entry; part_info->frm_log_entry= NULL; my_error(ER_DDL_LOG_ERROR, MYF(0)); @@ -6063,7 +6064,7 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt) lpt->table_name, "", 0); build_table_filename(tmp_path, sizeof(tmp_path) - 1, lpt->db, lpt->table_name, "#", 0); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path, FALSE)) goto error; @@ -6076,12 +6077,12 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt) FALSE, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(FALSE); error: release_part_info_log_entries(part_info->first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->first_log_entry= old_first_log_entry; part_info->frm_log_entry= NULL; my_error(ER_DDL_LOG_ERROR, MYF(0)); @@ -6120,7 +6121,7 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) lpt->table_name, "", 0); build_table_filename(tmp_path, sizeof(tmp_path) - 1, lpt->db, lpt->table_name, "#", 0); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path, FALSE)) goto error; @@ -6131,13 +6132,13 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) if (write_execute_ddl_log_entry(log_entry->entry_pos, FALSE, &exec_log_entry)) goto error; - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); set_part_info_exec_log_entry(part_info, exec_log_entry); DBUG_RETURN(FALSE); error: release_part_info_log_entries(part_info->first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->first_log_entry= NULL; my_error(ER_DDL_LOG_ERROR, MYF(0)); DBUG_RETURN(TRUE); @@ -6175,7 +6176,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) build_table_filename(path, sizeof(path) - 1, lpt->db, lpt->table_name, "", 0); build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, lpt); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); if (write_log_dropped_partitions(lpt, &next_entry, (const char*)path, lpt->alter_info->flags & ALTER_REORGANIZE_PARTITION)) goto error; @@ -6189,12 +6190,12 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) FALSE, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(FALSE); error: release_part_info_log_entries(part_info->first_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->first_log_entry= old_first_log_entry; part_info->frm_log_entry= NULL; my_error(ER_DDL_LOG_ERROR, MYF(0)); @@ -6221,7 +6222,7 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt, DBUG_ENTER("write_log_completed"); DBUG_ASSERT(log_entry); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); if (write_execute_ddl_log_entry(0UL, TRUE, &log_entry)) { /* @@ -6235,7 +6236,7 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt, } release_part_info_log_entries(part_info->first_log_entry); release_part_info_log_entries(part_info->exec_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->exec_log_entry= NULL; part_info->first_log_entry= NULL; DBUG_VOID_RETURN; @@ -6253,10 +6254,10 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt, static void release_log_entries(partition_info *part_info) { - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); release_part_info_log_entries(part_info->first_log_entry); release_part_info_log_entries(part_info->exec_log_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); part_info->first_log_entry= NULL; part_info->exec_log_entry= NULL; } diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index c5f737434be..0a7864631ae 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -109,7 +109,7 @@ static int cur_plugin_info_interface_version[MYSQL_MAX_PLUGIN_TYPE_NUM]= following variables/structures. We are always manipulating ref count, so a rwlock here is unneccessary. */ -pthread_mutex_t LOCK_plugin; +mysql_mutex_t LOCK_plugin; static DYNAMIC_ARRAY plugin_dl_array; static DYNAMIC_ARRAY plugin_array; static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM]; @@ -196,7 +196,7 @@ public: (plugin_var_arg->flags & PLUGIN_VAR_THDLOCAL ? SESSION : GLOBAL) | (plugin_var_arg->flags & PLUGIN_VAR_READONLY ? READONLY : 0), 0, -1, NO_ARG, pluginvar_show_type(plugin_var_arg), 0, 0, - VARIABLE_NOT_IN_BINLOG, 0, 0, 0, 0), + VARIABLE_NOT_IN_BINLOG, 0, 0, 0, 0, PARSE_NORMAL), plugin_var(plugin_var_arg), orig_pluginvar_name(plugin_var_arg->name) { plugin_var->name= name_arg; } sys_var_pluginvar *cast_pluginvar() { return this; } @@ -557,7 +557,7 @@ static void plugin_dl_del(const LEX_STRING *dl) uint i; DBUG_ENTER("plugin_dl_del"); - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); for (i= 0; i < plugin_dl_array.elements; i++) { @@ -589,7 +589,7 @@ static struct st_plugin_int *plugin_find_internal(const LEX_STRING *name, int ty if (! initialized) DBUG_RETURN(0); - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); if (type == MYSQL_ANY_PLUGIN) { @@ -614,14 +614,14 @@ static SHOW_COMP_OPTION plugin_status(const LEX_STRING *name, int type) SHOW_COMP_OPTION rc= SHOW_OPTION_NO; struct st_plugin_int *plugin; DBUG_ENTER("plugin_is_ready"); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); if ((plugin= plugin_find_internal(name, type))) { rc= SHOW_OPTION_DISABLED; if (plugin->state == PLUGIN_IS_READY) rc= SHOW_OPTION_YES; } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(rc); } @@ -647,7 +647,7 @@ static plugin_ref intern_plugin_lock(LEX *lex, plugin_ref rc CALLER_INFO_PROTO) st_plugin_int *pi= plugin_ref_to_int(rc); DBUG_ENTER("intern_plugin_lock"); - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); if (pi->state & (PLUGIN_IS_READY | PLUGIN_IS_UNINITIALIZED)) { @@ -686,9 +686,9 @@ plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO) LEX *lex= thd ? thd->lex : 0; plugin_ref rc; DBUG_ENTER("plugin_lock"); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); rc= my_intern_plugin_lock_ci(lex, *ptr); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(rc); } @@ -700,10 +700,10 @@ plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name, int type plugin_ref rc= NULL; st_plugin_int *plugin; DBUG_ENTER("plugin_lock_by_name"); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); if ((plugin= plugin_find_internal(name, type))) rc= my_intern_plugin_lock_ci(lex, plugin_int_to_ref(plugin)); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(rc); } @@ -816,7 +816,7 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) deinitialization to deadlock if plugins have worker threads with plugin locks */ - safe_mutex_assert_not_owner(&LOCK_plugin); + mysql_mutex_assert_not_owner(&LOCK_plugin); if (plugin->plugin->status_vars) { @@ -869,11 +869,11 @@ static void plugin_deinitialize(struct st_plugin_int *plugin, bool ref_check) static void plugin_del(struct st_plugin_int *plugin) { DBUG_ENTER("plugin_del(plugin)"); - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); /* Free allocated strings before deleting the plugin. */ - rw_wrlock(&LOCK_system_variables_hash); + mysql_rwlock_wrlock(&LOCK_system_variables_hash); mysql_del_sys_var_chain(plugin->system_vars); - rw_unlock(&LOCK_system_variables_hash); + mysql_rwlock_unlock(&LOCK_system_variables_hash); restore_pluginvar_names(plugin->system_vars); plugin_vars_free_values(plugin->system_vars); my_hash_delete(&plugin_hash[plugin->plugin->type], (uchar*)plugin); @@ -903,7 +903,7 @@ static void reap_plugins(void) uint count, idx; struct st_plugin_int *plugin, **reap, **list; - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); if (!reap_needed) return; @@ -924,13 +924,13 @@ static void reap_plugins(void) } } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); list= reap; while ((plugin= *(--list))) plugin_deinitialize(plugin, true); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); while ((plugin= *(--reap))) plugin_del(plugin); @@ -944,7 +944,7 @@ static void intern_plugin_unlock(LEX *lex, plugin_ref plugin) st_plugin_int *pi; DBUG_ENTER("intern_plugin_unlock"); - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); if (!plugin) DBUG_VOID_RETURN; @@ -997,10 +997,10 @@ void plugin_unlock(THD *thd, plugin_ref plugin) if (!plugin_dlib(plugin)) DBUG_VOID_RETURN; #endif - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); intern_plugin_unlock(lex, plugin); reap_plugins(); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_VOID_RETURN; } @@ -1010,11 +1010,11 @@ void plugin_unlock_list(THD *thd, plugin_ref *list, uint count) LEX *lex= thd ? thd->lex : 0; DBUG_ENTER("plugin_unlock_list"); DBUG_ASSERT(list); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); while (count--) intern_plugin_unlock(lex, *list++); reap_plugins(); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_VOID_RETURN; } @@ -1024,7 +1024,7 @@ static int plugin_initialize(struct st_plugin_int *plugin) int ret= 1; DBUG_ENTER("plugin_initialize"); - safe_mutex_assert_owner(&LOCK_plugin); + mysql_mutex_assert_owner(&LOCK_plugin); if (plugin_type_initialize[plugin->plugin->type]) { if ((*plugin_type_initialize[plugin->plugin->type])(plugin)) @@ -1130,6 +1130,26 @@ static inline void convert_underscore_to_dash(char *str, int len) *p= '-'; } +#ifdef HAVE_PSI_INTERFACE +static PSI_mutex_key key_LOCK_plugin; + +static PSI_mutex_info all_plugin_mutexes[]= +{ + { &key_LOCK_plugin, "LOCK_plugin", PSI_FLAG_GLOBAL} +}; + +static void init_plugin_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_plugin_mutexes); + PSI_server->register_mutex(category, all_plugin_mutexes, count); +} +#endif /* HAVE_PSI_INTERFACE */ /* The logic is that we first load and initialize all compiled in plugins. @@ -1153,6 +1173,10 @@ int plugin_init(int *argc, char **argv, int flags) if (initialized) DBUG_RETURN(0); +#ifdef HAVE_PSI_INTERFACE + init_plugin_psi_keys(); +#endif + init_alloc_root(&plugin_mem_root, 4096, 4096); init_alloc_root(&tmp_root, 4096, 4096); @@ -1161,7 +1185,7 @@ int plugin_init(int *argc, char **argv, int flags) goto err; - pthread_mutex_init(&LOCK_plugin, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_plugin, &LOCK_plugin, MY_MUTEX_INIT_FAST); if (my_init_dynamic_array(&plugin_dl_array, sizeof(struct st_plugin_dl *),16,16) || @@ -1176,7 +1200,7 @@ int plugin_init(int *argc, char **argv, int flags) goto err; } - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); initialized= 1; @@ -1204,6 +1228,26 @@ int plugin_init(int *argc, char **argv, int flags) tmp.name.length= strlen(plugin->name); tmp.state= 0; tmp.is_mandatory= mandatory; + + /* + If the performance schema is compiled in, + treat the storage engine plugin as 'mandatory', + to suppress any plugin-level options such as '--performance-schema'. + This is specific to the performance schema, and is done on purpose: + the server-level option '--performance-schema' controls the overall + performance schema initialization, which consists of much more that + the underlying storage engine initialization. + See mysqld.cc, set_vars.cc. + Suppressing ways to interfere directly with the storage engine alone + prevents awkward situations where: + - the user wants the performance schema functionality, by using + '--enable-performance-schema' (the server option), + - yet disable explicitly a component needed for the functionality + to work, by using '--skip-performance-schema' (the plugin) + */ + if (!my_strcasecmp(&my_charset_latin1, plugin->name, "PERFORMANCE_SCHEMA")) + tmp.is_mandatory= true; + free_root(&tmp_root, MYF(MY_MARK_BLOCKS_FREE)); if (test_plugin_options(&tmp_root, &tmp, argc, argv)) tmp.state= PLUGIN_IS_DISABLED; @@ -1239,7 +1283,7 @@ int plugin_init(int *argc, char **argv, int flags) /* should now be set to MyISAM storage engine */ DBUG_ASSERT(global_system_variables.table_plugin); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); /* Register all dynamic plugins */ if (!(flags & PLUGIN_INIT_SKIP_DYNAMIC_LOADING)) @@ -1257,7 +1301,7 @@ int plugin_init(int *argc, char **argv, int flags) Now we initialize all remaining plugins */ - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); reap= (st_plugin_int **) my_alloca((plugin_array.elements+1) * sizeof(void*)); *(reap++)= NULL; @@ -1279,15 +1323,15 @@ int plugin_init(int *argc, char **argv, int flags) */ while ((plugin_ptr= *(--reap))) { - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); if (plugin_ptr->is_mandatory) reaped_mandatory_plugin= TRUE; plugin_deinitialize(plugin_ptr, true); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); plugin_del(plugin_ptr); } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); my_afree(reap); if (reaped_mandatory_plugin) goto err; @@ -1298,7 +1342,7 @@ end: DBUG_RETURN(0); err_unlock: - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); err: free_root(&tmp_root, MYF(0)); DBUG_RETURN(1); @@ -1352,8 +1396,8 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin) tmp.name.str= (char *)plugin->name; tmp.name.length= strlen(plugin->name); - pthread_mutex_lock(&LOCK_plugin); - rw_wrlock(&LOCK_system_variables_hash); + mysql_mutex_lock(&LOCK_plugin); + mysql_rwlock_wrlock(&LOCK_system_variables_hash); if (test_plugin_options(thd->mem_root, &tmp, &dummy_argc, NULL)) goto end; @@ -1365,8 +1409,8 @@ bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin) } end: - rw_unlock(&LOCK_system_variables_hash); - pthread_mutex_unlock(&LOCK_plugin); + mysql_rwlock_unlock(&LOCK_system_variables_hash); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(result);; } @@ -1429,10 +1473,10 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv) /* there're no other threads running yet, so we don't need a mutex. but plugin_add() before is designed to work in multi-threaded - environment, and it uses safe_mutex_assert_owner(), so we lock + environment, and it uses mysql_mutex_assert_owner(), so we lock the mutex here to satisfy the assert */ - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); while (!(error= read_record_info.read_record(&read_record_info))) { DBUG_PRINT("info", ("init plugin record")); @@ -1448,7 +1492,7 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv) str_name.c_ptr(), str_dl.c_ptr()); free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); if (error > 0) sql_print_error(ER(ER_GET_ERRNO), my_errno); end_read_record(&read_record_info); @@ -1500,7 +1544,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, } dl= name; - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); if ((plugin_dl= plugin_dl_add(&dl, REPORT_TO_LOG))) { for (plugin= plugin_dl->plugins; plugin->info; plugin++) @@ -1518,11 +1562,11 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, else { free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE)); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG)) goto error; } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); name.length= dl.length= 0; dl.str= NULL; name.str= p= buffer; str= &name; @@ -1543,7 +1587,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv, } DBUG_RETURN(FALSE); error: - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); sql_print_error("Couldn't load plugin named '%s' with soname '%s'.", name.str, dl.str); DBUG_RETURN(TRUE); @@ -1559,7 +1603,7 @@ void plugin_shutdown(void) if (initialized) { - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); reap_needed= true; @@ -1604,7 +1648,7 @@ void plugin_shutdown(void) if (plugins[i]->state == PLUGIN_IS_DELETED) plugins[i]->state= PLUGIN_IS_DYING; } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); /* We loop through all plugins and call deinit() if they have one. @@ -1625,9 +1669,9 @@ void plugin_shutdown(void) /* It's perfectly safe not to lock LOCK_plugin, as there're no concurrent threads anymore. But some functions called from here - use safe_mutex_assert_owner(), so we lock the mutex to satisfy it + use mysql_mutex_assert_owner(), so we lock the mutex to satisfy it */ - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); /* We defer checking ref_counts until after all plugins are deinitialized @@ -1648,10 +1692,10 @@ void plugin_shutdown(void) cleanup_variables(NULL, &global_system_variables); cleanup_variables(NULL, &max_system_variables); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); initialized= 0; - pthread_mutex_destroy(&LOCK_plugin); + mysql_mutex_destroy(&LOCK_plugin); my_afree(plugins); } @@ -1699,14 +1743,14 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl if (! (table = open_ltable(thd, &tables, TL_WRITE, 0))) DBUG_RETURN(TRUE); - pthread_mutex_lock(&LOCK_plugin); - rw_wrlock(&LOCK_system_variables_hash); + mysql_mutex_lock(&LOCK_plugin); + mysql_rwlock_wrlock(&LOCK_system_variables_hash); my_load_defaults(MYSQL_CONFIG_NAME, load_default_groups, &argc, &argv, NULL); error= plugin_add(thd->mem_root, name, dl, &argc, argv, REPORT_TO_USER); if (argv) free_defaults(argv); - rw_unlock(&LOCK_system_variables_hash); + mysql_rwlock_unlock(&LOCK_system_variables_hash); if (error || !(tmp= plugin_find_internal(name, MYSQL_ANY_PLUGIN))) goto err; @@ -1746,14 +1790,14 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name, const LEX_STRING *dl goto deinit; } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(FALSE); deinit: tmp->state= PLUGIN_IS_DELETED; reap_needed= true; reap_plugins(); err: - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(TRUE); } @@ -1773,7 +1817,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) if (! (table= open_ltable(thd, &tables, TL_WRITE, 0))) DBUG_RETURN(TRUE); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN))) { my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str); @@ -1794,7 +1838,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) else reap_needed= true; reap_plugins(); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); uchar user_key[MAX_KEY_LENGTH]; table->use_all_columns(); @@ -1821,7 +1865,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name) } DBUG_RETURN(FALSE); err: - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_RETURN(TRUE); } @@ -1839,7 +1883,7 @@ bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, state_mask= ~state_mask; // do it only once - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); total= type == MYSQL_ANY_PLUGIN ? plugin_array.elements : plugin_hash[type].records; /* @@ -1864,17 +1908,17 @@ bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, plugins[idx]= !(plugin->state & state_mask) ? plugin : NULL; } } - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); for (idx= 0; idx < total; idx++) { if (unlikely(version != plugin_array_version)) { - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); for (uint i=idx; i < total; i++) if (plugins[i] && plugins[i]->state & state_mask) plugins[i]=0; - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); } plugin= plugins[idx]; /* It will stop iterating on first engine error when "func" returns TRUE */ @@ -2196,12 +2240,12 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length) plugin_ref plugin; DBUG_ENTER("find_sys_var"); - pthread_mutex_lock(&LOCK_plugin); - rw_rdlock(&LOCK_system_variables_hash); + mysql_mutex_lock(&LOCK_plugin); + mysql_rwlock_rdlock(&LOCK_system_variables_hash); if ((var= intern_find_sys_var(str, length)) && (pi= var->cast_pluginvar())) { - rw_unlock(&LOCK_system_variables_hash); + mysql_rwlock_unlock(&LOCK_system_variables_hash); LEX *lex= thd ? thd->lex : 0; if (!(plugin= my_intern_plugin_lock(lex, plugin_int_to_ref(pi->plugin)))) var= NULL; /* failed to lock it, it must be uninstalling */ @@ -2214,8 +2258,8 @@ sys_var *find_sys_var(THD *thd, const char *str, uint length) } } else - rw_unlock(&LOCK_system_variables_hash); - pthread_mutex_unlock(&LOCK_plugin); + mysql_rwlock_unlock(&LOCK_system_variables_hash); + mysql_mutex_unlock(&LOCK_plugin); /* If the variable exists but the plugin it is associated with is not ready @@ -2403,7 +2447,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) { uint idx; - rw_rdlock(&LOCK_system_variables_hash); + mysql_rwlock_rdlock(&LOCK_system_variables_hash); thd->variables.dynamic_variables_ptr= (char*) my_realloc(thd->variables.dynamic_variables_ptr, @@ -2411,9 +2455,9 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); if (global_lock) - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); - safe_mutex_assert_owner(&LOCK_global_system_variables); + mysql_mutex_assert_owner(&LOCK_global_system_variables); memcpy(thd->variables.dynamic_variables_ptr + thd->variables.dynamic_variables_size, @@ -2452,7 +2496,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) } if (global_lock) - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); thd->variables.dynamic_variables_version= global_system_variables.dynamic_variables_version; @@ -2461,7 +2505,7 @@ static uchar *intern_sys_var_ptr(THD* thd, int offset, bool global_lock) thd->variables.dynamic_variables_size= global_system_variables.dynamic_variables_size; - rw_unlock(&LOCK_system_variables_hash); + mysql_rwlock_unlock(&LOCK_system_variables_hash); } return (uchar*)thd->variables.dynamic_variables_ptr + offset; } @@ -2488,11 +2532,11 @@ void plugin_thdvar_init(THD *thd) thd->variables.dynamic_variables_size= 0; thd->variables.dynamic_variables_ptr= 0; - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); thd->variables.table_plugin= my_intern_plugin_lock(NULL, global_system_variables.table_plugin); intern_plugin_unlock(NULL, old_table_plugin); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); DBUG_VOID_RETURN; } @@ -2521,7 +2565,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars) int flags; uint idx; - rw_rdlock(&LOCK_system_variables_hash); + mysql_rwlock_rdlock(&LOCK_system_variables_hash); for (idx= 0; idx < bookmark_hash.records; idx++) { v= (st_bookmark*) my_hash_element(&bookmark_hash, idx); @@ -2541,7 +2585,7 @@ static void cleanup_variables(THD *thd, struct system_variables *vars) *ptr= NULL; } } - rw_unlock(&LOCK_system_variables_hash); + mysql_rwlock_unlock(&LOCK_system_variables_hash); DBUG_ASSERT(vars->table_plugin == NULL); @@ -2558,7 +2602,7 @@ void plugin_thdvar_cleanup(THD *thd) plugin_ref *list; DBUG_ENTER("plugin_thdvar_cleanup"); - pthread_mutex_lock(&LOCK_plugin); + mysql_mutex_lock(&LOCK_plugin); unlock_variables(thd, &thd->variables); cleanup_variables(thd, &thd->variables); @@ -2572,7 +2616,7 @@ void plugin_thdvar_cleanup(THD *thd) } reap_plugins(); - pthread_mutex_unlock(&LOCK_plugin); + mysql_mutex_unlock(&LOCK_plugin); reset_dynamic(&thd->lex->plugins); @@ -2724,11 +2768,11 @@ bool sys_var_pluginvar::session_update(THD *thd, set_var *var) DBUG_ASSERT(plugin_var->flags & PLUGIN_VAR_THDLOCAL); DBUG_ASSERT(thd == current_thd); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); void *tgt= real_value_ptr(thd, var->type); const void *src= var->value ? (void*)&var->save_result : (void*)real_value_ptr(thd, OPT_GLOBAL); - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); plugin_var->update(thd, plugin_var, tgt, src); return false; @@ -2737,7 +2781,7 @@ bool sys_var_pluginvar::session_update(THD *thd, set_var *var) bool sys_var_pluginvar::global_update(THD *thd, set_var *var) { DBUG_ASSERT(!is_readonly()); - safe_mutex_assert_owner(&LOCK_global_system_variables); + mysql_mutex_assert_owner(&LOCK_global_system_variables); void *tgt= real_value_ptr(thd, var->type); const void *src= &var->save_result; @@ -3274,7 +3318,7 @@ static int test_plugin_options(MEM_ROOT *tmp_root, struct st_plugin_int *tmp, if (!tmp->is_mandatory) opts[0].def_value= opts[1].def_value= plugin_load_policy; - error= handle_options(argc, &argv, opts, get_one_plugin_option); + error= handle_options(argc, &argv, opts, NULL); (*argc)++; /* add back one for the program name */ if (error) diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index bec880b21d2..1a870ec260e 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 MySQL AB +/* Copyright (C) 2005 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index f19f12ddc13..63b7649bad5 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 1995-2002 MySQL AB +/* Copyright (C) 1995-2002 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1414,7 +1414,7 @@ static int mysql_test_select(Prepared_statement *stmt, if (check_table_access(thd, privilege, tables, FALSE, UINT_MAX, FALSE)) goto error; } - else if (check_access(thd, privilege, any_db,0,0,0,0)) + else if (check_access(thd, privilege, any_db, NULL, NULL, 0, 0)) goto error; if (!lex->result && !(lex->result= new (stmt->mem_root) select_send)) diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 517fbb97b73..960a0adab2e 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB & Sasha +/* Copyright (C) 2000-2006 MySQL AB & Sasha, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -151,13 +151,14 @@ static int send_file(THD *thd) if (!strcmp(fname,"/dev/null")) goto end; - if ((fd = my_open(fname, O_RDONLY, MYF(0))) < 0) + if ((fd= mysql_file_open(key_file_send_file, + fname, O_RDONLY, MYF(0))) < 0) { errmsg = "on open of file"; goto err; } - while ((long) (bytes= my_read(fd, buf, IO_SIZE, MYF(0))) > 0) + while ((long) (bytes= mysql_file_read(fd, buf, IO_SIZE, MYF(0))) > 0) { if (my_net_write(net, buf, bytes)) { @@ -178,7 +179,7 @@ static int send_file(THD *thd) err: my_net_set_read_timeout(net, old_timeout); if (fd >= 0) - (void) my_close(fd, MYF(0)); + mysql_file_close(fd, MYF(0)); if (errmsg) { sql_print_error("Failed in send_file() %s", errmsg); @@ -221,7 +222,7 @@ void adjust_linfo_offsets(my_off_t purge_offset) LOG_INFO* linfo; if ((linfo = tmp->current_linfo)) { - pthread_mutex_lock(&linfo->lock); + mysql_mutex_lock(&linfo->lock); /* Index file offset can be less that purge offset only if we just started reading the index file. In that case @@ -231,7 +232,7 @@ void adjust_linfo_offsets(my_off_t purge_offset) linfo->fatal = (linfo->index_file_offset != 0); else linfo->index_file_offset -= purge_offset; - pthread_mutex_unlock(&linfo->lock); + mysql_mutex_unlock(&linfo->lock); } } pthread_mutex_unlock(&LOCK_thread_count); @@ -252,10 +253,10 @@ bool log_in_use(const char* log_name) LOG_INFO* linfo; if ((linfo = tmp->current_linfo)) { - pthread_mutex_lock(&linfo->lock); + mysql_mutex_lock(&linfo->lock); result = !bcmp((uchar*) log_name, (uchar*) linfo->log_file_name, log_name_len); - pthread_mutex_unlock(&linfo->lock); + mysql_mutex_unlock(&linfo->lock); if (result) break; } @@ -444,7 +445,7 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, int error; const char *errmsg = "Unknown error"; NET* net = &thd->net; - pthread_mutex_t *log_lock; + mysql_mutex_t *log_lock; bool binlog_can_be_corrupted= FALSE; #ifndef DBUG_OFF int left_events = max_binlog_dump_events; @@ -797,11 +798,11 @@ impossible position"; has not been updated since last read. */ - pthread_mutex_lock(log_lock); - switch (error= Log_event::read_log_event(&log, packet, (pthread_mutex_t*) 0)) { + mysql_mutex_lock(log_lock); + switch (error= Log_event::read_log_event(&log, packet, (mysql_mutex_t*) 0)) { case 0: /* we read successfully, so we'll need to send it to the slave */ - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); read_packet = 1; if (coord) coord->pos= uint4korr(packet->ptr() + ev_offset + LOG_POS_OFFSET); @@ -815,7 +816,7 @@ impossible position"; DBUG_PRINT("wait",("waiting for data in binary log")); if (thd->server_id==0) // for mysqlbinlog (mysqlbinlog.server_id==0) { - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); goto end; } @@ -850,7 +851,7 @@ impossible position"; { errmsg = "Failed on my_net_write()"; my_errno= ER_UNKNOWN_ERROR; - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); goto err; } } @@ -859,12 +860,12 @@ impossible position"; DBUG_PRINT("wait",("binary log received update or a broadcast signal caught")); } } while (signal_cnt == mysql_bin_log.signal_cnt && !thd->killed); - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); } break; default: - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); test_for_non_eof_log_read_errors(error, &errmsg); goto err; } @@ -931,7 +932,7 @@ impossible position"; break; end_io_cache(&log); - (void) my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); /* reset transmit packet for the possible fake rotate event */ if (reset_transmit_packet(thd, flags, &ev_offset, &errmsg)) @@ -961,7 +962,7 @@ impossible position"; end: end_io_cache(&log); - (void)my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags)); my_eof(thd); @@ -986,7 +987,7 @@ err: thd->current_linfo = 0; pthread_mutex_unlock(&LOCK_thread_count); if (file >= 0) - (void) my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); my_message(my_errno, errmsg, MYF(0)); DBUG_VOID_RETURN; @@ -1012,7 +1013,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) int thread_mask; DBUG_ENTER("start_slave"); - if (check_access(thd, SUPER_ACL, any_db,0,0,0,0)) + if (check_access(thd, SUPER_ACL, any_db, NULL, NULL, 0, 0)) DBUG_RETURN(1); lock_slave_threads(mi); // this allows us to cleanly read slave_running // Get a mask of _stopped_ threads @@ -1039,7 +1040,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) */ if (thread_mask & SLAVE_SQL) { - pthread_mutex_lock(&mi->rli.data_lock); + mysql_mutex_lock(&mi->rli.data_lock); if (thd->lex->mi.pos) { @@ -1093,7 +1094,7 @@ int start_slave(THD* thd , Master_info* mi, bool net_report) ER(ER_MISSING_SKIP_SLAVE)); } - pthread_mutex_unlock(&mi->rli.data_lock); + mysql_mutex_unlock(&mi->rli.data_lock); } else if (thd->lex->mi.pos || thd->lex->mi.relay_log_pos) push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_UNTIL_COND_IGNORED, @@ -1152,7 +1153,7 @@ int stop_slave(THD* thd, Master_info* mi, bool net_report ) if (!thd) thd = current_thd; - if (check_access(thd, SUPER_ACL, any_db,0,0,0,0)) + if (check_access(thd, SUPER_ACL, any_db, NULL, NULL, 0, 0)) DBUG_RETURN(1); thd_proc_info(thd, "Killing slave"); int thread_mask; @@ -1250,14 +1251,16 @@ int reset_slave(THD *thd, Master_info* mi) end_master_info(mi); // and delete these two files fn_format(fname, master_info_file, mysql_data_home, "", 4+32); - if (my_stat(fname, &stat_area, MYF(0)) && my_delete(fname, MYF(MY_WME))) + if (mysql_file_stat(key_file_master_info, fname, &stat_area, MYF(0)) && + mysql_file_delete(key_file_master_info, fname, MYF(MY_WME))) { error=1; goto err; } // delete relay_log_info_file fn_format(fname, relay_log_info_file, mysql_data_home, "", 4+32); - if (my_stat(fname, &stat_area, MYF(0)) && my_delete(fname, MYF(MY_WME))) + if (mysql_file_stat(key_file_relay_log_info, fname, &stat_area, MYF(0)) && + mysql_file_delete(key_file_relay_log_info, fname, MYF(MY_WME))) { error=1; goto err; @@ -1275,7 +1278,7 @@ err: Kill all Binlog_dump threads which previously talked to the same slave ("same" means with the same server id). Indeed, if the slave stops, if the - Binlog_dump thread is waiting (pthread_cond_wait) for binlog update, then it + Binlog_dump thread is waiting (mysql_cond_wait) for binlog update, then it will keep existing until a query is written to the binlog. If the master is idle, then this could last long, and if the slave reconnects, we could have 2 Binlog_dump threads in SHOW PROCESSLIST, until a query is written to the @@ -1302,7 +1305,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id) if (tmp->command == COM_BINLOG_DUMP && tmp->server_id == slave_server_id) { - pthread_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete + mysql_mutex_lock(&tmp->LOCK_thd_data); // Lock from delete break; } } @@ -1315,7 +1318,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id) again. We just to do kill the thread ourselves. */ tmp->awake(THD::KILL_QUERY); - pthread_mutex_unlock(&tmp->LOCK_thd_data); + mysql_mutex_unlock(&tmp->LOCK_thd_data); } } @@ -1572,7 +1575,7 @@ bool change_master(THD* thd, Master_info* mi) if (!mi->rli.group_master_log_name[0]) // uninitialized case mi->rli.group_master_log_pos=0; - pthread_mutex_lock(&mi->rli.data_lock); + mysql_mutex_lock(&mi->rli.data_lock); mi->rli.abort_pos_wait++; /* for MASTER_POS_WAIT() to abort */ /* Clear the errors, for a clean start */ mi->rli.clear_error(); @@ -1585,8 +1588,8 @@ bool change_master(THD* thd, Master_info* mi) not exist anymore). */ flush_relay_log_info(&mi->rli); - pthread_cond_broadcast(&mi->data_cond); - pthread_mutex_unlock(&mi->rli.data_lock); + mysql_cond_broadcast(&mi->data_cond); + mysql_mutex_unlock(&mi->rli.data_lock); err: unlock_slave_threads(mi); @@ -1699,7 +1702,7 @@ bool mysql_show_binlog_events(THD* thd) my_off_t pos = max(BIN_LOG_HEADER_SIZE, lex_mi->pos); // user-friendly char search_file_name[FN_REFLEN], *name; const char *log_file_name = lex_mi->log_file_name; - pthread_mutex_t *log_lock = binary_log->get_log_lock(); + mysql_mutex_t *log_lock = binary_log->get_log_lock(); LOG_INFO linfo; Log_event* ev; @@ -1733,7 +1736,7 @@ bool mysql_show_binlog_events(THD* thd) */ thd->variables.max_allowed_packet += MAX_LOG_EVENT_HEADER; - pthread_mutex_lock(log_lock); + mysql_mutex_lock(log_lock); /* open_binlog() sought to position 4. @@ -1743,7 +1746,7 @@ bool mysql_show_binlog_events(THD* thd) This code will fail on a mixed relay log (one which has Format_desc then Rotate then Format_desc). */ - ev = Log_event::read_log_event(&log,(pthread_mutex_t*)0,description_event); + ev= Log_event::read_log_event(&log, (mysql_mutex_t*)0, description_event); if (ev) { if (ev->get_type_code() == FORMAT_DESCRIPTION_EVENT) @@ -1764,7 +1767,7 @@ bool mysql_show_binlog_events(THD* thd) } for (event_count = 0; - (ev = Log_event::read_log_event(&log,(pthread_mutex_t*) 0, + (ev = Log_event::read_log_event(&log, (mysql_mutex_t*) 0, description_event)); ) { if (event_count >= limit_start && @@ -1772,7 +1775,7 @@ bool mysql_show_binlog_events(THD* thd) { errmsg = "Net error"; delete ev; - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); goto err; } @@ -1786,11 +1789,11 @@ bool mysql_show_binlog_events(THD* thd) if (event_count < limit_end && log.error) { errmsg = "Wrong offset or I/O error"; - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); goto err; } - pthread_mutex_unlock(log_lock); + mysql_mutex_unlock(log_lock); } ret= FALSE; @@ -1800,7 +1803,7 @@ err: if (file >= 0) { end_io_cache(&log); - (void) my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); } if (errmsg) @@ -1892,12 +1895,12 @@ bool show_binlogs(THD* thd) Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_RETURN(TRUE); - pthread_mutex_lock(mysql_bin_log.get_log_lock()); + mysql_mutex_lock(mysql_bin_log.get_log_lock()); mysql_bin_log.lock_index(); index_file=mysql_bin_log.get_index_file(); mysql_bin_log.raw_get_current_log(&cur); // dont take mutex - pthread_mutex_unlock(mysql_bin_log.get_log_lock()); // lockdep, OK + mysql_mutex_unlock(mysql_bin_log.get_log_lock()); // lockdep, OK cur_dir_len= dirname_length(cur.log_file_name); @@ -1920,11 +1923,12 @@ bool show_binlogs(THD* thd) else { /* this is an old log, open it and find the size */ - if ((file= my_open(fname, O_RDONLY | O_SHARE | O_BINARY, - MYF(0))) >= 0) + if ((file= mysql_file_open(key_file_binlog, + fname, O_RDONLY | O_SHARE | O_BINARY, + MYF(0))) >= 0) { - file_length= (ulonglong) my_seek(file, 0L, MY_SEEK_END, MYF(0)); - my_close(file, MYF(0)); + file_length= (ulonglong) mysql_file_seek(file, 0L, MY_SEEK_END, MYF(0)); + mysql_file_close(file, MYF(0)); } } protocol->store(file_length); diff --git a/sql/sql_servers.cc b/sql/sql_servers.cc index cde0a5c5069..141e00cf50f 100644 --- a/sql/sql_servers.cc +++ b/sql/sql_servers.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2003 MySQL AB +/* Copyright (C) 2000-2003 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ static HASH servers_cache; static MEM_ROOT mem; -static rw_lock_t THR_LOCK_servers; +static mysql_rwlock_t THR_LOCK_servers; static bool get_server_from_table_to_cache(TABLE *table); @@ -89,6 +89,26 @@ static uchar *servers_cache_get_key(FOREIGN_SERVER *server, size_t *length, DBUG_RETURN((uchar*) server->server_name); } +#ifdef HAVE_PSI_INTERFACE +static PSI_rwlock_key key_rwlock_THR_LOCK_servers; + +static PSI_rwlock_info all_servers_cache_rwlocks[]= +{ + { &key_rwlock_THR_LOCK_servers, "THR_LOCK_servers", PSI_FLAG_GLOBAL} +}; + +static void init_servers_cache_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_servers_cache_rwlocks); + PSI_server->register_rwlock(category, all_servers_cache_rwlocks, count); +} +#endif /* HAVE_PSI_INTERFACE */ /* Initialize structures responsible for servers used in federated @@ -115,8 +135,12 @@ bool servers_init(bool dont_read_servers_table) bool return_val= FALSE; DBUG_ENTER("servers_init"); +#ifdef HAVE_PSI_INTERFACE + init_servers_cache_psi_keys(); +#endif + /* init the mutex */ - if (my_rwlock_init(&THR_LOCK_servers, NULL)) + if (mysql_rwlock_init(key_rwlock_THR_LOCK_servers, &THR_LOCK_servers)) DBUG_RETURN(TRUE); /* initialise our servers cache */ @@ -231,7 +255,7 @@ bool servers_reload(THD *thd) } DBUG_PRINT("info", ("locking servers_cache")); - rw_wrlock(&THR_LOCK_servers); + mysql_rwlock_wrlock(&THR_LOCK_servers); bzero((char*) tables, sizeof(tables)); tables[0].alias= tables[0].table_name= (char*) "servers"; @@ -256,7 +280,7 @@ bool servers_reload(THD *thd) end: close_thread_tables(thd); DBUG_PRINT("info", ("unlocking servers_cache")); - rw_unlock(&THR_LOCK_servers); + mysql_rwlock_unlock(&THR_LOCK_servers); DBUG_RETURN(return_val); } @@ -586,7 +610,7 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options) tables.db= (char*) "mysql"; tables.alias= tables.table_name= (char*) "servers"; - rw_wrlock(&THR_LOCK_servers); + mysql_rwlock_wrlock(&THR_LOCK_servers); /* hit the memory hit first */ if ((error= delete_server_record_in_cache(server_options))) @@ -610,7 +634,7 @@ int drop_server(THD *thd, LEX_SERVER_OPTIONS *server_options) } end: - rw_unlock(&THR_LOCK_servers); + mysql_rwlock_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } @@ -962,7 +986,7 @@ int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options) DBUG_PRINT("info", ("server_options->server_name %s", server_options->server_name)); - rw_wrlock(&THR_LOCK_servers); + mysql_rwlock_wrlock(&THR_LOCK_servers); /* hit the memory first */ if (my_hash_search(&servers_cache, (uchar*) server_options->server_name, @@ -983,7 +1007,7 @@ int create_server(THD *thd, LEX_SERVER_OPTIONS *server_options) DBUG_PRINT("info", ("error returned %d", error)); end: - rw_unlock(&THR_LOCK_servers); + mysql_rwlock_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } @@ -1012,7 +1036,7 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) DBUG_PRINT("info", ("server_options->server_name %s", server_options->server_name)); - rw_wrlock(&THR_LOCK_servers); + mysql_rwlock_wrlock(&THR_LOCK_servers); if (!(existing= (FOREIGN_SERVER *) my_hash_search(&servers_cache, (uchar*) name.str, @@ -1037,7 +1061,7 @@ int alter_server(THD *thd, LEX_SERVER_OPTIONS *server_options) end: DBUG_PRINT("info", ("error returned %d", error)); - rw_unlock(&THR_LOCK_servers); + mysql_rwlock_unlock(&THR_LOCK_servers); DBUG_RETURN(error); } @@ -1203,7 +1227,7 @@ void servers_free(bool end) my_hash_reset(&servers_cache); DBUG_VOID_RETURN; } - rwlock_destroy(&THR_LOCK_servers); + mysql_rwlock_destroy(&THR_LOCK_servers); free_root(&mem,MYF(0)); my_hash_free(&servers_cache); DBUG_VOID_RETURN; @@ -1285,7 +1309,7 @@ FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name, } DBUG_PRINT("info", ("locking servers_cache")); - rw_rdlock(&THR_LOCK_servers); + mysql_rwlock_rdlock(&THR_LOCK_servers); if (!(server= (FOREIGN_SERVER *) my_hash_search(&servers_cache, (uchar*) server_name, server_name_length))) @@ -1299,7 +1323,7 @@ FOREIGN_SERVER *get_server_by_name(MEM_ROOT *mem, const char *server_name, server= clone_server(mem, server, buff); DBUG_PRINT("info", ("unlocking servers_cache")); - rw_unlock(&THR_LOCK_servers); + mysql_rwlock_unlock(&THR_LOCK_servers); DBUG_RETURN(server); } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ece6cb7a4db..d562739f913 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -433,7 +433,7 @@ find_files(THD *thd, List *files, const char *db, end= strend(buff); if (end != buff && end[-1] == FN_LIBCHAR) end[-1]= 0; // Remove end FN_LIBCHAR - if (!my_stat(buff, file->mystat, MYF(0))) + if (!mysql_file_stat(key_file_misc, buff, file->mystat, MYF(0))) continue; } #endif @@ -1769,13 +1769,13 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) thd_info->start_time= tmp->start_time; thd_info->query=0; /* Lock THD mutex that protects its data when looking at it. */ - pthread_mutex_lock(&tmp->LOCK_thd_data); + mysql_mutex_lock(&tmp->LOCK_thd_data); if (tmp->query()) { uint length= min(max_query_length, tmp->query_length()); thd_info->query= (char*) thd->strmake(tmp->query(),length); } - pthread_mutex_unlock(&tmp->LOCK_thd_data); + mysql_mutex_unlock(&tmp->LOCK_thd_data); thread_infos.append(thd_info); } } @@ -2147,7 +2147,7 @@ static bool show_status_array(THD *thd, const char *wild, char *value=var->value; const char *pos, *end; // We assign a lot of const's - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); if (show_type == SHOW_SYS) { @@ -2244,7 +2244,7 @@ static bool show_status_array(THD *thd, const char *wild, thd->count_cuted_fields= CHECK_FIELD_IGNORE; table->field[1]->set_notnull(); - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); if (schema_table_store_record(thd, table)) { @@ -3289,8 +3289,8 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) while ((db_name= it++)) { #ifndef NO_EMBEDDED_ACCESS_CHECKS - if (!check_access(thd,SELECT_ACL, db_name->str, - &thd->col_access, 0, 1, with_i_schema) || + if (!check_access(thd, SELECT_ACL, db_name->str, + &thd->col_access, NULL, 0, 1) || sctx->master_access & (DB_ACLS | SHOW_DB_ACL) || acl_get(sctx->host, sctx->ip, sctx->priv_user, db_name->str, 0) || !check_grant_db(thd, db_name->str)) @@ -3488,7 +3488,7 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) path_len= build_table_filename(path, sizeof(path) - 1, lookup_field_vals.db_value.str, "", "", 0); path[path_len-1]= 0; - if (!my_stat(path,&stat_info,MYF(0))) + if (!mysql_file_stat(key_file_misc, path, &stat_info, MYF(0))) DBUG_RETURN(0); } @@ -3778,9 +3778,10 @@ static int get_schema_column_record(THD *thd, TABLE_LIST *tables, #ifndef NO_EMBEDDED_ACCESS_CHECKS uint col_access; - check_access(thd,SELECT_ACL, db_name->str, - &tables->grant.privilege, FALSE, FALSE, - test(tables->schema_table)); + check_access(thd, SELECT_ACL, db_name->str, + &tables->grant.privilege, + &tables->grant.m_internal, + FALSE, FALSE); col_access= get_column_grant(thd, &tables->grant, db_name->str, table_name->str, field->field_name) & COL_ACLS; @@ -5309,8 +5310,7 @@ copy_event_to_schema_table(THD *thd, TABLE *sch_table, TABLE *event_table) has access. */ if (thd->lex->sql_command != SQLCOM_SHOW_EVENTS && - check_access(thd, EVENT_ACL, et.dbname.str, 0, 0, 1, - is_schema_db(et.dbname.str))) + check_access(thd, EVENT_ACL, et.dbname.str, NULL, NULL, 0, 1)) DBUG_RETURN(0); sch_table->field[ISE_EVENT_CATALOG]->store(STRING_WITH_LEN("def"), scs); @@ -5494,10 +5494,10 @@ int fill_variables(THD *thd, TABLE_LIST *tables, COND *cond) schema_table_idx == SCH_GLOBAL_VARIABLES) option_type= OPT_GLOBAL; - rw_rdlock(&LOCK_system_variables_hash); + mysql_rwlock_rdlock(&LOCK_system_variables_hash); res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars, option_type), option_type, NULL, "", tables->table, upper_case_names, cond); - rw_unlock(&LOCK_system_variables_hash); + mysql_rwlock_unlock(&LOCK_system_variables_hash); DBUG_RETURN(res); } @@ -7316,6 +7316,56 @@ bool show_create_trigger(THD *thd, const sp_name *trg_name) */ } +class IS_internal_schema_access : public ACL_internal_schema_access +{ +public: + IS_internal_schema_access() + {} + + ~IS_internal_schema_access() + {} + + ACL_internal_access_result check(ulong want_access, + ulong *save_priv) const; + + const ACL_internal_table_access *lookup(const char *name) const; +}; + +ACL_internal_access_result +IS_internal_schema_access::check(ulong want_access, + ulong *save_priv) const +{ + want_access &= ~SELECT_ACL; + + /* + We don't allow any simple privileges but SELECT_ACL on + the information_schema database. + */ + if (unlikely(want_access & DB_ACLS)) + return ACL_INTERNAL_ACCESS_DENIED; + + /* Always grant SELECT for the information schema. */ + *save_priv|= SELECT_ACL; + + return want_access ? ACL_INTERNAL_ACCESS_CHECK_GRANT : + ACL_INTERNAL_ACCESS_GRANTED; +} + +const ACL_internal_table_access * +IS_internal_schema_access::lookup(const char *name) const +{ + /* There are no per table rules for the information schema. */ + return NULL; +} + +static IS_internal_schema_access is_internal_schema_access; + +void initialize_information_schema_acl() +{ + ACL_internal_schema_registry::register_schema(&INFORMATION_SCHEMA_NAME, + &is_internal_schema_access); +} + /* Convert a string in character set in column character set format to utf8 character set if possible, the utf8 character set string diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 633c405ea25..190c1cb9c70 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -607,7 +607,7 @@ struct st_global_ddl_log st_global_ddl_log global_ddl_log; -pthread_mutex_t LOCK_gdl; +mysql_mutex_t LOCK_gdl; #define DDL_LOG_ENTRY_TYPE_POS 0 #define DDL_LOG_ACTION_TYPE_POS 1 @@ -637,8 +637,8 @@ static bool read_ddl_log_file_entry(uint entry_no) uint io_size= global_ddl_log.io_size; DBUG_ENTER("read_ddl_log_file_entry"); - if (my_pread(file_id, file_entry_buf, io_size, io_size * entry_no, - MYF(MY_WME)) != io_size) + if (mysql_file_pread(file_id, file_entry_buf, io_size, io_size * entry_no, + MYF(MY_WME)) != io_size) error= TRUE; DBUG_RETURN(error); } @@ -661,8 +661,8 @@ static bool write_ddl_log_file_entry(uint entry_no) char *file_entry_buf= (char*)global_ddl_log.file_entry_buf; DBUG_ENTER("write_ddl_log_file_entry"); - if (my_pwrite(file_id, (uchar*)file_entry_buf, - IO_SIZE, IO_SIZE * entry_no, MYF(MY_WME)) != IO_SIZE) + if (mysql_file_pwrite(file_id, (uchar*)file_entry_buf, + IO_SIZE, IO_SIZE * entry_no, MYF(MY_WME)) != IO_SIZE) error= TRUE; DBUG_RETURN(error); } @@ -738,8 +738,9 @@ static uint read_ddl_log_header() DBUG_ENTER("read_ddl_log_header"); create_ddl_log_file_name(file_name); - if ((global_ddl_log.file_id= my_open(file_name, - O_RDWR | O_BINARY, MYF(0))) >= 0) + if ((global_ddl_log.file_id= mysql_file_open(key_file_global_ddl_log, + file_name, + O_RDWR | O_BINARY, MYF(0))) >= 0) { if (read_ddl_log_file_entry(0UL)) { @@ -764,7 +765,7 @@ static uint read_ddl_log_header() global_ddl_log.first_free= NULL; global_ddl_log.first_used= NULL; global_ddl_log.num_entries= 0; - pthread_mutex_init(&LOCK_gdl, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_gdl, &LOCK_gdl, MY_MUTEX_INIT_FAST); global_ddl_log.do_release= true; DBUG_RETURN(entry_no); } @@ -834,10 +835,10 @@ static bool init_ddl_log() global_ddl_log.io_size= IO_SIZE; create_ddl_log_file_name(file_name); - if ((global_ddl_log.file_id= my_create(file_name, - CREATE_MODE, - O_RDWR | O_TRUNC | O_BINARY, - MYF(MY_WME))) < 0) + if ((global_ddl_log.file_id= mysql_file_create(key_file_global_ddl_log, + file_name, CREATE_MODE, + O_RDWR | O_TRUNC | O_BINARY, + MYF(MY_WME))) < 0) { /* Couldn't create ddl log file, this is serious error */ sql_print_error("Failed to open ddl log file"); @@ -846,7 +847,7 @@ static bool init_ddl_log() global_ddl_log.inited= TRUE; if (write_ddl_log_header()) { - (void) my_close(global_ddl_log.file_id, MYF(MY_WME)); + (void) mysql_file_close(global_ddl_log.file_id, MYF(MY_WME)); global_ddl_log.inited= FALSE; DBUG_RETURN(TRUE); } @@ -916,14 +917,14 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) if (frm_action) { strxmov(to_path, ddl_log_entry->name, reg_ext, NullS); - if ((error= my_delete(to_path, MYF(MY_WME)))) + if ((error= mysql_file_delete(key_file_frm, to_path, MYF(MY_WME)))) { if (my_errno != ENOENT) break; } #ifdef WITH_PARTITION_STORAGE_ENGINE strxmov(to_path, ddl_log_entry->name, par_ext, NullS); - (void) my_delete(to_path, MYF(MY_WME)); + (void) mysql_file_delete(key_file_partition, to_path, MYF(MY_WME)); #endif } else @@ -955,12 +956,12 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) { strxmov(to_path, ddl_log_entry->name, reg_ext, NullS); strxmov(from_path, ddl_log_entry->from_name, reg_ext, NullS); - if (my_rename(from_path, to_path, MYF(MY_WME))) + if (mysql_file_rename(key_file_frm, from_path, to_path, MYF(MY_WME))) break; #ifdef WITH_PARTITION_STORAGE_ENGINE strxmov(to_path, ddl_log_entry->name, par_ext, NullS); strxmov(from_path, ddl_log_entry->from_name, par_ext, NullS); - (void) my_rename(from_path, to_path, MYF(MY_WME)); + (void) mysql_file_rename(key_file_partition, from_path, to_path, MYF(MY_WME)); #endif } else @@ -1277,7 +1278,7 @@ bool sync_ddl_log() { DBUG_RETURN(TRUE); } - if (my_sync(global_ddl_log.file_id, MYF(0))) + if (mysql_file_sync(global_ddl_log.file_id, MYF(0))) { /* Write to error log */ sql_print_error("Failed to sync ddl log"); @@ -1333,7 +1334,7 @@ bool execute_ddl_log_entry(THD *thd, uint first_entry) uint read_entry= first_entry; DBUG_ENTER("execute_ddl_log_entry"); - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); do { if (read_ddl_log_entry(read_entry, &ddl_log_entry)) @@ -1355,7 +1356,7 @@ bool execute_ddl_log_entry(THD *thd, uint first_entry) } read_entry= ddl_log_entry.next_entry; } while (read_entry); - pthread_mutex_unlock(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(FALSE); } @@ -1373,7 +1374,7 @@ static void close_ddl_log() DBUG_ENTER("close_ddl_log"); if (global_ddl_log.file_id >= 0) { - (void) my_close(global_ddl_log.file_id, MYF(MY_WME)); + (void) mysql_file_close(global_ddl_log.file_id, MYF(MY_WME)); global_ddl_log.file_id= (File) -1; } DBUG_VOID_RETURN; @@ -1433,7 +1434,7 @@ void execute_ddl_log_recovery() } close_ddl_log(); create_ddl_log_file_name(file_name); - (void) my_delete(file_name, MYF(0)); + (void) mysql_file_delete(key_file_global_ddl_log, file_name, MYF(0)); global_ddl_log.recovery_phase= FALSE; delete thd; /* Remember that we don't have a THD */ @@ -1459,7 +1460,7 @@ void release_ddl_log() if (!global_ddl_log.do_release) DBUG_VOID_RETURN; - pthread_mutex_lock(&LOCK_gdl); + mysql_mutex_lock(&LOCK_gdl); while (used_list) { DDL_LOG_MEMORY_ENTRY *tmp= used_list->next_log_entry; @@ -1474,8 +1475,8 @@ void release_ddl_log() } close_ddl_log(); global_ddl_log.inited= 0; - pthread_mutex_unlock(&LOCK_gdl); - pthread_mutex_destroy(&LOCK_gdl); + mysql_mutex_unlock(&LOCK_gdl); + mysql_mutex_destroy(&LOCK_gdl); global_ddl_log.do_release= false; DBUG_VOID_RETURN; } @@ -1607,7 +1608,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) CHF_CREATE_FLAG, lpt->create_info)) { - my_delete(shadow_frm_name, MYF(0)); + mysql_file_delete(key_file_frm, shadow_frm_name, MYF(0)); error= 1; goto end; } @@ -1631,7 +1632,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) error= 1; goto end; } - error= my_delete(shadow_frm_name, MYF(MY_WME)); + error= mysql_file_delete(key_file_frm, shadow_frm_name, MYF(MY_WME)); } if (flags & WFRM_INSTALL_SHADOW) { @@ -1655,7 +1656,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) deactivate it. */ mysql_mutex_lock(&LOCK_open); - if (my_delete(frm_name, MYF(MY_WME)) || + if (mysql_file_delete(key_file_frm, frm_name, MYF(MY_WME)) || #ifdef WITH_PARTITION_STORAGE_ENGINE lpt->table->file->ha_create_handler_files(path, shadow_path, CHF_DELETE_FLAG, NULL) || @@ -1663,11 +1664,13 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) (sync_ddl_log(), FALSE) || #endif #ifdef WITH_PARTITION_STORAGE_ENGINE - my_rename(shadow_frm_name, frm_name, MYF(MY_WME)) || + mysql_file_rename(key_file_frm, + shadow_frm_name, frm_name, MYF(MY_WME)) || lpt->table->file->ha_create_handler_files(path, shadow_path, CHF_RENAME_FLAG, NULL)) #else - my_rename(shadow_frm_name, frm_name, MYF(MY_WME))) + mysql_file_rename(key_file_frm, + shadow_frm_name, frm_name, MYF(MY_WME))) #endif { error= 1; @@ -1888,7 +1891,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, table->db_type= share->db_type(); /* Disable drop of enabled log tables */ - if (share && (share->table_category == TABLE_CATEGORY_PERFORMANCE) && + if (share && (share->table_category == TABLE_CATEGORY_LOG) && check_if_log_table(table->db_length, table->db, table->table_name_length, table->table_name, 1)) { @@ -2043,7 +2046,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, int new_error; /* Delete the table definition file */ strmov(end,reg_ext); - if (!(new_error=my_delete(path,MYF(MY_WME)))) + if (!(new_error= mysql_file_delete(key_file_frm, path, MYF(MY_WME)))) { some_tables_deleted=1; new_error= Table_triggers_list::drop_all_triggers(thd, db, @@ -2186,7 +2189,7 @@ bool quick_rm_table(handlerton *base,const char *db, uint path_length= build_table_filename(path, sizeof(path) - 1, db, table_name, reg_ext, flags); - if (my_delete(path,MYF(0))) + if (mysql_file_delete(key_file_frm, path, MYF(0))) error= 1; /* purecov: inspected */ path[path_length - reg_ext_length]= '\0'; // Remove reg_ext if (!(flags & FRM_ONLY)) @@ -4414,7 +4417,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, // Name of data file strxmov(from, table->s->normalized_path.str, ext[1], NullS); - if (!my_stat(from, &stat_info, MYF(0))) + if (!mysql_file_stat(key_file_misc, from, &stat_info, MYF(0))) goto end; // Can't use USE_FRM flag my_snprintf(tmp, sizeof(tmp), "%s-%lx_%lx", @@ -4432,7 +4435,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, error= -1; goto end; } - if (my_rename(from, tmp, MYF(MY_WME))) + if (mysql_file_rename(key_file_misc, from, tmp, MYF(MY_WME))) { mysql_mutex_lock(&LOCK_open); unlock_table_name(thd, table_list); @@ -4450,7 +4453,7 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list, "Failed generating table from .frm file"); goto end; } - if (my_rename(tmp, from, MYF(MY_WME))) + if (mysql_file_rename(key_file_misc, tmp, from, MYF(MY_WME))) { mysql_mutex_lock(&LOCK_open); unlock_table_name(thd, table_list); @@ -5042,14 +5045,14 @@ bool mysql_assign_to_keycache(THD* thd, TABLE_LIST* tables, DBUG_ENTER("mysql_assign_to_keycache"); check_opt.init(); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); if (!(key_cache= get_key_cache(key_cache_name))) { - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); my_error(ER_UNKNOWN_KEY_CACHE, MYF(0), key_cache_name->str); DBUG_RETURN(TRUE); } - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); check_opt.key_cache= key_cache; DBUG_RETURN(mysql_admin_table(thd, tables, &check_opt, "assign_to_keycache", TL_READ_NO_INSERT, 0, 0, diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc index 4ab9bba03ae..6f0602cedfd 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -804,7 +804,7 @@ bool Table_triggers_list::create_trigger(THD *thd, TABLE_LIST *tables, return 0; err_with_cleanup: - my_delete(trigname_buff, MYF(MY_WME)); + mysql_file_delete(key_file_trn, trigname_buff, MYF(MY_WME)); return 1; } @@ -827,7 +827,7 @@ static bool rm_trigger_file(char *path, const char *db, const char *table_name) { build_table_filename(path, FN_REFLEN-1, db, table_name, TRG_EXT, 0); - return my_delete(path, MYF(MY_WME)); + return mysql_file_delete(key_file_trg, path, MYF(MY_WME)); } @@ -849,7 +849,7 @@ static bool rm_trigname_file(char *path, const char *db, const char *trigger_name) { build_table_filename(path, FN_REFLEN - 1, db, trigger_name, TRN_EXT, 0); - return my_delete(path, MYF(MY_WME)); + return mysql_file_delete(key_file_trn, path, MYF(MY_WME)); } diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc index 3a7309a0ea4..94e9fde6a33 100644 --- a/sql/sql_udf.cc +++ b/sql/sql_udf.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000 MySQL AB +/* Copyright (C) 2000 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ extern "C" static bool initialized = 0; static MEM_ROOT mem; static HASH udf_hash; -static rw_lock_t THR_LOCK_udf; +static mysql_rwlock_t THR_LOCK_udf; static udf_func *add_udf(LEX_STRING *name, Item_result ret, @@ -100,6 +100,26 @@ extern "C" uchar* get_hash_key(const uchar *buff, size_t *length, return (uchar*) udf->name.str; } +#ifdef HAVE_PSI_INTERFACE +static PSI_rwlock_key key_rwlock_THR_LOCK_udf; + +static PSI_rwlock_info all_udf_rwlocks[]= +{ + { &key_rwlock_THR_LOCK_udf, "THR_LOCK_udf", PSI_FLAG_GLOBAL} +}; + +static void init_udf_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_udf_rwlocks); + PSI_server->register_rwlock(category, all_udf_rwlocks, count); +} +#endif /* Read all predeclared functions from mysql.func and accept all that @@ -119,8 +139,12 @@ void udf_init() if (initialized) DBUG_VOID_RETURN; - my_rwlock_init(&THR_LOCK_udf,NULL); - +#ifdef HAVE_PSI_INTERFACE + init_udf_psi_keys(); +#endif + + mysql_rwlock_init(key_rwlock_THR_LOCK_udf, &THR_LOCK_udf); + init_sql_alloc(&mem, UDF_ALLOC_BLOCK_SIZE, 0); THD *new_thd = new THD; if (!new_thd || @@ -256,7 +280,7 @@ void udf_free() if (initialized) { initialized= 0; - rwlock_destroy(&THR_LOCK_udf); + mysql_rwlock_destroy(&THR_LOCK_udf); } DBUG_VOID_RETURN; } @@ -294,7 +318,7 @@ void free_udf(udf_func *udf) if (!initialized) DBUG_VOID_RETURN; - rw_wrlock(&THR_LOCK_udf); + mysql_rwlock_wrlock(&THR_LOCK_udf); if (!--udf->usage_count) { /* @@ -306,7 +330,7 @@ void free_udf(udf_func *udf) if (!find_udf_dl(udf->dl)) dlclose(udf->dlhandle); } - rw_unlock(&THR_LOCK_udf); + mysql_rwlock_unlock(&THR_LOCK_udf); DBUG_VOID_RETURN; } @@ -323,9 +347,9 @@ udf_func *find_udf(const char *name,uint length,bool mark_used) /* TODO: This should be changed to reader locks someday! */ if (mark_used) - rw_wrlock(&THR_LOCK_udf); /* Called during fix_fields */ + mysql_rwlock_wrlock(&THR_LOCK_udf); /* Called during fix_fields */ else - rw_rdlock(&THR_LOCK_udf); /* Called during parsing */ + mysql_rwlock_rdlock(&THR_LOCK_udf); /* Called during parsing */ if ((udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) name, length ? length : (uint) strlen(name)))) @@ -335,7 +359,7 @@ udf_func *find_udf(const char *name,uint length,bool mark_used) else if (mark_used) udf->usage_count++; } - rw_unlock(&THR_LOCK_udf); + mysql_rwlock_unlock(&THR_LOCK_udf); DBUG_RETURN(udf); } @@ -439,7 +463,7 @@ int mysql_create_function(THD *thd,udf_func *udf) if (thd->current_stmt_binlog_row_based) thd->clear_current_stmt_binlog_row_based(); - rw_wrlock(&THR_LOCK_udf); + mysql_rwlock_wrlock(&THR_LOCK_udf); if ((my_hash_search(&udf_hash,(uchar*) udf->name.str, udf->name.length))) { my_error(ER_UDF_EXISTS, MYF(0), udf->name.str); @@ -502,7 +526,7 @@ int mysql_create_function(THD *thd,udf_func *udf) del_udf(u_d); goto err; } - rw_unlock(&THR_LOCK_udf); + mysql_rwlock_unlock(&THR_LOCK_udf); /* Binlog the create function. */ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) @@ -512,7 +536,7 @@ int mysql_create_function(THD *thd,udf_func *udf) err: if (new_dl) dlclose(dl); - rw_unlock(&THR_LOCK_udf); + mysql_rwlock_unlock(&THR_LOCK_udf); DBUG_RETURN(1); } @@ -542,7 +566,7 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) if (thd->current_stmt_binlog_row_based) thd->clear_current_stmt_binlog_row_based(); - rw_wrlock(&THR_LOCK_udf); + mysql_rwlock_wrlock(&THR_LOCK_udf); if (!(udf=(udf_func*) my_hash_search(&udf_hash,(uchar*) udf_name->str, (uint) udf_name->length))) { @@ -577,14 +601,14 @@ int mysql_drop_function(THD *thd,const LEX_STRING *udf_name) } close_thread_tables(thd); - rw_unlock(&THR_LOCK_udf); + mysql_rwlock_unlock(&THR_LOCK_udf); /* Binlog the drop function. */ if (write_bin_log(thd, TRUE, thd->query(), thd->query_length())) DBUG_RETURN(1); DBUG_RETURN(0); err: - rw_unlock(&THR_LOCK_udf); + mysql_rwlock_unlock(&THR_LOCK_udf); DBUG_RETURN(1); } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index b197434d798..dec83f199ab 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1074,9 +1074,10 @@ reopen_tables: if (!tl->derived) { uint want_privilege= tl->updating ? UPDATE_ACL : SELECT_ACL; - if (check_access(thd, want_privilege, - tl->db, &tl->grant.privilege, 0, 0, - test(tl->schema_table)) || + if (check_access(thd, want_privilege, tl->db, + &tl->grant.privilege, + &tl->grant.m_internal, + 0, 0) || check_grant(thd, want_privilege, tl, FALSE, 1, FALSE)) DBUG_RETURN(TRUE); } diff --git a/sql/sql_view.cc b/sql/sql_view.cc index cb60c3b34e4..e088eb1ff59 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -258,12 +258,16 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view, checked that we have not more privileges on correspondent column of view table (i.e. user will not get some privileges by view creation) */ - if ((check_access(thd, CREATE_VIEW_ACL, view->db, &view->grant.privilege, - 0, 0, is_schema_db(view->db)) || + if ((check_access(thd, CREATE_VIEW_ACL, view->db, + &view->grant.privilege, + &view->grant.m_internal, + 0, 0) || check_grant(thd, CREATE_VIEW_ACL, view, FALSE, 1, FALSE)) || (mode != VIEW_CREATE_NEW && - (check_access(thd, DROP_ACL, view->db, &view->grant.privilege, - 0, 0, is_schema_db(view->db)) || + (check_access(thd, DROP_ACL, view->db, + &view->grant.privilege, + &view->grant.m_internal, + 0, 0) || check_grant(thd, DROP_ACL, view, FALSE, 1, FALSE)))) goto err; @@ -313,7 +317,9 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view, if (!tbl->table_in_first_from_clause) { if (check_access(thd, SELECT_ACL, tbl->db, - &tbl->grant.privilege, 0, 0, test(tbl->schema_table)) || + &tbl->grant.privilege, + &tbl->grant.m_internal, + 0, 0) || check_grant(thd, SELECT_ACL, tbl, FALSE, 1, FALSE)) goto err; } @@ -1608,7 +1614,7 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode) } continue; } - if (my_delete(path, MYF(MY_WME))) + if (mysql_file_delete(key_file_frm, path, MYF(MY_WME))) error= TRUE; some_views_deleted= TRUE; @@ -1620,10 +1626,10 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode) if ((share= get_cached_table_share(view->db, view->table_name))) { DBUG_ASSERT(share->ref_count == 0); - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); share->ref_count++; share->version= 0; - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); release_table_share(share, RELEASE_WAIT_FOR_DROP); } query_cache_invalidate3(thd, view, 0); @@ -1683,10 +1689,11 @@ frm_type_enum mysql_frm_type(THD *thd, char *path, enum legacy_db_type *dbt) *dbt= DB_TYPE_UNKNOWN; - if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0) + if ((file= mysql_file_open(key_file_frm, + path, O_RDONLY | O_SHARE, MYF(0))) < 0) DBUG_RETURN(FRMTYPE_ERROR); - error= my_read(file, (uchar*) header, sizeof(header), MYF(MY_NABP)); - my_close(file, MYF(MY_WME)); + error= mysql_file_read(file, (uchar*) header, sizeof(header), MYF(MY_NABP)); + mysql_file_close(file, MYF(MY_WME)); if (error) DBUG_RETURN(FRMTYPE_ERROR); diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index da507edbdb4..1bac48d053f 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc. +/* Copyright (C) 2002-2006 MySQL AB, 2009-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,6 +34,10 @@ #include "slave.h" #include "rpl_mi.h" +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE +#include "../storage/perfschema/pfs_server.h" +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + /* The rule for this file: everything should be 'static'. When a sys_var variable or a function from this file is - in very rare cases - needed @@ -42,6 +46,141 @@ */ #define export /* not static */ +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE + +#define PFS_TRAILING_PROPERTIES \ + NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(NULL), ON_UPDATE(NULL), \ + 0, NULL, sys_var::PARSE_EARLY + +static Sys_var_mybool Sys_pfs_enabled( + "performance_schema", + "Enable the performance schema.", + READ_ONLY GLOBAL_VAR(pfs_param.m_enabled), + CMD_LINE(OPT_ARG), DEFAULT(FALSE), + PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_events_waits_history_long_size( + "performance_schema_events_waits_history_long_size", + "Number of rows in EVENTS_WAITS_HISTORY_LONG.", + READ_ONLY GLOBAL_VAR(pfs_param.m_events_waits_history_long_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_WAITS_HISTORY_LONG_SIZE), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_events_waits_history_size( + "performance_schema_events_waits_history_size", + "Number of rows per thread in EVENTS_WAITS_HISTORY.", + READ_ONLY GLOBAL_VAR(pfs_param.m_events_waits_history_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024), + DEFAULT(PFS_WAITS_HISTORY_SIZE), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_cond_classes( + "performance_schema_max_cond_classes", + "Maximum number of condition instruments.", + READ_ONLY GLOBAL_VAR(pfs_param.m_cond_class_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256), + DEFAULT(PFS_MAX_COND_CLASS), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_cond_instances( + "performance_schema_max_cond_instances", + "Maximum number of instrumented condition objects.", + READ_ONLY GLOBAL_VAR(pfs_param.m_cond_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_COND), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_file_classes( + "performance_schema_max_file_classes", + "Maximum number of file instruments.", + READ_ONLY GLOBAL_VAR(pfs_param.m_file_class_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256), + DEFAULT(PFS_MAX_FILE_CLASS), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_file_handles( + "performance_schema_max_file_handles", + "Maximum number of opened instrumented files.", + READ_ONLY GLOBAL_VAR(pfs_param.m_file_handle_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_FILE_HANDLE), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_file_instances( + "performance_schema_max_file_instances", + "Maximum number of instrumented files.", + READ_ONLY GLOBAL_VAR(pfs_param.m_file_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_FILE), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_mutex_classes( + "performance_schema_max_mutex_classes", + "Maximum number of mutex instruments.", + READ_ONLY GLOBAL_VAR(pfs_param.m_mutex_class_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256), + DEFAULT(PFS_MAX_MUTEX_CLASS), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_mutex_instances( + "performance_schema_max_mutex_instances", + "Maximum number of instrumented MUTEX objects.", + READ_ONLY GLOBAL_VAR(pfs_param.m_mutex_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_MUTEX), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_rwlock_classes( + "performance_schema_max_rwlock_classes", + "Maximum number of rwlock instruments.", + READ_ONLY GLOBAL_VAR(pfs_param.m_rwlock_class_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256), + DEFAULT(PFS_MAX_RWLOCK_CLASS), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_rwlock_instances( + "performance_schema_max_rwlock_instances", + "Maximum number of instrumented RWLOCK objects.", + READ_ONLY GLOBAL_VAR(pfs_param.m_rwlock_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_RWLOCK), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_table_handles( + "performance_schema_max_table_handles", + "Maximum number of opened instrumented tables.", + READ_ONLY GLOBAL_VAR(pfs_param.m_table_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_TABLE), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_table_instances( + "performance_schema_max_table_instances", + "Maximum number of instrumented tables.", + READ_ONLY GLOBAL_VAR(pfs_param.m_table_share_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_TABLE_SHARE), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_thread_classes( + "performance_schema_max_thread_classes", + "Maximum number of thread instruments.", + READ_ONLY GLOBAL_VAR(pfs_param.m_thread_class_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 256), + DEFAULT(PFS_MAX_THREAD_CLASS), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +static Sys_var_ulong Sys_pfs_max_thread_instances( + "performance_schema_max_thread_instances", + "Maximum number of instrumented threads.", + READ_ONLY GLOBAL_VAR(pfs_param.m_thread_sizing), + CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, 1024*1024), + DEFAULT(PFS_MAX_THREAD), + BLOCK_SIZE(1), PFS_TRAILING_PROPERTIES); + +#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + static Sys_var_ulong Sys_auto_increment_increment( "auto_increment_increment", "Auto-increment columns are incremented by this", @@ -446,7 +585,7 @@ static bool event_scheduler_check(sys_var *self, THD *thd, set_var *var) } static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) { - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); /* Events::start() is heavyweight. In particular it creates a new THD, which takes LOCK_global_system_variables internally. @@ -457,9 +596,9 @@ static bool event_scheduler_update(sys_var *self, THD *thd, enum_var_type type) bool ret= Events::opt_event_scheduler == Events::EVENTS_ON ? Events::start() : Events::stop(); - pthread_mutex_unlock(&Events::LOCK_event_metadata); - pthread_mutex_lock(&LOCK_global_system_variables); - pthread_mutex_lock(&Events::LOCK_event_metadata); + mysql_mutex_unlock(&Events::LOCK_event_metadata); + mysql_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&Events::LOCK_event_metadata); if (ret) my_error(ER_EVENT_SET_VAR_ERROR, MYF(0)); return ret; @@ -1217,7 +1356,7 @@ static bool fix_read_only(sys_var *self, THD *thd, enum_var_type type) */ read_only= opt_readonly; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); if (lock_global_read_lock(thd)) goto end_with_mutex_unlock; @@ -1245,7 +1384,7 @@ static bool fix_read_only(sys_var *self, THD *thd, enum_var_type type) /* Release the lock */ unlock_global_read_lock(thd); end_with_mutex_unlock: - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); end: read_only= opt_readonly; DBUG_RETURN(result); @@ -2327,11 +2466,11 @@ static bool fix_log(char** logname, const char* default_logname, return true; } logger.lock_exclusive(); - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); if (enabled) reopen(*logname); logger.unlock(); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); return false; } static void reopen_general_log(char* name) @@ -2487,7 +2626,7 @@ static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type) *newvalptr= oldval; // [de]activate_log_handler works that way (sigh) - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); if (!newval) { logger.deactivate_log_handler(thd, log_type); @@ -2495,7 +2634,7 @@ static bool fix_log_state(sys_var *self, THD *thd, enum_var_type type) } else res= logger.activate_log_handler(thd, log_type); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); return res; } @@ -2564,7 +2703,7 @@ static Sys_var_charptr Sys_slave_load_tmpdir( static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type) { - pthread_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&LOCK_active_mi); DBUG_PRINT("info", ("slave_net_timeout=%lu mi->heartbeat_period=%.3f", slave_net_timeout, (active_mi? active_mi->heartbeat_period : 0.0))); @@ -2575,7 +2714,7 @@ static bool fix_slave_net_timeout(sys_var *self, THD *thd, enum_var_type type) " exceeds the new value of `slave_net_timeout' sec." " A sensible value for the period should be" " less than the timeout."); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&LOCK_active_mi); return false; } static Sys_var_ulong Sys_slave_net_timeout( @@ -2589,21 +2728,21 @@ static Sys_var_ulong Sys_slave_net_timeout( static bool check_slave_skip_counter(sys_var *self, THD *thd, set_var *var) { bool result= false; - pthread_mutex_lock(&LOCK_active_mi); - pthread_mutex_lock(&active_mi->rli.run_lock); + mysql_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&active_mi->rli.run_lock); if (active_mi->rli.slave_running) { my_message(ER_SLAVE_MUST_STOP, ER(ER_SLAVE_MUST_STOP), MYF(0)); result= true; } - pthread_mutex_unlock(&active_mi->rli.run_lock); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&active_mi->rli.run_lock); + mysql_mutex_unlock(&LOCK_active_mi); return result; } static bool fix_slave_skip_counter(sys_var *self, THD *thd, enum_var_type type) { - pthread_mutex_lock(&LOCK_active_mi); - pthread_mutex_lock(&active_mi->rli.run_lock); + mysql_mutex_lock(&LOCK_active_mi); + mysql_mutex_lock(&active_mi->rli.run_lock); /* The following test should normally never be true as we test this in the check function; To be safe against multiple @@ -2611,12 +2750,12 @@ static bool fix_slave_skip_counter(sys_var *self, THD *thd, enum_var_type type) */ if (!active_mi->rli.slave_running) { - pthread_mutex_lock(&active_mi->rli.data_lock); + mysql_mutex_lock(&active_mi->rli.data_lock); active_mi->rli.slave_skip_counter= sql_slave_skip_counter; - pthread_mutex_unlock(&active_mi->rli.data_lock); + mysql_mutex_unlock(&active_mi->rli.data_lock); } - pthread_mutex_unlock(&active_mi->rli.run_lock); - pthread_mutex_unlock(&LOCK_active_mi); + mysql_mutex_unlock(&active_mi->rli.run_lock); + mysql_mutex_unlock(&LOCK_active_mi); return 0; } static Sys_var_uint Sys_slave_skip_counter( @@ -2708,7 +2847,7 @@ static bool check_locale(sys_var *self, THD *thd, set_var *var) if (!locale->errmsgs->errmsgs) { - pthread_mutex_lock(&LOCK_error_messages); + mysql_mutex_lock(&LOCK_error_messages); if (!locale->errmsgs->errmsgs && read_texts(ERRMSG_FILE, locale->errmsgs->language, &locale->errmsgs->errmsgs, @@ -2717,10 +2856,10 @@ static bool check_locale(sys_var *self, THD *thd, set_var *var) push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN, ER_UNKNOWN_ERROR, "Can't process error message file for locale '%s'", locale->name); - pthread_mutex_unlock(&LOCK_error_messages); + mysql_mutex_unlock(&LOCK_error_messages); return true; } - pthread_mutex_unlock(&LOCK_error_messages); + mysql_mutex_unlock(&LOCK_error_messages); } return false; } diff --git a/sql/sys_vars.h b/sql/sys_vars.h index bdbbcbbbd59..ccc36c72786 100644 --- a/sql/sys_vars.h +++ b/sql/sys_vars.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc. +/* Copyright (C) 2002-2006 MySQL AB, 2009-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -107,11 +107,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOWT, def_val, lock, binlog_status_arg, on_check_func, on_update_func, deprecated_version, - substitute) + substitute, parse_flag) { option.var_type= ARGT; option.min_value= min_val; @@ -194,11 +195,11 @@ public: ulonglong def_val, PolyLock *lock, enum binlog_status_enum binlog_status_arg, on_check_function on_check_func, on_update_function on_update_func, - uint deprecated_version, const char *substitute) + uint deprecated_version, const char *substitute, int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, show_val_type_arg, def_val, lock, binlog_status_arg, on_check_func, - on_update_func, deprecated_version, substitute) + on_update_func, deprecated_version, substitute, parse_flag) { for (typelib.count= 0; values[typelib.count]; typelib.count++) /*no-op */; typelib.name=""; @@ -308,11 +309,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : Sys_var_typelib(name_arg, comment, flag_args, off, getopt, SHOW_MY_BOOL, bool_values, def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute) + deprecated_version, substitute, parse_flag) { option.var_type= GET_BOOL; global_var(my_bool)= def_val; @@ -363,11 +365,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOW_CHAR_PTR, (intptr)def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute) + deprecated_version, substitute, parse_flag) { is_os_charset= is_os_charset_arg == IN_FS_CHARSET; /* @@ -510,11 +513,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, 0, getopt.id, getopt.arg_type, SHOW_CHAR, (intptr)def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute) + deprecated_version, substitute, parse_flag) { option.var_type= GET_NO_ARG; } bool do_check(THD *thd, set_var *var) { @@ -666,7 +670,7 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache, and clear the old key cache. */ key_cache->in_init= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); key_cache->param_buff_size= 0; ha_resize_key_cache(key_cache); ha_change_key_cache(key_cache, dflt_key_cache); @@ -674,7 +678,7 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache, We don't delete the key cache as some running threads my still be in the key cache code with a pointer to the deleted (empty) key cache */ - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); key_cache->in_init= 0; } return error; @@ -684,14 +688,14 @@ static bool update_buffer_size(THD *thd, KEY_CACHE *key_cache, /* If key cache didn't exist initialize it, else resize it */ key_cache->in_init= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); if (!key_cache->key_cache_inited) error= ha_init_key_cache(0, key_cache); else error= ha_resize_key_cache(key_cache); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); key_cache->in_init= 0; return error; @@ -706,10 +710,10 @@ static bool update_keycache_param(THD *thd, KEY_CACHE *key_cache, keycache_var(key_cache, offset)= new_value; key_cache->in_init= 1; - pthread_mutex_unlock(&LOCK_global_system_variables); + mysql_mutex_unlock(&LOCK_global_system_variables); error= ha_resize_key_cache(key_cache); - pthread_mutex_lock(&LOCK_global_system_variables); + mysql_mutex_lock(&LOCK_global_system_variables); key_cache->in_init= 0; return error; @@ -732,10 +736,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOW_DOUBLE, def_val, lock, binlog_status_arg, - on_check_func, on_update_func, deprecated_version, substitute) + on_check_func, on_update_func, deprecated_version, substitute, + parse_flag) { option.var_type= GET_DOUBLE; option.min_value= min_val; @@ -1053,11 +1059,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOW_CHAR, (intptr)def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute), + deprecated_version, substitute, parse_flag), plugin_type(plugin_type_arg) { option.var_type= GET_STR; @@ -1165,11 +1172,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, 0, getopt.id, getopt.arg_type, SHOW_CHAR, (intptr)def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute) + deprecated_version, substitute, parse_flag) { DBUG_ASSERT(scope() == ONLY_SESSION); option.var_type= GET_NO_ARG; @@ -1383,11 +1391,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOW_CHAR, 0, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute) + deprecated_version, substitute, parse_flag) { DBUG_ASSERT(scope() == GLOBAL); DBUG_ASSERT(getopt.id == -1); @@ -1451,11 +1460,13 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOW_CHAR, (intptr)def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute), name_offset(name_off) + deprecated_version, substitute, parse_flag), + name_offset(name_off) { option.var_type= GET_STR; /* @@ -1519,11 +1530,12 @@ public: enum binlog_status_enum binlog_status_arg=VARIABLE_NOT_IN_BINLOG, on_check_function on_check_func=0, on_update_function on_update_func=0, - uint deprecated_version=0, const char *substitute=0) + uint deprecated_version=0, const char *substitute=0, + int parse_flag= PARSE_NORMAL) : sys_var(&all_sys_vars, name_arg, comment, flag_args, off, getopt.id, getopt.arg_type, SHOW_CHAR, (intptr)def_val, lock, binlog_status_arg, on_check_func, on_update_func, - deprecated_version, substitute) + deprecated_version, substitute, parse_flag) { DBUG_ASSERT(getopt.id == -1); DBUG_ASSERT(size == sizeof(Time_zone *)); diff --git a/sql/sys_vars_shared.h b/sql/sys_vars_shared.h index e996fdba52e..a8ef9034715 100644 --- a/sql/sys_vars_shared.h +++ b/sql/sys_vars_shared.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2006 MySQL AB, 2009 Sun Microsystems, Inc. +/* Copyright (C) 2002-2006 MySQL AB, 2009-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,22 +45,22 @@ public: class PolyLock_mutex: public PolyLock { - pthread_mutex_t *mutex; + mysql_mutex_t *mutex; public: - PolyLock_mutex(pthread_mutex_t *arg): mutex(arg) {} - void rdlock() { pthread_mutex_lock(mutex); } - void wrlock() { pthread_mutex_lock(mutex); } - void unlock() { pthread_mutex_unlock(mutex); } + PolyLock_mutex(mysql_mutex_t *arg): mutex(arg) {} + void rdlock() { mysql_mutex_lock(mutex); } + void wrlock() { mysql_mutex_lock(mutex); } + void unlock() { mysql_mutex_unlock(mutex); } }; class PolyLock_rwlock: public PolyLock { - rw_lock_t *rwlock; + mysql_rwlock_t *rwlock; public: - PolyLock_rwlock(rw_lock_t *arg): rwlock(arg) {} - void rdlock() { rw_rdlock(rwlock); } - void wrlock() { rw_wrlock(rwlock); } - void unlock() { rw_unlock(rwlock); } + PolyLock_rwlock(mysql_rwlock_t *arg): rwlock(arg) {} + void rdlock() { mysql_rwlock_rdlock(rwlock); } + void wrlock() { mysql_rwlock_wrlock(rwlock); } + void unlock() { mysql_rwlock_unlock(rwlock); } }; class AutoWLock diff --git a/sql/table.cc b/sql/table.cc index ea36a856d2c..c0c365f4901 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -1,4 +1,4 @@ -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,9 @@ /* INFORMATION_SCHEMA name */ LEX_STRING INFORMATION_SCHEMA_NAME= {C_STRING_WITH_LEN("information_schema")}; +/* PERFORMANCE_SCHEMA name */ +LEX_STRING PERFORMANCE_SCHEMA_DB_NAME= {C_STRING_WITH_LEN("performance_schema")}; + /* MYSQL_SCHEMA name */ LEX_STRING MYSQL_SCHEMA_NAME= {C_STRING_WITH_LEN("mysql")}; @@ -214,37 +217,35 @@ TABLE_CATEGORY get_table_category(const LEX_STRING *db, const LEX_STRING *name) if ((db->length == INFORMATION_SCHEMA_NAME.length) && (my_strcasecmp(system_charset_info, - INFORMATION_SCHEMA_NAME.str, - db->str) == 0)) - { + INFORMATION_SCHEMA_NAME.str, + db->str) == 0)) return TABLE_CATEGORY_INFORMATION; - } + + if ((db->length == PERFORMANCE_SCHEMA_DB_NAME.length) && + (my_strcasecmp(system_charset_info, + PERFORMANCE_SCHEMA_DB_NAME.str, + db->str) == 0)) + return TABLE_CATEGORY_PERFORMANCE; if ((db->length == MYSQL_SCHEMA_NAME.length) && (my_strcasecmp(system_charset_info, - MYSQL_SCHEMA_NAME.str, - db->str) == 0)) + MYSQL_SCHEMA_NAME.str, + db->str) == 0)) { if (is_system_table_name(name->str, name->length)) - { return TABLE_CATEGORY_SYSTEM; - } if ((name->length == GENERAL_LOG_NAME.length) && (my_strcasecmp(system_charset_info, - GENERAL_LOG_NAME.str, - name->str) == 0)) - { - return TABLE_CATEGORY_PERFORMANCE; - } + GENERAL_LOG_NAME.str, + name->str) == 0)) + return TABLE_CATEGORY_LOG; if ((name->length == SLOW_LOG_NAME.length) && (my_strcasecmp(system_charset_info, - SLOW_LOG_NAME.str, - name->str) == 0)) - { - return TABLE_CATEGORY_PERFORMANCE; - } + SLOW_LOG_NAME.str, + name->str) == 0)) + return TABLE_CATEGORY_LOG; } return TABLE_CATEGORY_USER; @@ -317,8 +318,8 @@ TABLE_SHARE *alloc_table_share(TABLE_LIST *table_list, char *key, share->cached_row_logging_check= -1; memcpy((char*) &share->mem_root, (char*) &mem_root, sizeof(mem_root)); - pthread_mutex_init(&share->mutex, MY_MUTEX_INIT_FAST); - pthread_cond_init(&share->cond, NULL); + mysql_mutex_init(key_TABLE_SHARE_mutex, &share->mutex, MY_MUTEX_INIT_FAST); + mysql_cond_init(key_TABLE_SHARE_cond, &share->cond, NULL); } DBUG_RETURN(share); } @@ -415,13 +416,13 @@ void free_table_share(TABLE_SHARE *share) /* share->mutex is locked in release_table_share() */ while (share->waiting_on_cond) { - pthread_cond_broadcast(&share->cond); - pthread_cond_wait(&share->cond, &share->mutex); + mysql_cond_broadcast(&share->cond); + mysql_cond_wait(&share->cond, &share->mutex); } /* No thread refers to this anymore */ - pthread_mutex_unlock(&share->mutex); - pthread_mutex_destroy(&share->mutex); - pthread_cond_destroy(&share->cond); + mysql_mutex_unlock(&share->mutex); + mysql_mutex_destroy(&share->mutex); + mysql_cond_destroy(&share->cond); } my_hash_free(&share->name_hash); @@ -539,7 +540,8 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags) disk_buff= NULL; strxmov(path, share->normalized_path.str, reg_ext, NullS); - if ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0) + if ((file= mysql_file_open(key_file_frm, + path, O_RDONLY | O_SHARE, MYF(0))) < 0) { /* We don't try to open 5.0 unencoded name, if @@ -550,7 +552,7 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags) - non-encoded db or table name contain "#mysql50#" prefix. This kind of tables must have been opened only by the - my_open() above. + mysql_file_open() above. */ if (strchr(share->table_name.str, '@') || !strncmp(share->db.str, MYSQL50_TABLE_NAME_PREFIX, @@ -576,7 +578,8 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags) so no need to check the old file name. */ if (length == share->normalized_path.length || - ((file= my_open(path, O_RDONLY | O_SHARE, MYF(0))) < 0)) + ((file= mysql_file_open(key_file_frm, + path, O_RDONLY | O_SHARE, MYF(0))) < 0)) goto err_not_open; /* Unencoded 5.0 table name found */ @@ -586,7 +589,7 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags) } error= 4; - if (my_read(file, head, 64, MYF(MY_NABP))) + if (mysql_file_read(file, head, 64, MYF(MY_NABP))) goto err; if (head[0] == (uchar) 254 && head[1] == 1) @@ -639,7 +642,7 @@ int open_table_def(THD *thd, TABLE_SHARE *share, uint db_flags) thd->status_var.opened_shares++; err: - my_close(file, MYF(MY_WME)); + mysql_file_close(file, MYF(MY_WME)); err_not_open: if (error && !error_given) @@ -753,7 +756,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, /* Read keyinformation */ key_info_length= (uint) uint2korr(head+28); - my_seek(file,(ulong) uint2korr(head+6),MY_SEEK_SET,MYF(0)); + mysql_file_seek(file, (ulong) uint2korr(head+6), MY_SEEK_SET, MYF(0)); if (read_string(file,(uchar**) &disk_buff,key_info_length)) goto err; /* purecov: inspected */ if (disk_buff[0] & 0x80) @@ -857,8 +860,8 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, DBUG_PRINT("info", ("extra segment size is %u bytes", n_length)); if (!(next_chunk= buff= (uchar*) my_malloc(n_length, MYF(MY_WME)))) goto err; - if (my_pread(file, buff, n_length, record_offset + share->reclength, - MYF(MY_NABP))) + if (mysql_file_pread(file, buff, n_length, record_offset + share->reclength, + MYF(MY_NABP))) { my_free(buff, MYF(0)); goto err; @@ -1027,12 +1030,12 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head, rec_buff_length))) goto err; /* purecov: inspected */ share->default_values= record; - if (my_pread(file, record, (size_t) share->reclength, - record_offset, MYF(MY_NABP))) + if (mysql_file_pread(file, record, (size_t) share->reclength, + record_offset, MYF(MY_NABP))) goto err; /* purecov: inspected */ - my_seek(file,pos,MY_SEEK_SET,MYF(0)); - if (my_read(file, head,288,MYF(MY_NABP))) + mysql_file_seek(file, pos, MY_SEEK_SET, MYF(0)); + if (mysql_file_read(file, head, 288, MYF(MY_NABP))) goto err; #ifdef HAVE_CRYPTED_FRM if (crypted) @@ -2059,11 +2062,11 @@ ulong get_form_pos(File file, uchar *head, TYPELIB *save_names) if (names) { length=uint2korr(head+4); - my_seek(file,64L,MY_SEEK_SET,MYF(0)); + mysql_file_seek(file, 64L, MY_SEEK_SET, MYF(0)); if (!(buf= (uchar*) my_malloc((size_t) length+a_length+names*4, MYF(MY_WME))) || - my_read(file, buf+a_length, (size_t) (length+names*4), - MYF(MY_NABP))) + mysql_file_read(file, buf+a_length, (size_t) (length+names*4), + MYF(MY_NABP))) { /* purecov: inspected */ x_free((uchar*) buf); /* purecov: inspected */ DBUG_RETURN(0L); /* purecov: inspected */ @@ -2101,7 +2104,7 @@ int read_string(File file, uchar**to, size_t length) x_free(*to); if (!(*to= (uchar*) my_malloc(length+1,MYF(MY_WME))) || - my_read(file, *to, length,MYF(MY_NABP))) + mysql_file_read(file, *to, length, MYF(MY_NABP))) { x_free(*to); /* purecov: inspected */ *to= 0; /* purecov: inspected */ @@ -2133,23 +2136,24 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames, { /* Expand file */ newpos+=IO_SIZE; int4store(fileinfo+10,newpos); - endpos=(ulong) my_seek(file,0L,MY_SEEK_END,MYF(0));/* Copy from file-end */ + /* Copy from file-end */ + endpos= (ulong) mysql_file_seek(file, 0L, MY_SEEK_END, MYF(0)); bufflength= (uint) (endpos & (IO_SIZE-1)); /* IO_SIZE is a power of 2 */ while (endpos > maxlength) { - my_seek(file,(ulong) (endpos-bufflength),MY_SEEK_SET,MYF(0)); - if (my_read(file, buff, bufflength, MYF(MY_NABP+MY_WME))) + mysql_file_seek(file, (ulong) (endpos-bufflength), MY_SEEK_SET, MYF(0)); + if (mysql_file_read(file, buff, bufflength, MYF(MY_NABP+MY_WME))) DBUG_RETURN(0L); - my_seek(file,(ulong) (endpos-bufflength+IO_SIZE),MY_SEEK_SET, - MYF(0)); - if ((my_write(file, buff,bufflength,MYF(MY_NABP+MY_WME)))) + mysql_file_seek(file, (ulong) (endpos-bufflength+IO_SIZE), MY_SEEK_SET, + MYF(0)); + if ((mysql_file_write(file, buff, bufflength, MYF(MY_NABP+MY_WME)))) DBUG_RETURN(0); endpos-=bufflength; bufflength=IO_SIZE; } bzero(buff,IO_SIZE); /* Null new block */ - my_seek(file,(ulong) maxlength,MY_SEEK_SET,MYF(0)); - if (my_write(file,buff,bufflength,MYF(MY_NABP+MY_WME))) + mysql_file_seek(file, (ulong) maxlength, MY_SEEK_SET, MYF(0)); + if (mysql_file_write(file, buff, bufflength, MYF(MY_NABP+MY_WME))) DBUG_RETURN(0L); maxlength+=IO_SIZE; /* Fix old ref */ int2store(fileinfo+6,maxlength); @@ -2168,16 +2172,17 @@ ulong make_new_entry(File file, uchar *fileinfo, TYPELIB *formnames, } else (void) strxmov((char*) buff,newname,"/",NullS); /* purecov: inspected */ - my_seek(file,63L+(ulong) n_length,MY_SEEK_SET,MYF(0)); - if (my_write(file, buff, (size_t) length+1,MYF(MY_NABP+MY_WME)) || - (names && my_write(file,(uchar*) (*formnames->type_names+n_length-1), - names*4, MYF(MY_NABP+MY_WME))) || - my_write(file, fileinfo+10, 4,MYF(MY_NABP+MY_WME))) + mysql_file_seek(file, 63L+(ulong) n_length, MY_SEEK_SET, MYF(0)); + if (mysql_file_write(file, buff, (size_t) length+1, MYF(MY_NABP+MY_WME)) || + (names && mysql_file_write(file, + (uchar*) (*formnames->type_names+n_length-1), + names*4, MYF(MY_NABP+MY_WME))) || + mysql_file_write(file, fileinfo+10, 4, MYF(MY_NABP+MY_WME))) DBUG_RETURN(0L); /* purecov: inspected */ int2store(fileinfo+8,names+1); int2store(fileinfo+4,n_length+length); - (void) my_chsize(file, newpos, 0, MYF(MY_WME));/* Append file with '\0' */ + (void) mysql_file_chsize(file, newpos, 0, MYF(MY_WME));/* Append file with '\0' */ DBUG_RETURN(newpos); } /* make_new_entry */ @@ -2459,7 +2464,8 @@ File create_frm(THD *thd, const char *name, const char *db, if (create_info->min_rows > UINT_MAX32) create_info->min_rows= UINT_MAX32; - if ((file= my_create(name, CREATE_MODE, create_flags, MYF(0))) >= 0) + if ((file= mysql_file_create(key_file_frm, + name, CREATE_MODE, create_flags, MYF(0))) >= 0) { uint key_length, tmp_key_length, tmp, csid; bzero((char*) fileinfo,64); @@ -2529,10 +2535,10 @@ File create_frm(THD *thd, const char *name, const char *db, bzero(fill,IO_SIZE); for (; length > IO_SIZE ; length-= IO_SIZE) { - if (my_write(file,fill, IO_SIZE, MYF(MY_WME | MY_NABP))) + if (mysql_file_write(file, fill, IO_SIZE, MYF(MY_WME | MY_NABP))) { - (void) my_close(file,MYF(0)); - (void) my_delete(name,MYF(0)); + (void) mysql_file_close(file, MYF(0)); + (void) mysql_file_delete(key_file_frm, name, MYF(0)); return(-1); } } @@ -2571,7 +2577,7 @@ rename_file_ext(const char * from,const char * to,const char * ext) char from_b[FN_REFLEN],to_b[FN_REFLEN]; (void) strxmov(from_b,from,ext,NullS); (void) strxmov(to_b,to,ext,NullS); - return (my_rename(from_b,to_b,MYF(MY_WME))); + return (mysql_file_rename(key_file_frm, from_b, to_b, MYF(MY_WME))); } @@ -3935,7 +3941,7 @@ const char *Natural_join_column::db_name() DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) || (table_ref->schema_table && - is_schema_db(table_ref->table->s->db.str))); + is_infoschema_db(table_ref->table->s->db.str))); return table_ref->db; } @@ -4153,7 +4159,7 @@ const char *Field_iterator_table_ref::get_db_name() */ DBUG_ASSERT(!strcmp(table_ref->db, table_ref->table->s->db.str) || (table_ref->schema_table && - is_schema_db(table_ref->table->s->db.str))); + is_infoschema_db(table_ref->table->s->db.str))); return table_ref->db; } diff --git a/sql/table.h b/sql/table.h index e2f47c9c588..b2b84ed283d 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1,7 +1,7 @@ #ifndef TABLE_INCLUDED #define TABLE_INCLUDED -/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2000-2008 MySQL AB, 2008-2009 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,7 +16,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - /* Structs that defines the TABLE */ class Item; /* Needed by ORDER */ @@ -28,6 +27,8 @@ class st_select_lex; class partition_info; class COND_EQUAL; class Security_context; +class ACL_internal_schema_access; +class ACL_internal_table_access; /*************************************************************************/ @@ -70,6 +71,25 @@ typedef struct st_order { table_map used, depend_map; } ORDER; +/** + State information for internal tables grants. + This structure is part of the TABLE_LIST, and is updated + during the ACL check process. + @sa GRANT_INFO +*/ +struct st_grant_internal_info +{ + /** True if the internal lookup by schema name was done. */ + bool m_schema_lookup_done; + /** Cached internal schema access. */ + const ACL_internal_schema_access *m_schema_access; + /** True if the internal lookup by table name was done. */ + bool m_table_lookup_done; + /** Cached internal table access. */ + const ACL_internal_table_access *m_table_access; +}; +typedef struct st_grant_internal_info GRANT_INTERNAL_INFO; + /** @brief The current state of the privilege checking process for the current user, SQL statement and SQL object. @@ -131,6 +151,8 @@ typedef struct st_grant_info check access rights to the underlying tables of a view. */ ulong orig_want_privilege; + /** The grant state for internal tables. */ + GRANT_INTERNAL_INFO m_internal; } GRANT_INFO; enum tmp_table_type @@ -247,7 +269,7 @@ enum enum_table_category - LOCK TABLE t FOR READ/WRITE - FLUSH TABLES WITH READ LOCK - SET GLOBAL READ_ONLY = ON - as there is no point in locking explicitely + as there is no point in locking explicitly an INFORMATION_SCHEMA table. Nothing is directly written to information schema tables. Note that this value is not used currently, @@ -262,16 +284,16 @@ enum enum_table_category TABLE_CATEGORY_INFORMATION=4, /** - Performance schema tables. + Log tables. These tables are an interface provided by the system - to inspect the system performance data. + to inspect the system logs. These tables do *not* honor: - LOCK TABLE t FOR READ/WRITE - FLUSH TABLES WITH READ LOCK - SET GLOBAL READ_ONLY = ON - as there is no point in locking explicitely - a PERFORMANCE_SCHEMA table. - An example of PERFORMANCE_SCHEMA tables are: + as there is no point in locking explicitly + a LOG table. + An example of LOG tables are: - mysql.slow_log - mysql.general_log, which *are* updated even when there is either @@ -279,9 +301,31 @@ enum enum_table_category User queries do not write directly to these tables (there are exceptions for log tables). The server implementation perform writes. + Log tables are cached in the table cache. + */ + TABLE_CATEGORY_LOG=5, + + /** + Performance schema tables. + These tables are an interface provided by the system + to inspect the system performance data. + These tables do *not* honor: + - LOCK TABLE t FOR READ/WRITE + - FLUSH TABLES WITH READ LOCK + - SET GLOBAL READ_ONLY = ON + as there is no point in locking explicitly + a PERFORMANCE_SCHEMA table. + An example of PERFORMANCE_SCHEMA tables are: + - performance_schema.* + which *are* updated (but not using the handler interface) + even when there is either + a GLOBAL READ LOCK or a GLOBAL READ_ONLY in effect. + User queries do not write directly to these tables + (there are exceptions for SETUP_* tables). + The server implementation perform writes. Performance tables are cached in the table cache. */ - TABLE_CATEGORY_PERFORMANCE=5 + TABLE_CATEGORY_PERFORMANCE=6 }; typedef enum enum_table_category TABLE_CATEGORY; @@ -336,8 +380,8 @@ struct TABLE_SHARE TYPELIB keynames; /* Pointers to keynames */ TYPELIB fieldnames; /* Pointer to fieldnames */ TYPELIB *intervals; /* pointer to interval info */ - pthread_mutex_t mutex; /* For locking the share */ - pthread_cond_t cond; /* To signal that share is ready */ + mysql_mutex_t mutex; /* For locking the share */ + mysql_cond_t cond; /* To signal that share is ready */ TABLE_SHARE *next, **prev; /* Link to unused shares */ /* The following is copied to each TABLE on OPEN */ @@ -466,6 +510,8 @@ struct TABLE_SHARE void *ha_data; void (*ha_data_destroy)(void *); /* An optional destructor for ha_data */ + /** Instrumentation for this table share. */ + PSI_table_share *m_psi; /* Set share's table cache key and update its db and table name appropriately. @@ -527,7 +573,7 @@ struct TABLE_SHARE inline bool require_write_privileges() { - return (table_category == TABLE_CATEGORY_PERFORMANCE); + return (table_category == TABLE_CATEGORY_LOG); } inline ulong get_table_def_version() diff --git a/sql/tztime.cc b/sql/tztime.cc index 0784b73f353..442669d9c3d 100644 --- a/sql/tztime.cc +++ b/sql/tztime.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2004 MySQL AB +/* Copyright (C) 2004 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,6 +40,7 @@ #include "tzfile.h" #include #include +#include /* Now we don't use abbreviations in server but we will do this in future. @@ -156,9 +157,9 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) uchar *p; int read_from_file; uint i; - FILE *file; + MYSQL_FILE *file; - if (!(file= my_fopen(name, O_RDONLY|O_BINARY, MYF(MY_WME)))) + if (!(file= mysql_file_fopen(0, name, O_RDONLY|O_BINARY, MYF(MY_WME)))) return 1; { union @@ -175,9 +176,9 @@ tz_load(const char *name, TIME_ZONE_INFO *sp, MEM_ROOT *storage) uint ttisgmtcnt; char *tzinfo_buf; - read_from_file= my_fread(file, u.buf, sizeof(u.buf), MYF(MY_WME)); + read_from_file= mysql_file_fread(file, u.buf, sizeof(u.buf), MYF(MY_WME)); - if (my_fclose(file, MYF(MY_WME)) != 0) + if (mysql_file_fclose(file, MYF(MY_WME)) != 0) return 1; if (read_from_file < (int)sizeof(struct tzhead)) @@ -1432,7 +1433,7 @@ static MEM_ROOT tz_storage; time zone in offset_tzs or creating if it didn't existed before in tz_storage. So contention is low. */ -static pthread_mutex_t tz_LOCK; +static mysql_mutex_t tz_LOCK; static bool tz_inited= 0; /* @@ -1532,6 +1533,27 @@ tz_init_table_list(TABLE_LIST *tz_tabs) } } +#ifdef HAVE_PSI_INTERFACE +static PSI_mutex_key key_tz_LOCK; + +static PSI_mutex_info all_tz_mutexes[]= +{ + { & key_tz_LOCK, "tz_LOCK", PSI_FLAG_GLOBAL} +}; + +static void init_tz_psi_keys(void) +{ + const char* category= "sql"; + int count; + + if (PSI_server == NULL) + return; + + count= array_elements(all_tz_mutexes); + PSI_server->register_mutex(category, all_tz_mutexes, count); +} +#endif /* HAVE_PSI_INTERFACE */ + /* Initialize time zone support infrastructure. @@ -1571,6 +1593,10 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) int res; DBUG_ENTER("my_tz_init"); +#ifdef HAVE_PSI_INTERFACE + init_tz_psi_keys(); +#endif + /* To be able to run this from boot, we allocate a temporary THD */ @@ -1594,7 +1620,7 @@ my_tz_init(THD *org_thd, const char *default_tzname, my_bool bootstrap) goto end; } init_sql_alloc(&tz_storage, 32 * 1024, 0); - pthread_mutex_init(&tz_LOCK, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_tz_LOCK, &tz_LOCK, MY_MUTEX_INIT_FAST); tz_inited= 1; /* Add 'SYSTEM' time zone to tz_names hash */ @@ -1776,7 +1802,7 @@ void my_tz_free() if (tz_inited) { tz_inited= 0; - pthread_mutex_destroy(&tz_LOCK); + mysql_mutex_destroy(&tz_LOCK); my_hash_free(&offset_tzs); my_hash_free(&tz_names); free_root(&tz_storage, MYF(0)); @@ -2265,7 +2291,7 @@ my_tz_find(THD *thd, const String *name) if (!name) DBUG_RETURN(0); - pthread_mutex_lock(&tz_LOCK); + mysql_mutex_lock(&tz_LOCK); if (!str_to_offset(name->ptr(), name->length(), &offset)) { @@ -2308,7 +2334,7 @@ my_tz_find(THD *thd, const String *name) } } - pthread_mutex_unlock(&tz_LOCK); + mysql_mutex_unlock(&tz_LOCK); DBUG_RETURN(result_tz); } diff --git a/sql/unireg.cc b/sql/unireg.cc index 8328cf735b5..b20e759efbb 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2006 MySQL AB +/* Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -258,27 +258,27 @@ bool mysql_create_frm(THD *thd, const char *file_name, #endif int2store(fileinfo+59,db_file->extra_rec_buf_length()); - if (my_pwrite(file, fileinfo, 64, 0L, MYF_RW) || - my_pwrite(file, keybuff, key_info_length, - (ulong) uint2korr(fileinfo+6),MYF_RW)) + if (mysql_file_pwrite(file, fileinfo, 64, 0L, MYF_RW) || + mysql_file_pwrite(file, keybuff, key_info_length, + (ulong) uint2korr(fileinfo+6), MYF_RW)) goto err; - my_seek(file, - (ulong) uint2korr(fileinfo+6)+ (ulong) key_buff_length, - MY_SEEK_SET,MYF(0)); + mysql_file_seek(file, + (ulong) uint2korr(fileinfo+6) + (ulong) key_buff_length, + MY_SEEK_SET, MYF(0)); if (make_empty_rec(thd,file,ha_legacy_type(create_info->db_type), create_info->table_options, create_fields,reclength, data_offset, db_file)) goto err; int2store(buff, create_info->connect_string.length); - if (my_write(file, (const uchar*)buff, 2, MYF(MY_NABP)) || - my_write(file, (const uchar*)create_info->connect_string.str, + if (mysql_file_write(file, (const uchar*)buff, 2, MYF(MY_NABP)) || + mysql_file_write(file, (const uchar*)create_info->connect_string.str, create_info->connect_string.length, MYF(MY_NABP))) goto err; int2store(buff, str_db_type.length); - if (my_write(file, (const uchar*)buff, 2, MYF(MY_NABP)) || - my_write(file, (const uchar*)str_db_type.str, + if (mysql_file_write(file, (const uchar*)buff, 2, MYF(MY_NABP)) || + mysql_file_write(file, (const uchar*)str_db_type.str, str_db_type.length, MYF(MY_NABP))) goto err; @@ -287,32 +287,32 @@ bool mysql_create_frm(THD *thd, const char *file_name, { char auto_partitioned= part_info->is_auto_partitioned ? 1 : 0; int4store(buff, part_info->part_info_len); - if (my_write(file, (const uchar*)buff, 4, MYF_RW) || - my_write(file, (const uchar*)part_info->part_info_string, + if (mysql_file_write(file, (const uchar*)buff, 4, MYF_RW) || + mysql_file_write(file, (const uchar*)part_info->part_info_string, part_info->part_info_len + 1, MYF_RW) || - my_write(file, (const uchar*)&auto_partitioned, 1, MYF_RW)) + mysql_file_write(file, (const uchar*)&auto_partitioned, 1, MYF_RW)) goto err; } else #endif { bzero((uchar*) buff, 6); - if (my_write(file, (uchar*) buff, 6, MYF_RW)) + if (mysql_file_write(file, (uchar*) buff, 6, MYF_RW)) goto err; } for (i= 0; i < keys; i++) { if (key_info[i].parser_name) { - if (my_write(file, (const uchar*)key_info[i].parser_name->str, - key_info[i].parser_name->length + 1, MYF(MY_NABP))) + if (mysql_file_write(file, (const uchar*)key_info[i].parser_name->str, + key_info[i].parser_name->length + 1, MYF(MY_NABP))) goto err; } } - my_seek(file,filepos,MY_SEEK_SET,MYF(0)); - if (my_write(file, forminfo, 288, MYF_RW) || - my_write(file, screen_buff, info_length, MYF_RW) || + mysql_file_seek(file, filepos, MY_SEEK_SET, MYF(0)); + if (mysql_file_write(file, forminfo, 288, MYF_RW) || + mysql_file_write(file, screen_buff, info_length, MYF_RW) || pack_fields(file, create_fields, data_offset)) goto err; @@ -321,15 +321,15 @@ bool mysql_create_frm(THD *thd, const char *file_name, { char tmp=2,*disk_buff=0; SQL_CRYPT *crypted=new SQL_CRYPT(create_info->password); - if (!crypted || my_pwrite(file,&tmp,1,26,MYF_RW)) // Mark crypted + if (!crypted || mysql_file_pwrite(file, &tmp, 1, 26, MYF_RW))// Mark crypted goto err; uint read_length=uint2korr(forminfo)-256; - my_seek(file,filepos+256,MY_SEEK_SET,MYF(0)); + mysql_file_seek(file, filepos+256, MY_SEEK_SET, MYF(0)); if (read_string(file,(uchar**) &disk_buff,read_length)) goto err; crypted->encode(disk_buff,read_length); delete crypted; - if (my_pwrite(file,disk_buff,read_length,filepos+256,MYF_RW)) + if (mysql_file_pwrite(file, disk_buff, read_length, filepos+256, MYF_RW)) { my_free(disk_buff,MYF(0)); goto err; @@ -342,11 +342,11 @@ bool mysql_create_frm(THD *thd, const char *file_name, my_free(keybuff, MYF(0)); if (opt_sync_frm && !(create_info->options & HA_LEX_CREATE_TMP_TABLE) && - (my_sync(file, MYF(MY_WME)) || + (mysql_file_sync(file, MYF(MY_WME)) || my_sync_dir_by_file(file_name, MYF(MY_WME)))) goto err2; - if (my_close(file,MYF(MY_WME))) + if (mysql_file_close(file, MYF(MY_WME))) goto err3; { @@ -371,9 +371,9 @@ err: my_free(screen_buff, MYF(0)); my_free(keybuff, MYF(0)); err2: - (void) my_close(file,MYF(MY_WME)); + (void) mysql_file_close(file, MYF(MY_WME)); err3: - my_delete(file_name,MYF(0)); + mysql_file_delete(key_file_frm, file_name, MYF(0)); DBUG_RETURN(1); } /* mysql_create_frm */ @@ -426,7 +426,7 @@ int rea_create_table(THD *thd, const char *path, err_handler: (void) file->ha_create_handler_files(path, NULL, CHF_DELETE_FLAG, create_info); - my_delete(frm_name, MYF(0)); + mysql_file_delete(key_file_frm, frm_name, MYF(0)); DBUG_RETURN(1); } /* rea_create_table */ @@ -825,13 +825,13 @@ static bool pack_fields(File file, List &create_fields, int2store(buff+15, field->comment.length); comment_length+= field->comment.length; set_if_bigger(int_count,field->interval_id); - if (my_write(file, buff, FCOMP, MYF_RW)) + if (mysql_file_write(file, buff, FCOMP, MYF_RW)) DBUG_RETURN(1); } /* Write fieldnames */ buff[0]=(uchar) NAMES_SEP_CHAR; - if (my_write(file, buff, 1, MYF_RW)) + if (mysql_file_write(file, buff, 1, MYF_RW)) DBUG_RETURN(1); i=0; it.rewind(); @@ -841,7 +841,7 @@ static bool pack_fields(File file, List &create_fields, *pos++=NAMES_SEP_CHAR; if (i == create_fields.elements-1) *pos++=0; - if (my_write(file, buff, (size_t) (pos-(char*) buff),MYF_RW)) + if (mysql_file_write(file, buff, (size_t) (pos-(char*) buff), MYF_RW)) DBUG_RETURN(1); i++; } @@ -901,7 +901,7 @@ static bool pack_fields(File file, List &create_fields, tmp.append('\0'); // End of intervall } } - if (my_write(file,(uchar*) tmp.ptr(),tmp.length(),MYF_RW)) + if (mysql_file_write(file, (uchar*) tmp.ptr(), tmp.length(), MYF_RW)) DBUG_RETURN(1); } if (comment_length) @@ -911,8 +911,8 @@ static bool pack_fields(File file, List &create_fields, while ((field=it++)) { if (field->comment.length) - if (my_write(file, (uchar*) field->comment.str, field->comment.length, - MYF_RW)) + if (mysql_file_write(file, (uchar*) field->comment.str, + field->comment.length, MYF_RW)) DBUG_RETURN(1); } } @@ -1035,7 +1035,7 @@ static bool make_empty_rec(THD *thd, File file,enum legacy_db_type table_type, if (null_count & 7) *(null_pos + null_count / 8)|= ~(((uchar) 1 << (null_count & 7)) - 1); - error= my_write(file, buff, (size_t) reclength,MYF_RW) != 0; + error= mysql_file_write(file, buff, (size_t) reclength, MYF_RW) != 0; err: my_free(buff, MYF(MY_FAE)); diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index d09eefda463..1117e8fff15 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1709,7 +1709,7 @@ int ha_myisam::info(uint flag) /* Update share */ if (share->tmp_table == NO_TMP_TABLE) - pthread_mutex_lock(&share->mutex); + mysql_mutex_lock(&share->mutex); share->keys_in_use.set_prefix(share->keys); share->keys_in_use.intersect_extended(misam_info.key_map); share->keys_for_keyread.intersect(share->keys_in_use); @@ -1719,7 +1719,7 @@ int ha_myisam::info(uint flag) (char*) misam_info.rec_per_key, sizeof(table->key_info[0].rec_per_key[0])*share->key_parts); if (share->tmp_table == NO_TMP_TABLE) - pthread_mutex_unlock(&share->mutex); + mysql_mutex_unlock(&share->mutex); /* Set data_file_name and index_file_name to point at the symlink value From 7f414733204e29e652a9ff32c1afcb912282a96f Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Fri, 8 Jan 2010 15:56:26 +0000 Subject: [PATCH 54/69] Fixes rpl_stm_loaddata_concurrent failure in PB2. The test case did not start with fresh binlogs, so in some cases, dependending on the order MTR runs the tests, it would try to show binlog contents from invalid positions (binary log would contain unexpected events from previous test). We fix this by deploying a RESET MASTER at the beginning of the test case. --- mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result | 1 + mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test | 1 + 2 files changed, 2 insertions(+) diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result index 23d8cd01b8b..ee881752dec 100644 --- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result +++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result @@ -1,3 +1,4 @@ +RESET MASTER; CREATE TABLE t1 (c1 char(50)); LOAD DATA INFILE '../../std_data/words.dat' INTO TABLE t1; LOAD DATA CONCURRENT INFILE '../../std_data/words.dat' INTO TABLE t1; diff --git a/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test b/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test index 8aeb1cf87fc..2ea95a63fb5 100644 --- a/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test +++ b/mysql-test/suite/rpl/t/rpl_stm_loaddata_concurrent.test @@ -1,6 +1,7 @@ -- source include/not_ndb_default.inc -- source include/have_log_bin.inc -- source include/have_binlog_format_statement.inc +RESET MASTER; let $binlog_start= query_get_value(SHOW MASTER STATUS, Position, 1); CREATE TABLE t1 (c1 char(50)); From 5d61829b29e5e7aa1d4300fa7ca39b2d1f5f03ee Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 11 Jan 2010 19:42:35 +0300 Subject: [PATCH 55/69] Backporting revision from mysql-6.0-codebase-bugfixing. Original revision: ------------------------------------------------------------ revno: 3789.1.9 revision-id: serg@mysql.com-20091229134448-phe834ukzmi0k2e3 parent: serg@mysql.com-20091227081418-bgfg952gzumn1k3h committer: Sergei Golubchik branch nick: 6.0-codebase timestamp: Tue 2009-12-29 14:44:48 +0100 message: better fix for Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds use setenv instead of putenv ------------------------------------------------------------ --- client/mysqltest.cc | 20 ++++++++++---------- include/config-win.h | 5 ++++- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 43107d838ee..9c5e7d9f466 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -72,6 +72,10 @@ #define QUERY_SEND_FLAG 1 #define QUERY_REAP_FLAG 2 +#ifndef HAVE_SETENV +#error implement our portable setenv replacement in mysys +#endif + enum { OPT_SKIP_SAFEMALLOC=OPT_MAX_CLIENT_OPTION, OPT_PS_PROTOCOL, OPT_SP_PROTOCOL, OPT_CURSOR_PROTOCOL, OPT_VIEW_PROTOCOL, @@ -216,7 +220,6 @@ typedef struct int alloced_len; int int_dirty; /* do not update string if int is updated until first read */ int alloced; - char *env_s; } VAR; /*Perl/shell-like variable registers */ @@ -1941,7 +1944,6 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, tmp_var->alloced_len = val_alloc_len; tmp_var->int_val = (val) ? atoi(val) : 0; tmp_var->int_dirty = 0; - tmp_var->env_s = 0; return tmp_var; } @@ -2069,20 +2071,18 @@ void var_set(const char *var_name, const char *var_name_end, if (env_var) { - char buf[1024], *old_env_s= v->env_s; if (v->int_dirty) { sprintf(v->str_val, "%d", v->int_val); v->int_dirty= 0; v->str_val_len= strlen(v->str_val); } - my_snprintf(buf, sizeof(buf), "%.*s=%.*s", - v->name_len, v->name, - v->str_val_len, v->str_val); - if (!(v->env_s= my_strdup(buf, MYF(MY_WME)))) - die("Out of memory"); - putenv(v->env_s); - my_free(old_env_s, MYF(MY_ALLOW_ZERO_PTR)); + char oldc= v->name[v->name_len]; + if (oldc) + v->name[v->name_len]= 0; // setenv() expects \0-terminated strings + setenv(v->name, v->str_val, 1); // v->str_val is always \0-terminated + if (oldc) + v->name[v->name_len]= oldc; } DBUG_VOID_RETURN; } diff --git a/include/config-win.h b/include/config-win.h index f8d51165bc2..5d64261076d 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -318,9 +318,12 @@ inline ulonglong double2ulonglong(double d) #define strcasecmp stricmp #define strncasecmp strnicmp -#define HAVE_SNPRINTF /* Gave link error */ +#define HAVE_SNPRINTF 1 #define snprintf _snprintf +#define HAVE_SETENV 1 +#define setenv(VAR,VAL,X) _putenv_s(VAR,VAL) + #ifdef _MSC_VER #define HAVE_LDIV /* The optimizer breaks in zortech for ldiv */ #define HAVE_ANSI_INCLUDE From 0f300ac6b9491abf55f348fc1573ba53a7ce87d3 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 11 Jan 2010 19:43:55 +0300 Subject: [PATCH 56/69] Backporting revision from mysql-6.0-codebase-bugfixing. Original revision: ------------------------------------------------------------ revno: 3817 revision-id: guilhem@mysql.com-20100108092756-k0zzf4kvx9b7bh38 parent: guilhem@mysql.com-20100107101133-hrrgcdqg508runuf committer: Guilhem Bichot branch nick: mysql-6.0-codebase-bugfixing timestamp: Fri 2010-01-08 10:27:56 +0100 message: fix for BUG#50120 "Valgrind errors in any test, inside mysqltest" Problem was that as v->name[v->name_len] may be uninitialized (which is ok per se), it shouldn't be used in an if(). We remove this zero_the_char/restore_it logic by rather zero-terminating the v->name string when we create it in var_init(). ------------------------------------------------------------ --- client/mysqltest.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/client/mysqltest.cc b/client/mysqltest.cc index 9c5e7d9f466..95255b59afa 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -1927,13 +1927,20 @@ VAR *var_init(VAR *v, const char *name, int name_len, const char *val, + name_len+1, MYF(MY_WME)))) die("Out of memory"); - tmp_var->name = (name) ? (char*) tmp_var + sizeof(*tmp_var) : 0; + if (name != NULL) + { + tmp_var->name= reinterpret_cast(tmp_var) + sizeof(*tmp_var); + memcpy(tmp_var->name, name, name_len); + tmp_var->name[name_len]= 0; + } + else + tmp_var->name= NULL; + tmp_var->alloced = (v == 0); if (!(tmp_var->str_val = (char*)my_malloc(val_alloc_len+1, MYF(MY_WME)))) die("Out of memory"); - memcpy(tmp_var->name, name, name_len); if (val) { memcpy(tmp_var->str_val, val, val_len); @@ -2077,12 +2084,9 @@ void var_set(const char *var_name, const char *var_name_end, v->int_dirty= 0; v->str_val_len= strlen(v->str_val); } - char oldc= v->name[v->name_len]; - if (oldc) - v->name[v->name_len]= 0; // setenv() expects \0-terminated strings - setenv(v->name, v->str_val, 1); // v->str_val is always \0-terminated - if (oldc) - v->name[v->name_len]= oldc; + /* setenv() expects \0-terminated strings */ + DBUG_ASSERT(v->name[v->name_len] == 0); + setenv(v->name, v->str_val, 1); } DBUG_VOID_RETURN; } From e0e0f9e3d46917fe9b611fc9769e64032c267446 Mon Sep 17 00:00:00 2001 From: Marc Alff Date: Mon, 11 Jan 2010 18:47:27 -0700 Subject: [PATCH 57/69] WL#2360 Performance schema Part V: performance schema implementation --- BUILD/compile-dist | 17 + mysql-test/Makefile.am | 8 +- mysql-test/include/default_my.cnf | 17 + mysql-test/include/default_mysqld.cnf | 18 + mysql-test/mysql-test-run.pl | 19 +- mysql-test/r/1st.result | 1 + mysql-test/r/drop.result | 2 + mysql-test/r/information_schema.result | 4 + mysql-test/r/mysqld--help-notwin.result | 482 ++-- mysql-test/r/mysqld--help-win.result | 486 ++-- mysql-test/r/ps_1general.result | 1 + mysql-test/r/schema.result | 1 + mysql-test/r/show_check.result | 1 + .../suite/binlog/r/binlog_database.result | 1 + .../suite/binlog/r/binlog_unsafe.result | 20 +- mysql-test/suite/funcs_1/r/is_schemata.result | 1 + .../suite/jp/r/jp_create_db_sjis.result | 1 + .../suite/jp/r/jp_create_db_ucs2.result | 1 + .../suite/jp/r/jp_create_db_ujis.result | 1 + .../suite/jp/r/jp_create_db_utf8.result | 1 + .../perfschema/include/binlog_common.inc | 49 + .../perfschema/include/cleanup_helper.inc | 25 + .../suite/perfschema/include/privilege.inc | 194 ++ .../suite/perfschema/include/setup_helper.inc | 54 + .../include/start_server_common.inc | 62 + .../suite/perfschema/r/aggregate.result | 101 + .../suite/perfschema/r/bad_option_1.result | 2 + .../suite/perfschema/r/bad_option_2.result | 1 + .../suite/perfschema/r/binlog_mix.result | 49 + .../suite/perfschema/r/binlog_row.result | 49 + .../suite/perfschema/r/binlog_stmt.result | 48 + .../suite/perfschema/r/cnf_option.result | 6 + .../perfschema/r/column_privilege.result | 27 + .../perfschema/r/ddl_cond_instances.result | 8 + .../r/ddl_events_waits_current.result | 7 + .../r/ddl_events_waits_history.result | 7 + .../r/ddl_events_waits_history_long.result | 7 + .../perfschema/r/ddl_ews_by_event_name.result | 7 + .../perfschema/r/ddl_ews_by_instance.result | 7 + .../r/ddl_ews_by_thread_by_event_name.result | 9 + .../perfschema/r/ddl_file_instances.result | 8 + .../perfschema/r/ddl_fs_by_event_name.result | 7 + .../perfschema/r/ddl_fs_by_instance.result | 7 + .../perfschema/r/ddl_mutex_instances.result | 8 + .../r/ddl_performance_timers.result | 8 + .../suite/perfschema/r/ddl_processlist.result | 8 + .../perfschema/r/ddl_rwlock_instances.result | 8 + .../perfschema/r/ddl_setup_consumers.result | 8 + .../perfschema/r/ddl_setup_instruments.result | 8 + .../perfschema/r/ddl_setup_objects.result | 7 + .../perfschema/r/ddl_setup_timers.result | 8 + .../perfschema/r/dml_cond_instances.result | 23 + .../r/dml_events_waits_current.result | 28 + .../r/dml_events_waits_history.result | 36 + .../r/dml_events_waits_history_long.result | 36 + .../perfschema/r/dml_ews_by_event_name.result | 28 + .../perfschema/r/dml_ews_by_instance.result | 45 + .../r/dml_ews_by_thread_by_event_name.result | 29 + .../perfschema/r/dml_file_instances.result | 23 + .../r/dml_file_summary_by_event_name.result | 28 + .../r/dml_file_summary_by_instance.result | 28 + .../perfschema/r/dml_mutex_instances.result | 23 + .../r/dml_performance_timers.result | 29 + .../suite/perfschema/r/dml_processlist.result | 27 + .../perfschema/r/dml_rwlock_instances.result | 23 + .../perfschema/r/dml_setup_consumers.result | 45 + .../perfschema/r/dml_setup_instruments.result | 72 + .../perfschema/r/dml_setup_objects.result | 35 + .../perfschema/r/dml_setup_timers.result | 33 + .../suite/perfschema/r/func_file_io.result | 117 + .../suite/perfschema/r/func_mutex.result | 113 + .../perfschema/r/global_read_lock.result | 33 + .../perfschema/r/information_schema.result | 198 ++ mysql-test/suite/perfschema/r/misc.result | 13 + .../suite/perfschema/r/myisam_file_io.result | 59 + .../suite/perfschema/r/no_threads.result | 43 + .../perfschema/r/one_thread_per_con.result | 38 + .../suite/perfschema/r/privilege.result | 577 +++++ .../suite/perfschema/r/query_cache.result | 66 + .../suite/perfschema/r/read_only.result | 49 + mysql-test/suite/perfschema/r/schema.result | 211 ++ mysql-test/suite/perfschema/r/selects.result | 97 + .../suite/perfschema/r/server_init.result | 233 ++ .../r/start_server_no_cond_class.result | 74 + .../r/start_server_no_cond_inst.result | 77 + .../r/start_server_no_file_class.result | 74 + .../r/start_server_no_file_inst.result | 77 + .../r/start_server_no_mutex_class.result | 74 + .../r/start_server_no_mutex_inst.result | 77 + .../r/start_server_no_rwlock_class.result | 74 + .../r/start_server_no_rwlock_inst.result | 77 + .../r/start_server_no_thread_class.result | 74 + .../r/start_server_no_thread_inst.result | 73 + .../perfschema/r/start_server_off.result | 73 + .../suite/perfschema/r/start_server_on.result | 73 + .../r/tampered_perfschema_table1.result | 6 + mysql-test/suite/perfschema/t/aggregate.test | 187 ++ .../suite/perfschema/t/bad_option_1.test | 45 + .../suite/perfschema/t/bad_option_2.test | 44 + mysql-test/suite/perfschema/t/binlog_mix.test | 28 + mysql-test/suite/perfschema/t/binlog_row.test | 28 + .../suite/perfschema/t/binlog_stmt.test | 25 + mysql-test/suite/perfschema/t/cnf_option.cnf | 25 + mysql-test/suite/perfschema/t/cnf_option.test | 24 + .../suite/perfschema/t/column_privilege.test | 82 + .../perfschema/t/ddl_cond_instances.test | 32 + .../t/ddl_events_waits_current.test | 31 + .../t/ddl_events_waits_history.test | 31 + .../t/ddl_events_waits_history_long.test | 31 + .../perfschema/t/ddl_ews_by_event_name.test | 31 + .../perfschema/t/ddl_ews_by_instance.test | 31 + .../t/ddl_ews_by_thread_by_event_name.test | 33 + .../perfschema/t/ddl_file_instances.test | 32 + .../perfschema/t/ddl_fs_by_event_name.test | 31 + .../perfschema/t/ddl_fs_by_instance.test | 31 + .../perfschema/t/ddl_mutex_instances.test | 32 + .../perfschema/t/ddl_performance_timers.test | 32 + .../suite/perfschema/t/ddl_processlist.test | 32 + .../perfschema/t/ddl_rwlock_instances.test | 32 + .../perfschema/t/ddl_setup_consumers.test | 33 + .../perfschema/t/ddl_setup_instruments.test | 33 + .../suite/perfschema/t/ddl_setup_objects.test | 32 + .../suite/perfschema/t/ddl_setup_timers.test | 33 + mysql-test/suite/perfschema/t/disabled.def | 27 + .../perfschema/t/dml_cond_instances.test | 55 + .../t/dml_events_waits_current.test | 62 + .../t/dml_events_waits_history.test | 70 + .../t/dml_events_waits_history_long.test | 70 + .../perfschema/t/dml_ews_by_event_name.test | 62 + .../perfschema/t/dml_ews_by_instance.test | 79 + .../t/dml_ews_by_thread_by_event_name.test | 63 + .../perfschema/t/dml_file_instances.test | 55 + .../t/dml_file_summary_by_event_name.test | 62 + .../t/dml_file_summary_by_instance.test | 62 + .../perfschema/t/dml_mutex_instances.test | 55 + .../perfschema/t/dml_performance_timers.test | 57 + .../suite/perfschema/t/dml_processlist.test | 61 + .../perfschema/t/dml_rwlock_instances.test | 55 + .../perfschema/t/dml_setup_consumers.test | 59 + .../perfschema/t/dml_setup_instruments.test | 100 + .../suite/perfschema/t/dml_setup_objects.test | 75 + .../suite/perfschema/t/dml_setup_timers.test | 61 + .../suite/perfschema/t/func_file_io.test | 192 ++ mysql-test/suite/perfschema/t/func_mutex.test | 131 ++ .../suite/perfschema/t/global_read_lock.test | 90 + .../perfschema/t/information_schema.test | 67 + mysql-test/suite/perfschema/t/misc.test | 57 + .../suite/perfschema/t/myisam_file_io.opt | 1 + .../suite/perfschema/t/myisam_file_io.test | 63 + .../suite/perfschema/t/no_threads-master.opt | 1 + mysql-test/suite/perfschema/t/no_threads.test | 69 + .../t/one_thread_per_con-master.opt | 1 + .../perfschema/t/one_thread_per_con.test | 94 + .../perfschema/t/pool_of_threads-master.opt | 1 + mysql-test/suite/perfschema/t/privilege.test | 362 +++ .../suite/perfschema/t/query_cache.test | 68 + mysql-test/suite/perfschema/t/read_only.test | 96 + mysql-test/suite/perfschema/t/schema.test | 46 + mysql-test/suite/perfschema/t/selects.test | 156 ++ .../suite/perfschema/t/server_init.test | 263 +++ .../t/start_server_no_cond_class-master.opt | 1 + .../t/start_server_no_cond_class.test | 38 + .../t/start_server_no_cond_inst-master.opt | 1 + .../t/start_server_no_cond_inst.test | 41 + .../t/start_server_no_file_class-master.opt | 1 + .../t/start_server_no_file_class.test | 38 + .../t/start_server_no_file_inst-master.opt | 1 + .../t/start_server_no_file_inst.test | 41 + .../t/start_server_no_mutex_class-master.opt | 1 + .../t/start_server_no_mutex_class.test | 38 + .../t/start_server_no_mutex_inst-master.opt | 1 + .../t/start_server_no_mutex_inst.test | 41 + .../t/start_server_no_rwlock_class-master.opt | 1 + .../t/start_server_no_rwlock_class.test | 38 + .../t/start_server_no_rwlock_inst-master.opt | 1 + .../t/start_server_no_rwlock_inst.test | 41 + .../t/start_server_no_thread_class-master.opt | 1 + .../t/start_server_no_thread_class.test | 38 + .../t/start_server_no_thread_inst-master.opt | 1 + .../t/start_server_no_thread_inst.test | 42 + .../perfschema/t/start_server_off-master.opt | 1 + .../suite/perfschema/t/start_server_off.test | 25 + .../perfschema/t/start_server_on-master.opt | 1 + .../suite/perfschema/t/start_server_on.test | 25 + .../t/tampered_perfschema_table1-master.opt | 1 + .../t/tampered_perfschema_table1.test | 44 + mysql-test/suite/perfschema_stress/README | 34 + .../perfschema_stress/include/settings.inc | 17 + .../suite/perfschema_stress/r/modify.result | 17 + .../suite/perfschema_stress/r/read.result | 29 + .../suite/perfschema_stress/r/work.result | 16 + .../suite/perfschema_stress/stress_init.txt | 1 + .../suite/perfschema_stress/stress_tests.txt | 10 + .../suite/perfschema_stress/t/modify.test | 55 + .../suite/perfschema_stress/t/read.test | 49 + .../suite/perfschema_stress/t/setup.test | 64 + .../suite/perfschema_stress/t/work.test | 47 + mysql-test/suite/rpl/r/rpl_loaddata_m.result | 1 + .../suite/rpl/r/rpl_row_basic_11bugs.result | 2 + mysql-test/t/bug46080-master.opt | 2 +- mysql-test/t/mysqld--help-notwin.test | 16 + mysql-test/t/mysqld--help-win.test | 16 + mysys/my_rdtsc.c | 12 +- scripts/mysql_system_tables.sql | 359 +++ sql/event_queue.cc | 8 +- sql/event_scheduler.cc | 36 +- sql/ha_ndbcluster_binlog.cc | 8 +- sql/item_func.cc | 4 +- sql/lock.cc | 2 +- sql/log.cc | 4 +- sql/mysql_priv.h | 14 +- sql/mysqld.cc | 165 +- sql/repl_failsafe.cc | 8 +- sql/scheduler.cc | 4 +- sql/slave.cc | 20 +- sql/slave.h | 2 +- sql/sp_head.cc | 6 +- sql/sql_insert.cc | 18 +- sql/sql_parse.cc | 10 +- sql/sql_repl.cc | 32 +- sql/sql_show.cc | 14 +- storage/perfschema/CMakeLists.txt | 79 + storage/perfschema/Makefile.am | 76 + storage/perfschema/ha_perfschema.cc | 382 +++ storage/perfschema/ha_perfschema.h | 159 ++ storage/perfschema/pfs.cc | 2053 +++++++++++++++++ storage/perfschema/pfs.h | 34 + storage/perfschema/pfs_atomic.cc | 78 + storage/perfschema/pfs_atomic.h | 148 ++ storage/perfschema/pfs_check.cc | 62 + storage/perfschema/pfs_column_types.h | 119 + storage/perfschema/pfs_column_values.cc | 42 + storage/perfschema/pfs_column_values.h | 34 + storage/perfschema/pfs_engine_table.cc | 717 ++++++ storage/perfschema/pfs_engine_table.h | 336 +++ storage/perfschema/pfs_events_waits.cc | 197 ++ storage/perfschema/pfs_events_waits.h | 185 ++ storage/perfschema/pfs_global.cc | 66 + storage/perfschema/pfs_global.h | 59 + storage/perfschema/pfs_instr.cc | 962 ++++++++ storage/perfschema/pfs_instr.h | 266 +++ storage/perfschema/pfs_instr_class.cc | 878 +++++++ storage/perfschema/pfs_instr_class.h | 251 ++ storage/perfschema/pfs_lock.h | 173 ++ storage/perfschema/pfs_server.cc | 131 ++ storage/perfschema/pfs_server.h | 101 + storage/perfschema/pfs_stat.h | 125 + storage/perfschema/pfs_timer.cc | 119 + storage/perfschema/pfs_timer.h | 34 + storage/perfschema/plug.in | 26 + storage/perfschema/table_all_instr.cc | 264 +++ storage/perfschema/table_all_instr.h | 168 ++ storage/perfschema/table_events_waits.cc | 773 +++++++ storage/perfschema/table_events_waits.h | 248 ++ .../perfschema/table_events_waits_summary.cc | 696 ++++++ .../perfschema/table_events_waits_summary.h | 261 +++ storage/perfschema/table_file_instances.cc | 180 ++ storage/perfschema/table_file_instances.h | 90 + storage/perfschema/table_file_summary.cc | 371 +++ storage/perfschema/table_file_summary.h | 151 ++ .../perfschema/table_performance_timers.cc | 187 ++ storage/perfschema/table_performance_timers.h | 86 + storage/perfschema/table_processlist.cc | 176 ++ storage/perfschema/table_processlist.h | 91 + storage/perfschema/table_setup_consumers.cc | 211 ++ storage/perfschema/table_setup_consumers.h | 85 + storage/perfschema/table_setup_instruments.cc | 276 +++ storage/perfschema/table_setup_instruments.h | 121 + storage/perfschema/table_setup_objects.cc | 280 +++ storage/perfschema/table_setup_objects.h | 125 + storage/perfschema/table_setup_timers.cc | 183 ++ storage/perfschema/table_setup_timers.h | 85 + storage/perfschema/table_sync_instances.cc | 507 ++++ storage/perfschema/table_sync_instances.h | 206 ++ storage/perfschema/unittest/CMakeLists.txt | 39 + storage/perfschema/unittest/Makefile.am | 58 + storage/perfschema/unittest/conf.txt | 420 ++++ storage/perfschema/unittest/pfs-t.cc | 1201 ++++++++++ .../perfschema/unittest/pfs_instr-oom-t.cc | 210 ++ storage/perfschema/unittest/pfs_instr-t.cc | 411 ++++ .../unittest/pfs_instr_class-oom-t.cc | 58 + .../perfschema/unittest/pfs_instr_class-t.cc | 570 +++++ storage/perfschema/unittest/pfs_timer-t.cc | 116 + storage/perfschema/unittest/stub_pfs_global.h | 41 + .../perfschema/unittest/stub_print_error.h | 40 + 285 files changed, 27090 insertions(+), 629 deletions(-) create mode 100644 mysql-test/suite/perfschema/include/binlog_common.inc create mode 100644 mysql-test/suite/perfschema/include/cleanup_helper.inc create mode 100644 mysql-test/suite/perfschema/include/privilege.inc create mode 100644 mysql-test/suite/perfschema/include/setup_helper.inc create mode 100644 mysql-test/suite/perfschema/include/start_server_common.inc create mode 100644 mysql-test/suite/perfschema/r/aggregate.result create mode 100644 mysql-test/suite/perfschema/r/bad_option_1.result create mode 100644 mysql-test/suite/perfschema/r/bad_option_2.result create mode 100644 mysql-test/suite/perfschema/r/binlog_mix.result create mode 100644 mysql-test/suite/perfschema/r/binlog_row.result create mode 100644 mysql-test/suite/perfschema/r/binlog_stmt.result create mode 100644 mysql-test/suite/perfschema/r/cnf_option.result create mode 100644 mysql-test/suite/perfschema/r/column_privilege.result create mode 100644 mysql-test/suite/perfschema/r/ddl_cond_instances.result create mode 100644 mysql-test/suite/perfschema/r/ddl_events_waits_current.result create mode 100644 mysql-test/suite/perfschema/r/ddl_events_waits_history.result create mode 100644 mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result create mode 100644 mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result create mode 100644 mysql-test/suite/perfschema/r/ddl_ews_by_instance.result create mode 100644 mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result create mode 100644 mysql-test/suite/perfschema/r/ddl_file_instances.result create mode 100644 mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result create mode 100644 mysql-test/suite/perfschema/r/ddl_fs_by_instance.result create mode 100644 mysql-test/suite/perfschema/r/ddl_mutex_instances.result create mode 100644 mysql-test/suite/perfschema/r/ddl_performance_timers.result create mode 100644 mysql-test/suite/perfschema/r/ddl_processlist.result create mode 100644 mysql-test/suite/perfschema/r/ddl_rwlock_instances.result create mode 100644 mysql-test/suite/perfschema/r/ddl_setup_consumers.result create mode 100644 mysql-test/suite/perfschema/r/ddl_setup_instruments.result create mode 100644 mysql-test/suite/perfschema/r/ddl_setup_objects.result create mode 100644 mysql-test/suite/perfschema/r/ddl_setup_timers.result create mode 100644 mysql-test/suite/perfschema/r/dml_cond_instances.result create mode 100644 mysql-test/suite/perfschema/r/dml_events_waits_current.result create mode 100644 mysql-test/suite/perfschema/r/dml_events_waits_history.result create mode 100644 mysql-test/suite/perfschema/r/dml_events_waits_history_long.result create mode 100644 mysql-test/suite/perfschema/r/dml_ews_by_event_name.result create mode 100644 mysql-test/suite/perfschema/r/dml_ews_by_instance.result create mode 100644 mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result create mode 100644 mysql-test/suite/perfschema/r/dml_file_instances.result create mode 100644 mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result create mode 100644 mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result create mode 100644 mysql-test/suite/perfschema/r/dml_mutex_instances.result create mode 100644 mysql-test/suite/perfschema/r/dml_performance_timers.result create mode 100644 mysql-test/suite/perfschema/r/dml_processlist.result create mode 100644 mysql-test/suite/perfschema/r/dml_rwlock_instances.result create mode 100644 mysql-test/suite/perfschema/r/dml_setup_consumers.result create mode 100644 mysql-test/suite/perfschema/r/dml_setup_instruments.result create mode 100644 mysql-test/suite/perfschema/r/dml_setup_objects.result create mode 100644 mysql-test/suite/perfschema/r/dml_setup_timers.result create mode 100644 mysql-test/suite/perfschema/r/func_file_io.result create mode 100644 mysql-test/suite/perfschema/r/func_mutex.result create mode 100644 mysql-test/suite/perfschema/r/global_read_lock.result create mode 100644 mysql-test/suite/perfschema/r/information_schema.result create mode 100644 mysql-test/suite/perfschema/r/misc.result create mode 100644 mysql-test/suite/perfschema/r/myisam_file_io.result create mode 100644 mysql-test/suite/perfschema/r/no_threads.result create mode 100644 mysql-test/suite/perfschema/r/one_thread_per_con.result create mode 100644 mysql-test/suite/perfschema/r/privilege.result create mode 100644 mysql-test/suite/perfschema/r/query_cache.result create mode 100644 mysql-test/suite/perfschema/r/read_only.result create mode 100644 mysql-test/suite/perfschema/r/schema.result create mode 100644 mysql-test/suite/perfschema/r/selects.result create mode 100644 mysql-test/suite/perfschema/r/server_init.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_cond_class.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_cond_inst.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_file_class.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_file_inst.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_mutex_class.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_thread_class.result create mode 100644 mysql-test/suite/perfschema/r/start_server_no_thread_inst.result create mode 100644 mysql-test/suite/perfschema/r/start_server_off.result create mode 100644 mysql-test/suite/perfschema/r/start_server_on.result create mode 100644 mysql-test/suite/perfschema/r/tampered_perfschema_table1.result create mode 100644 mysql-test/suite/perfschema/t/aggregate.test create mode 100644 mysql-test/suite/perfschema/t/bad_option_1.test create mode 100644 mysql-test/suite/perfschema/t/bad_option_2.test create mode 100644 mysql-test/suite/perfschema/t/binlog_mix.test create mode 100644 mysql-test/suite/perfschema/t/binlog_row.test create mode 100644 mysql-test/suite/perfschema/t/binlog_stmt.test create mode 100644 mysql-test/suite/perfschema/t/cnf_option.cnf create mode 100644 mysql-test/suite/perfschema/t/cnf_option.test create mode 100644 mysql-test/suite/perfschema/t/column_privilege.test create mode 100644 mysql-test/suite/perfschema/t/ddl_cond_instances.test create mode 100644 mysql-test/suite/perfschema/t/ddl_events_waits_current.test create mode 100644 mysql-test/suite/perfschema/t/ddl_events_waits_history.test create mode 100644 mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test create mode 100644 mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test create mode 100644 mysql-test/suite/perfschema/t/ddl_ews_by_instance.test create mode 100644 mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test create mode 100644 mysql-test/suite/perfschema/t/ddl_file_instances.test create mode 100644 mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test create mode 100644 mysql-test/suite/perfschema/t/ddl_fs_by_instance.test create mode 100644 mysql-test/suite/perfschema/t/ddl_mutex_instances.test create mode 100644 mysql-test/suite/perfschema/t/ddl_performance_timers.test create mode 100644 mysql-test/suite/perfschema/t/ddl_processlist.test create mode 100644 mysql-test/suite/perfschema/t/ddl_rwlock_instances.test create mode 100644 mysql-test/suite/perfschema/t/ddl_setup_consumers.test create mode 100644 mysql-test/suite/perfschema/t/ddl_setup_instruments.test create mode 100644 mysql-test/suite/perfschema/t/ddl_setup_objects.test create mode 100644 mysql-test/suite/perfschema/t/ddl_setup_timers.test create mode 100644 mysql-test/suite/perfschema/t/disabled.def create mode 100644 mysql-test/suite/perfschema/t/dml_cond_instances.test create mode 100644 mysql-test/suite/perfschema/t/dml_events_waits_current.test create mode 100644 mysql-test/suite/perfschema/t/dml_events_waits_history.test create mode 100644 mysql-test/suite/perfschema/t/dml_events_waits_history_long.test create mode 100644 mysql-test/suite/perfschema/t/dml_ews_by_event_name.test create mode 100644 mysql-test/suite/perfschema/t/dml_ews_by_instance.test create mode 100644 mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test create mode 100644 mysql-test/suite/perfschema/t/dml_file_instances.test create mode 100644 mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test create mode 100644 mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test create mode 100644 mysql-test/suite/perfschema/t/dml_mutex_instances.test create mode 100644 mysql-test/suite/perfschema/t/dml_performance_timers.test create mode 100644 mysql-test/suite/perfschema/t/dml_processlist.test create mode 100644 mysql-test/suite/perfschema/t/dml_rwlock_instances.test create mode 100644 mysql-test/suite/perfschema/t/dml_setup_consumers.test create mode 100644 mysql-test/suite/perfschema/t/dml_setup_instruments.test create mode 100644 mysql-test/suite/perfschema/t/dml_setup_objects.test create mode 100644 mysql-test/suite/perfschema/t/dml_setup_timers.test create mode 100644 mysql-test/suite/perfschema/t/func_file_io.test create mode 100644 mysql-test/suite/perfschema/t/func_mutex.test create mode 100644 mysql-test/suite/perfschema/t/global_read_lock.test create mode 100644 mysql-test/suite/perfschema/t/information_schema.test create mode 100644 mysql-test/suite/perfschema/t/misc.test create mode 100644 mysql-test/suite/perfschema/t/myisam_file_io.opt create mode 100644 mysql-test/suite/perfschema/t/myisam_file_io.test create mode 100644 mysql-test/suite/perfschema/t/no_threads-master.opt create mode 100644 mysql-test/suite/perfschema/t/no_threads.test create mode 100644 mysql-test/suite/perfschema/t/one_thread_per_con-master.opt create mode 100644 mysql-test/suite/perfschema/t/one_thread_per_con.test create mode 100644 mysql-test/suite/perfschema/t/pool_of_threads-master.opt create mode 100644 mysql-test/suite/perfschema/t/privilege.test create mode 100644 mysql-test/suite/perfschema/t/query_cache.test create mode 100644 mysql-test/suite/perfschema/t/read_only.test create mode 100644 mysql-test/suite/perfschema/t/schema.test create mode 100644 mysql-test/suite/perfschema/t/selects.test create mode 100644 mysql-test/suite/perfschema/t/server_init.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_cond_class.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_cond_inst.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_file_class.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_file_inst.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_mutex_class.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_thread_class.test create mode 100644 mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_no_thread_inst.test create mode 100644 mysql-test/suite/perfschema/t/start_server_off-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_off.test create mode 100644 mysql-test/suite/perfschema/t/start_server_on-master.opt create mode 100644 mysql-test/suite/perfschema/t/start_server_on.test create mode 100644 mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt create mode 100644 mysql-test/suite/perfschema/t/tampered_perfschema_table1.test create mode 100644 mysql-test/suite/perfschema_stress/README create mode 100644 mysql-test/suite/perfschema_stress/include/settings.inc create mode 100644 mysql-test/suite/perfschema_stress/r/modify.result create mode 100644 mysql-test/suite/perfschema_stress/r/read.result create mode 100644 mysql-test/suite/perfschema_stress/r/work.result create mode 100644 mysql-test/suite/perfschema_stress/stress_init.txt create mode 100644 mysql-test/suite/perfschema_stress/stress_tests.txt create mode 100644 mysql-test/suite/perfschema_stress/t/modify.test create mode 100644 mysql-test/suite/perfschema_stress/t/read.test create mode 100644 mysql-test/suite/perfschema_stress/t/setup.test create mode 100644 mysql-test/suite/perfschema_stress/t/work.test create mode 100644 storage/perfschema/CMakeLists.txt create mode 100644 storage/perfschema/Makefile.am create mode 100644 storage/perfschema/ha_perfschema.cc create mode 100644 storage/perfschema/ha_perfschema.h create mode 100644 storage/perfschema/pfs.cc create mode 100644 storage/perfschema/pfs.h create mode 100644 storage/perfschema/pfs_atomic.cc create mode 100644 storage/perfschema/pfs_atomic.h create mode 100644 storage/perfschema/pfs_check.cc create mode 100644 storage/perfschema/pfs_column_types.h create mode 100644 storage/perfschema/pfs_column_values.cc create mode 100644 storage/perfschema/pfs_column_values.h create mode 100644 storage/perfschema/pfs_engine_table.cc create mode 100644 storage/perfschema/pfs_engine_table.h create mode 100644 storage/perfschema/pfs_events_waits.cc create mode 100644 storage/perfschema/pfs_events_waits.h create mode 100644 storage/perfschema/pfs_global.cc create mode 100644 storage/perfschema/pfs_global.h create mode 100644 storage/perfschema/pfs_instr.cc create mode 100644 storage/perfschema/pfs_instr.h create mode 100644 storage/perfschema/pfs_instr_class.cc create mode 100644 storage/perfschema/pfs_instr_class.h create mode 100644 storage/perfschema/pfs_lock.h create mode 100644 storage/perfschema/pfs_server.cc create mode 100644 storage/perfschema/pfs_server.h create mode 100644 storage/perfschema/pfs_stat.h create mode 100644 storage/perfschema/pfs_timer.cc create mode 100644 storage/perfschema/pfs_timer.h create mode 100644 storage/perfschema/plug.in create mode 100644 storage/perfschema/table_all_instr.cc create mode 100644 storage/perfschema/table_all_instr.h create mode 100644 storage/perfschema/table_events_waits.cc create mode 100644 storage/perfschema/table_events_waits.h create mode 100644 storage/perfschema/table_events_waits_summary.cc create mode 100644 storage/perfschema/table_events_waits_summary.h create mode 100644 storage/perfschema/table_file_instances.cc create mode 100644 storage/perfschema/table_file_instances.h create mode 100644 storage/perfschema/table_file_summary.cc create mode 100644 storage/perfschema/table_file_summary.h create mode 100644 storage/perfschema/table_performance_timers.cc create mode 100644 storage/perfschema/table_performance_timers.h create mode 100644 storage/perfschema/table_processlist.cc create mode 100644 storage/perfschema/table_processlist.h create mode 100644 storage/perfschema/table_setup_consumers.cc create mode 100644 storage/perfschema/table_setup_consumers.h create mode 100644 storage/perfschema/table_setup_instruments.cc create mode 100644 storage/perfschema/table_setup_instruments.h create mode 100644 storage/perfschema/table_setup_objects.cc create mode 100644 storage/perfschema/table_setup_objects.h create mode 100644 storage/perfschema/table_setup_timers.cc create mode 100644 storage/perfschema/table_setup_timers.h create mode 100644 storage/perfschema/table_sync_instances.cc create mode 100644 storage/perfschema/table_sync_instances.h create mode 100644 storage/perfschema/unittest/CMakeLists.txt create mode 100644 storage/perfschema/unittest/Makefile.am create mode 100644 storage/perfschema/unittest/conf.txt create mode 100644 storage/perfschema/unittest/pfs-t.cc create mode 100644 storage/perfschema/unittest/pfs_instr-oom-t.cc create mode 100644 storage/perfschema/unittest/pfs_instr-t.cc create mode 100644 storage/perfschema/unittest/pfs_instr_class-oom-t.cc create mode 100644 storage/perfschema/unittest/pfs_instr_class-t.cc create mode 100644 storage/perfschema/unittest/pfs_timer-t.cc create mode 100644 storage/perfschema/unittest/stub_pfs_global.h create mode 100644 storage/perfschema/unittest/stub_print_error.h diff --git a/BUILD/compile-dist b/BUILD/compile-dist index cf6cefc0969..9fe3aaf8bb5 100755 --- a/BUILD/compile-dist +++ b/BUILD/compile-dist @@ -1,4 +1,20 @@ #!/bin/sh + +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # This script's purpose is to update the automake/autoconf helper scripts and # to run a plain "configure" without any special compile flags. Only features @@ -61,6 +77,7 @@ fi # Remember that configure restricts the man pages to the configured features ! ./configure \ --with-embedded-server \ + --with-perfschema \ --with-ndbcluster $gmake diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 2686cd36355..6d870f4bcdf 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -1,4 +1,4 @@ -# Copyright (C) 2000-2006 MySQL AB +# Copyright (C) 2000-2006 MySQL AB, 2008-2009 Sun Microsystems, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public @@ -75,6 +75,8 @@ EXTRA_DIST = README \ # List of directories containing test + result files and the # related test data files that should be copied +# If you want to add a new suite, please check DEFAULT_SUITES in +# mysql-test-run.pl. TEST_DIRS = t r include std_data std_data/parts collections \ std_data/ndb_backup50 std_data/ndb_backup51 \ std_data/ndb_backup51_data_be std_data/ndb_backup51_data_le \ @@ -100,7 +102,9 @@ TEST_DIRS = t r include std_data std_data/parts collections \ suite/rpl_ndb suite/rpl_ndb/t suite/rpl_ndb/r \ suite/parts suite/parts/t suite/parts/r suite/parts/inc \ suite/innodb suite/innodb/t suite/innodb/r suite/innodb/include \ - suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r + suite/sys_vars suite/sys_vars/t suite/sys_vars/inc suite/sys_vars/r \ + suite/perfschema suite/perfschema/t suite/perfschema/r \ + suite/perfschema/include # Used by dist-hook and install-data-local to copy all # test files into either dist or install directory diff --git a/mysql-test/include/default_my.cnf b/mysql-test/include/default_my.cnf index 428c2166947..6888a69b0a4 100644 --- a/mysql-test/include/default_my.cnf +++ b/mysql-test/include/default_my.cnf @@ -1,3 +1,18 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # Use default setting for mysqld processes !include default_mysqld.cnf !include default_client.cnf @@ -9,6 +24,8 @@ log-bin= master-bin +# Run tests with the performance schema instrumentation +loose-enable-performance-schema [mysqlbinlog] disable-force-if-open diff --git a/mysql-test/include/default_mysqld.cnf b/mysql-test/include/default_mysqld.cnf index 6116b20d8bb..def14abf55a 100644 --- a/mysql-test/include/default_mysqld.cnf +++ b/mysql-test/include/default_mysqld.cnf @@ -1,3 +1,18 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # Default values that applies to all MySQL Servers [mysqld] open-files-limit= 1024 @@ -26,3 +41,6 @@ slave-net-timeout=120 log-bin=mysqld-bin +# Run tests with the performance schema instrumentation +loose-enable-performance-schema + diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 27f4891c39e..02404af5eea 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1,6 +1,21 @@ #!/usr/bin/perl # -*- cperl -*- +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # ############################################################################## # @@ -128,7 +143,9 @@ my $path_config_file; # The generated config file, var/my.cnf # executables will be used by the test suite. our $opt_vs_config = $ENV{'MTR_VS_CONFIG'}; -my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb"; +# If you add a new suite, please check TEST_DIRS in Makefile.am. +# +my $DEFAULT_SUITES= "main,sys_vars,binlog,federated,rpl,rpl_ndb,ndb,innodb,perfschema"; my $opt_suites; our $opt_verbose= 0; # Verbose output, enable with --verbose diff --git a/mysql-test/r/1st.result b/mysql-test/r/1st.result index 4a82f8c66e9..ae9989ce563 100644 --- a/mysql-test/r/1st.result +++ b/mysql-test/r/1st.result @@ -3,6 +3,7 @@ Database information_schema mtr mysql +performance_schema test show tables in mysql; Tables_in_mysql diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result index 54bd05e526f..ae75f21955e 100644 --- a/mysql-test/r/drop.result +++ b/mysql-test/r/drop.result @@ -50,6 +50,7 @@ information_schema mtr mysql mysqltest +performance_schema test flush tables with read lock; drop database mysqltest; @@ -61,6 +62,7 @@ Database information_schema mtr mysql +performance_schema test drop database mysqltest; ERROR HY000: Can't drop database 'mysqltest'; database doesn't exist diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result index ea0f28d123d..017aa6331ff 100644 --- a/mysql-test/r/information_schema.result +++ b/mysql-test/r/information_schema.result @@ -11,12 +11,14 @@ select * from information_schema.SCHEMATA where schema_name > 'm'; CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH def mtr latin1 latin1_swedish_ci NULL def mysql latin1 latin1_swedish_ci NULL +def performance_schema utf8 utf8_general_ci NULL def test latin1 latin1_swedish_ci NULL select schema_name from information_schema.schemata; schema_name information_schema mtr mysql +performance_schema test show databases like 't%'; Database (t%) @@ -26,6 +28,7 @@ Database information_schema mtr mysql +performance_schema test show databases where `database` = 't%'; Database @@ -363,6 +366,7 @@ c information_schema mtr mysql +performance_schema test explain select * from v0; id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/r/mysqld--help-notwin.result b/mysql-test/r/mysqld--help-notwin.result index 2ba7df6b7e3..99e2756e029 100644 --- a/mysql-test/r/mysqld--help-notwin.result +++ b/mysql-test/r/mysqld--help-notwin.result @@ -417,6 +417,38 @@ The following options may be given as the first argument: is one of {on, off, default} --partition[=name] Enable or disable partition plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load). + --performance-schema + Enable the performance schema. + --performance-schema-events-waits-history-long-size=# + Number of rows in EVENTS_WAITS_HISTORY_LONG. + --performance-schema-events-waits-history-size=# + Number of rows per thread in EVENTS_WAITS_HISTORY. + --performance-schema-max-cond-classes=# + Maximum number of condition instruments. + --performance-schema-max-cond-instances=# + Maximum number of instrumented condition objects. + --performance-schema-max-file-classes=# + Maximum number of file instruments. + --performance-schema-max-file-handles=# + Maximum number of opened instrumented files. + --performance-schema-max-file-instances=# + Maximum number of instrumented files. + --performance-schema-max-mutex-classes=# + Maximum number of mutex instruments. + --performance-schema-max-mutex-instances=# + Maximum number of instrumented MUTEX objects. + --performance-schema-max-rwlock-classes=# + Maximum number of rwlock instruments. + --performance-schema-max-rwlock-instances=# + Maximum number of instrumented RWLOCK objects. + --performance-schema-max-table-handles=# + Maximum number of opened instrumented tables. + --performance-schema-max-table-instances=# + Maximum number of instrumented tables. + --performance-schema-max-thread-classes=# + Maximum number of thread instruments. + --performance-schema-max-thread-instances=# + Maximum number of instrumented threads. --pid-file=name Pid file used by safe_mysqld --plugin-dir=name Directory for plugins --plugin-load=name Optional semicolon-separated list of plugins to load, @@ -716,223 +748,239 @@ The following options may be given as the first argument: -W, --warnings[=#] Deprecated; use --log-warnings instead. Variables (--variable-name=value) -and boolean options {FALSE|TRUE} Value (after reading options) ------------------------------------ -------------------------------------- -abort-slave-event-count 0 -allow-suspicious-udfs FALSE -archive ON -auto-increment-increment 1 -auto-increment-offset 1 -automatic-sp-privileges TRUE -back-log 50 -big-tables FALSE -bind-address (No default value) -binlog-cache-size 32768 -binlog-format STATEMENT -binlog-row-event-max-size 1024 -blackhole ON -bulk-insert-buffer-size 8388608 -character-set-client-handshake TRUE -character-set-filesystem binary -character-set-server latin1 -character-sets-dir MYSQL_SHAREDIR/charsets/ -chroot (No default value) -collation-server latin1_swedish_ci -completion-type NO_CHAIN -concurrent-insert AUTO -connect-timeout 10 -console FALSE -datadir MYSQLTEST_VARDIR/install.db/ -date-format %Y-%m-%d -datetime-format %Y-%m-%d %H:%i:%s -default-character-set latin1 -default-collation latin1_swedish_ci -default-storage-engine MyISAM -default-time-zone (No default value) -default-week-format 0 -delay-key-write ON -delayed-insert-limit 100 -delayed-insert-timeout 300 -delayed-queue-size 1000 -disconnect-slave-event-count 0 -div-precision-increment 4 -enable-locking FALSE -engine-condition-pushdown TRUE -event-scheduler OFF -expire-logs-days 0 -external-locking FALSE -federated ON -flush FALSE -flush-time 0 -ft-boolean-syntax + -><()~*:""&| -ft-max-word-len 84 -ft-min-word-len 4 -ft-query-expansion-limit 20 -ft-stopword-file (No default value) -gdb FALSE -general-log FALSE -group-concat-max-len 1024 -help TRUE -ignore-builtin-innodb FALSE -init-connect -init-file (No default value) -init-rpl-role MASTER -init-slave -interactive-timeout 28800 -join-buffer-size 131072 -keep-files-on-create FALSE -key-buffer-size 8388608 -key-cache-age-threshold 300 -key-cache-block-size 1024 -key-cache-division-limit 100 -language MYSQL_SHAREDIR/ -large-pages FALSE -lc-messages en_US -lc-messages-dir MYSQL_SHAREDIR/ -lc-time-names en_US -local-infile TRUE -log-bin (No default value) -log-bin-index (No default value) -log-bin-trust-function-creators FALSE -log-error -log-isam myisam.log -log-output FILE -log-queries-not-using-indexes FALSE -log-short-format FALSE -log-slave-updates FALSE -log-slow-admin-statements FALSE -log-slow-slave-statements FALSE -log-tc tc.log -log-tc-size 24576 -log-update (No default value) -log-warnings 1 -long-query-time 10 -low-priority-updates FALSE -lower-case-table-names 1 -master-info-file master.info -master-retry-count 86400 -max-allowed-packet 1048576 -max-binlog-cache-size 18446744073709547520 -max-binlog-dump-events 0 -max-binlog-size 1073741824 -max-connect-errors 10 -max-connections 151 -max-delayed-threads 20 -max-error-count 64 -max-heap-table-size 16777216 -max-join-size 18446744073709551615 -max-length-for-sort-data 1024 -max-prepared-stmt-count 16382 -max-relay-log-size 0 -max-seeks-for-key 18446744073709551615 -max-sort-length 1024 -max-sp-recursion-depth 0 -max-tmp-tables 32 -max-user-connections 0 -max-write-lock-count 18446744073709551615 -memlock FALSE -min-examined-row-limit 0 -multi-range-count 256 -myisam-block-size 1024 -myisam-data-pointer-size 6 -myisam-max-sort-file-size 9223372036853727232 -myisam-mmap-size 18446744073709551615 -myisam-recover-options OFF -myisam-repair-threads 1 -myisam-sort-buffer-size 8388608 -myisam-stats-method nulls_unequal -myisam-use-mmap FALSE -net-buffer-length 16384 -net-read-timeout 30 -net-retry-count 10 -net-write-timeout 60 -new FALSE -old FALSE -old-alter-table FALSE -old-passwords FALSE -old-style-user-limits FALSE -optimizer-prune-level 1 -optimizer-search-depth 62 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on -partition ON -plugin-dir MYSQL_LIBDIR/mysql/plugin -plugin-load (No default value) -port 3306 -port-open-timeout 0 -preload-buffer-size 32768 -profiling-history-size 15 -query-alloc-block-size 8192 -query-cache-limit 1048576 -query-cache-min-res-unit 4096 -query-cache-size 0 -query-cache-type ON -query-cache-wlock-invalidate FALSE -query-prealloc-size 8192 -range-alloc-block-size 4096 -read-buffer-size 131072 -read-only FALSE -read-rnd-buffer-size 262144 -record-buffer 131072 -relay-log (No default value) -relay-log-index (No default value) -relay-log-info-file relay-log.info -relay-log-purge TRUE -relay-log-recovery FALSE -relay-log-space-limit 0 -replicate-same-server-id FALSE -report-host (No default value) -report-password (No default value) -report-port 3306 -report-user (No default value) -rpl-recovery-rank 0 -safe-user-create FALSE -secure-auth FALSE -secure-file-priv (No default value) -server-id 0 -show-slave-auth-info FALSE -skip-grant-tables TRUE -skip-networking FALSE -skip-show-database FALSE -skip-slave-start FALSE -slave-compressed-protocol FALSE -slave-exec-mode STRICT -slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ -slave-net-timeout 3600 -slave-skip-errors (No default value) -slave-transaction-retries 10 -slow-launch-time 2 -slow-query-log FALSE -socket /tmp/mysql.sock -sort-buffer-size 2097152 -sporadic-binlog-dump-fail FALSE -sql-mode -symbolic-links FALSE -sync-binlog 0 -sync-frm TRUE -sync-master-info 0 -sync-relay-log 0 -sync-relay-log-info 0 -sysdate-is-now FALSE -table-cache 400 -table-definition-cache 400 -table-lock-wait-timeout 50 -table-open-cache 400 -tc-heuristic-recover COMMIT -thread-cache-size 0 -thread-handling one-thread-per-connection -thread-stack 262144 -time-format %H:%i:%s -timed-mutexes FALSE -tmp-table-size 16777216 -tmpdir MYSQLTEST_VARDIR/tmp/ -transaction-alloc-block-size 8192 -transaction-isolation REPEATABLE-READ -transaction-prealloc-size 4096 -updatable-views-with-limit YES -use-symbolic-links FALSE -verbose TRUE -wait-timeout 28800 -warnings 1 +and boolean options {FALSE|TRUE} Value (after reading options) +------------------------------------------------- ------------------------ +abort-slave-event-count 0 +allow-suspicious-udfs FALSE +archive ON +auto-increment-increment 1 +auto-increment-offset 1 +automatic-sp-privileges TRUE +back-log 50 +big-tables FALSE +bind-address (No default value) +binlog-cache-size 32768 +binlog-format STATEMENT +binlog-row-event-max-size 1024 +blackhole ON +bulk-insert-buffer-size 8388608 +character-set-client-handshake TRUE +character-set-filesystem binary +character-set-server latin1 +character-sets-dir MYSQL_SHAREDIR/charsets/ +chroot (No default value) +collation-server latin1_swedish_ci +completion-type NO_CHAIN +concurrent-insert AUTO +connect-timeout 10 +console FALSE +datadir MYSQLTEST_VARDIR/install.db/ +date-format %Y-%m-%d +datetime-format %Y-%m-%d %H:%i:%s +default-character-set latin1 +default-collation latin1_swedish_ci +default-storage-engine MyISAM +default-time-zone (No default value) +default-week-format 0 +delay-key-write ON +delayed-insert-limit 100 +delayed-insert-timeout 300 +delayed-queue-size 1000 +disconnect-slave-event-count 0 +div-precision-increment 4 +enable-locking FALSE +engine-condition-pushdown TRUE +event-scheduler OFF +expire-logs-days 0 +external-locking FALSE +federated ON +flush FALSE +flush-time 0 +ft-boolean-syntax + -><()~*:""&| +ft-max-word-len 84 +ft-min-word-len 4 +ft-query-expansion-limit 20 +ft-stopword-file (No default value) +gdb FALSE +general-log FALSE +group-concat-max-len 1024 +help TRUE +ignore-builtin-innodb FALSE +init-connect +init-file (No default value) +init-rpl-role MASTER +init-slave +interactive-timeout 28800 +join-buffer-size 131072 +keep-files-on-create FALSE +key-buffer-size 8388608 +key-cache-age-threshold 300 +key-cache-block-size 1024 +key-cache-division-limit 100 +language MYSQL_SHAREDIR/ +large-pages FALSE +lc-messages en_US +lc-messages-dir MYSQL_SHAREDIR/ +lc-time-names en_US +local-infile TRUE +log-bin (No default value) +log-bin-index (No default value) +log-bin-trust-function-creators FALSE +log-error +log-isam myisam.log +log-output FILE +log-queries-not-using-indexes FALSE +log-short-format FALSE +log-slave-updates FALSE +log-slow-admin-statements FALSE +log-slow-slave-statements FALSE +log-tc tc.log +log-tc-size 24576 +log-update (No default value) +log-warnings 1 +long-query-time 10 +low-priority-updates FALSE +lower-case-table-names 1 +master-info-file master.info +master-retry-count 86400 +max-allowed-packet 1048576 +max-binlog-cache-size 18446744073709547520 +max-binlog-dump-events 0 +max-binlog-size 1073741824 +max-connect-errors 10 +max-connections 151 +max-delayed-threads 20 +max-error-count 64 +max-heap-table-size 16777216 +max-join-size 18446744073709551615 +max-length-for-sort-data 1024 +max-prepared-stmt-count 16382 +max-relay-log-size 0 +max-seeks-for-key 18446744073709551615 +max-sort-length 1024 +max-sp-recursion-depth 0 +max-tmp-tables 32 +max-user-connections 0 +max-write-lock-count 18446744073709551615 +memlock FALSE +min-examined-row-limit 0 +multi-range-count 256 +myisam-block-size 1024 +myisam-data-pointer-size 6 +myisam-max-sort-file-size 9223372036853727232 +myisam-mmap-size 18446744073709551615 +myisam-recover-options OFF +myisam-repair-threads 1 +myisam-sort-buffer-size 8388608 +myisam-stats-method nulls_unequal +myisam-use-mmap FALSE +net-buffer-length 16384 +net-read-timeout 30 +net-retry-count 10 +net-write-timeout 60 +new FALSE +old FALSE +old-alter-table FALSE +old-passwords FALSE +old-style-user-limits FALSE +optimizer-prune-level 1 +optimizer-search-depth 62 +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +partition ON +performance-schema FALSE +performance-schema-events-waits-history-long-size 10000 +performance-schema-events-waits-history-size 10 +performance-schema-max-cond-classes 80 +performance-schema-max-cond-instances 1000 +performance-schema-max-file-classes 50 +performance-schema-max-file-handles 32768 +performance-schema-max-file-instances 10000 +performance-schema-max-mutex-classes 200 +performance-schema-max-mutex-instances 1000 +performance-schema-max-rwlock-classes 20 +performance-schema-max-rwlock-instances 1000 +performance-schema-max-table-handles 100000 +performance-schema-max-table-instances 50000 +performance-schema-max-thread-classes 50 +performance-schema-max-thread-instances 1000 +plugin-dir MYSQL_LIBDIR/mysql/plugin +plugin-load (No default value) +port 3306 +port-open-timeout 0 +preload-buffer-size 32768 +profiling-history-size 15 +query-alloc-block-size 8192 +query-cache-limit 1048576 +query-cache-min-res-unit 4096 +query-cache-size 0 +query-cache-type ON +query-cache-wlock-invalidate FALSE +query-prealloc-size 8192 +range-alloc-block-size 4096 +read-buffer-size 131072 +read-only FALSE +read-rnd-buffer-size 262144 +record-buffer 131072 +relay-log (No default value) +relay-log-index (No default value) +relay-log-info-file relay-log.info +relay-log-purge TRUE +relay-log-recovery FALSE +relay-log-space-limit 0 +replicate-same-server-id FALSE +report-host (No default value) +report-password (No default value) +report-port 3306 +report-user (No default value) +rpl-recovery-rank 0 +safe-user-create FALSE +secure-auth FALSE +secure-file-priv (No default value) +server-id 0 +show-slave-auth-info FALSE +skip-grant-tables TRUE +skip-networking FALSE +skip-show-database FALSE +skip-slave-start FALSE +slave-compressed-protocol FALSE +slave-exec-mode STRICT +slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ +slave-net-timeout 3600 +slave-skip-errors (No default value) +slave-transaction-retries 10 +slow-launch-time 2 +slow-query-log FALSE +socket /tmp/mysql.sock +sort-buffer-size 2097152 +sporadic-binlog-dump-fail FALSE +sql-mode +symbolic-links FALSE +sync-binlog 0 +sync-frm TRUE +sync-master-info 0 +sync-relay-log 0 +sync-relay-log-info 0 +sysdate-is-now FALSE +table-cache 400 +table-definition-cache 400 +table-lock-wait-timeout 50 +table-open-cache 400 +tc-heuristic-recover COMMIT +thread-cache-size 0 +thread-handling one-thread-per-connection +thread-stack 262144 +time-format %H:%i:%s +timed-mutexes FALSE +tmp-table-size 16777216 +tmpdir MYSQLTEST_VARDIR/tmp/ +transaction-alloc-block-size 8192 +transaction-isolation REPEATABLE-READ +transaction-prealloc-size 4096 +updatable-views-with-limit YES +use-symbolic-links FALSE +verbose TRUE +wait-timeout 28800 +warnings 1 To see what values a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 5627716f6ec..b20e19bda04 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -417,6 +417,38 @@ The following options may be given as the first argument: is one of {on, off, default} --partition[=name] Enable or disable partition plugin. Possible values are ON, OFF, FORCE (don't start if the plugin fails to load). + --performance-schema + Enable the performance schema. + --performance-schema-events-waits-history-long-size=# + Number of rows in EVENTS_WAITS_HISTORY_LONG. + --performance-schema-events-waits-history-size=# + Number of rows per thread in EVENTS_WAITS_HISTORY. + --performance-schema-max-cond-classes=# + Maximum number of condition instruments. + --performance-schema-max-cond-instances=# + Maximum number of instrumented condition objects. + --performance-schema-max-file-classes=# + Maximum number of file instruments. + --performance-schema-max-file-handles=# + Maximum number of opened instrumented files. + --performance-schema-max-file-instances=# + Maximum number of instrumented files. + --performance-schema-max-mutex-classes=# + Maximum number of mutex instruments. + --performance-schema-max-mutex-instances=# + Maximum number of instrumented MUTEX objects. + --performance-schema-max-rwlock-classes=# + Maximum number of rwlock instruments. + --performance-schema-max-rwlock-instances=# + Maximum number of instrumented RWLOCK objects. + --performance-schema-max-table-handles=# + Maximum number of opened instrumented tables. + --performance-schema-max-table-instances=# + Maximum number of instrumented tables. + --performance-schema-max-thread-classes=# + Maximum number of thread instruments. + --performance-schema-max-thread-instances=# + Maximum number of instrumented threads. --pid-file=name Pid file used by safe_mysqld --plugin-dir=name Directory for plugins --plugin-load=name Optional semicolon-separated list of plugins to load, @@ -720,225 +752,241 @@ The following options may be given as the first argument: -W, --warnings[=#] Deprecated; use --log-warnings instead. Variables (--variable-name=value) -and boolean options {FALSE|TRUE} Value (after reading options) ---------------------------------- ---------------------------------------- -abort-slave-event-count 0 -allow-suspicious-udfs FALSE -archive ON -auto-increment-increment 1 -auto-increment-offset 1 -automatic-sp-privileges TRUE -back-log 50 -big-tables FALSE -bind-address (No default value) -binlog-cache-size 32768 -binlog-format STATEMENT -binlog-row-event-max-size 1024 -blackhole ON -bulk-insert-buffer-size 8388608 -character-set-client-handshake TRUE -character-set-filesystem binary -character-set-server latin1 -character-sets-dir MYSQL_SHAREDIR/charsets/ -chroot (No default value) -collation-server latin1_swedish_ci -completion-type NO_CHAIN -concurrent-insert AUTO -connect-timeout 10 -console FALSE -datadir MYSQLTEST_VARDIR/install.db/ -date-format %Y-%m-%d -datetime-format %Y-%m-%d %H:%i:%s -default-character-set latin1 -default-collation latin1_swedish_ci -default-storage-engine MyISAM -default-time-zone (No default value) -default-week-format 0 -delay-key-write ON -delayed-insert-limit 100 -delayed-insert-timeout 300 -delayed-queue-size 1000 -disconnect-slave-event-count 0 -div-precision-increment 4 -enable-locking FALSE -engine-condition-pushdown TRUE -event-scheduler OFF -expire-logs-days 0 -external-locking FALSE -federated ON -flush FALSE -flush-time 1800 -ft-boolean-syntax + -><()~*:""&| -ft-max-word-len 84 -ft-min-word-len 4 -ft-query-expansion-limit 20 -ft-stopword-file (No default value) -gdb FALSE -general-log FALSE -group-concat-max-len 1024 -help TRUE -ignore-builtin-innodb FALSE -init-connect -init-file (No default value) -init-rpl-role MASTER -init-slave -interactive-timeout 28800 -join-buffer-size 131072 -keep-files-on-create FALSE -key-buffer-size 8388608 -key-cache-age-threshold 300 -key-cache-block-size 1024 -key-cache-division-limit 100 -language MYSQL_SHAREDIR/ -lc-messages en_US -lc-messages-dir MYSQL_SHAREDIR/ -lc-time-names en_US -local-infile TRUE -log-bin (No default value) -log-bin-index (No default value) -log-bin-trust-function-creators FALSE -log-error -log-isam myisam.log -log-output FILE -log-queries-not-using-indexes FALSE -log-short-format FALSE -log-slave-updates FALSE -log-slow-admin-statements FALSE -log-slow-slave-statements FALSE -log-tc tc.log -log-tc-size 24576 -log-update (No default value) -log-warnings 1 -long-query-time 10 -low-priority-updates FALSE -lower-case-table-names 1 -master-info-file master.info -master-retry-count 86400 -max-allowed-packet 1048576 -max-binlog-cache-size 18446744073709547520 -max-binlog-dump-events 0 -max-binlog-size 1073741824 -max-connect-errors 10 -max-connections 151 -max-delayed-threads 20 -max-error-count 64 -max-heap-table-size 16777216 -max-join-size 18446744073709551615 -max-length-for-sort-data 1024 -max-prepared-stmt-count 16382 -max-relay-log-size 0 -max-seeks-for-key 18446744073709551615 -max-sort-length 1024 -max-sp-recursion-depth 0 -max-tmp-tables 32 -max-user-connections 0 -max-write-lock-count 18446744073709551615 -memlock FALSE -min-examined-row-limit 0 -multi-range-count 256 -myisam-block-size 1024 -myisam-data-pointer-size 6 -myisam-max-sort-file-size 9223372036853727232 -myisam-mmap-size 18446744073709551615 -myisam-recover-options OFF -myisam-repair-threads 1 -myisam-sort-buffer-size 8388608 -myisam-stats-method nulls_unequal -myisam-use-mmap FALSE -named-pipe FALSE -net-buffer-length 16384 -net-read-timeout 30 -net-retry-count 10 -net-write-timeout 60 -new FALSE -old FALSE -old-alter-table FALSE -old-passwords FALSE -old-style-user-limits FALSE -optimizer-prune-level 1 -optimizer-search-depth 62 -optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on -partition ON -plugin-dir MYSQL_LIBDIR/plugin -plugin-load (No default value) -port 3306 -port-open-timeout 0 -preload-buffer-size 32768 -profiling-history-size 15 -query-alloc-block-size 8192 -query-cache-limit 1048576 -query-cache-min-res-unit 4096 -query-cache-size 0 -query-cache-type ON -query-cache-wlock-invalidate FALSE -query-prealloc-size 8192 -range-alloc-block-size 4096 -read-buffer-size 131072 -read-only FALSE -read-rnd-buffer-size 262144 -record-buffer 131072 -relay-log (No default value) -relay-log-index (No default value) -relay-log-info-file relay-log.info -relay-log-purge TRUE -relay-log-recovery FALSE -relay-log-space-limit 0 -replicate-same-server-id FALSE -report-host (No default value) -report-password (No default value) -report-port 3306 -report-user (No default value) -rpl-recovery-rank 0 -safe-user-create FALSE -secure-auth FALSE -secure-file-priv (No default value) -server-id 0 -shared-memory FALSE -shared-memory-base-name MYSQL -show-slave-auth-info FALSE -skip-grant-tables TRUE -skip-networking FALSE -skip-show-database FALSE -skip-slave-start FALSE -slave-compressed-protocol FALSE -slave-exec-mode STRICT -slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ -slave-net-timeout 3600 -slave-skip-errors (No default value) -slave-transaction-retries 10 -slow-launch-time 2 -slow-query-log FALSE -socket MySQL -sort-buffer-size 2097152 -sporadic-binlog-dump-fail FALSE -sql-mode -symbolic-links FALSE -sync-binlog 0 -sync-frm TRUE -sync-master-info 0 -sync-relay-log 0 -sync-relay-log-info 0 -sysdate-is-now FALSE -table-cache 400 -table-definition-cache 400 -table-lock-wait-timeout 50 -table-open-cache 400 -tc-heuristic-recover COMMIT -thread-cache-size 0 -thread-handling one-thread-per-connection -thread-stack 262144 -time-format %H:%i:%s -timed-mutexes FALSE -tmp-table-size 16777216 -tmpdir MYSQLTEST_VARDIR/tmp/ -transaction-alloc-block-size 8192 -transaction-isolation REPEATABLE-READ -transaction-prealloc-size 4096 -updatable-views-with-limit YES -use-symbolic-links FALSE -verbose TRUE -wait-timeout 28800 -warnings 1 +and boolean options {FALSE|TRUE} Value (after reading options) +------------------------------------------------- ------------------------ +abort-slave-event-count 0 +allow-suspicious-udfs FALSE +archive ON +auto-increment-increment 1 +auto-increment-offset 1 +automatic-sp-privileges TRUE +back-log 50 +big-tables FALSE +bind-address (No default value) +binlog-cache-size 32768 +binlog-format STATEMENT +binlog-row-event-max-size 1024 +blackhole ON +bulk-insert-buffer-size 8388608 +character-set-client-handshake TRUE +character-set-filesystem binary +character-set-server latin1 +character-sets-dir MYSQL_SHAREDIR/charsets/ +chroot (No default value) +collation-server latin1_swedish_ci +completion-type NO_CHAIN +concurrent-insert AUTO +connect-timeout 10 +console FALSE +datadir MYSQLTEST_VARDIR/install.db/ +date-format %Y-%m-%d +datetime-format %Y-%m-%d %H:%i:%s +default-character-set latin1 +default-collation latin1_swedish_ci +default-storage-engine MyISAM +default-time-zone (No default value) +default-week-format 0 +delay-key-write ON +delayed-insert-limit 100 +delayed-insert-timeout 300 +delayed-queue-size 1000 +disconnect-slave-event-count 0 +div-precision-increment 4 +enable-locking FALSE +engine-condition-pushdown TRUE +event-scheduler OFF +expire-logs-days 0 +external-locking FALSE +federated ON +flush FALSE +flush-time 1800 +ft-boolean-syntax + -><()~*:""&| +ft-max-word-len 84 +ft-min-word-len 4 +ft-query-expansion-limit 20 +ft-stopword-file (No default value) +gdb FALSE +general-log FALSE +group-concat-max-len 1024 +help TRUE +ignore-builtin-innodb FALSE +init-connect +init-file (No default value) +init-rpl-role MASTER +init-slave +interactive-timeout 28800 +join-buffer-size 131072 +keep-files-on-create FALSE +key-buffer-size 8388608 +key-cache-age-threshold 300 +key-cache-block-size 1024 +key-cache-division-limit 100 +language MYSQL_SHAREDIR/ +lc-messages en_US +lc-messages-dir MYSQL_SHAREDIR/ +lc-time-names en_US +local-infile TRUE +log-bin (No default value) +log-bin-index (No default value) +log-bin-trust-function-creators FALSE +log-error +log-isam myisam.log +log-output FILE +log-queries-not-using-indexes FALSE +log-short-format FALSE +log-slave-updates FALSE +log-slow-admin-statements FALSE +log-slow-slave-statements FALSE +log-tc tc.log +log-tc-size 24576 +log-update (No default value) +log-warnings 1 +long-query-time 10 +low-priority-updates FALSE +lower-case-table-names 1 +master-info-file master.info +master-retry-count 86400 +max-allowed-packet 1048576 +max-binlog-cache-size 18446744073709547520 +max-binlog-dump-events 0 +max-binlog-size 1073741824 +max-connect-errors 10 +max-connections 151 +max-delayed-threads 20 +max-error-count 64 +max-heap-table-size 16777216 +max-join-size 18446744073709551615 +max-length-for-sort-data 1024 +max-prepared-stmt-count 16382 +max-relay-log-size 0 +max-seeks-for-key 18446744073709551615 +max-sort-length 1024 +max-sp-recursion-depth 0 +max-tmp-tables 32 +max-user-connections 0 +max-write-lock-count 18446744073709551615 +memlock FALSE +min-examined-row-limit 0 +multi-range-count 256 +myisam-block-size 1024 +myisam-data-pointer-size 6 +myisam-max-sort-file-size 9223372036853727232 +myisam-mmap-size 18446744073709551615 +myisam-recover-options OFF +myisam-repair-threads 1 +myisam-sort-buffer-size 8388608 +myisam-stats-method nulls_unequal +myisam-use-mmap FALSE +named-pipe FALSE +net-buffer-length 16384 +net-read-timeout 30 +net-retry-count 10 +net-write-timeout 60 +new FALSE +old FALSE +old-alter-table FALSE +old-passwords FALSE +old-style-user-limits FALSE +optimizer-prune-level 1 +optimizer-search-depth 62 +optimizer-switch index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on +partition ON +performance-schema FALSE +performance-schema-events-waits-history-long-size 10000 +performance-schema-events-waits-history-size 10 +performance-schema-max-cond-classes 80 +performance-schema-max-cond-instances 1000 +performance-schema-max-file-classes 50 +performance-schema-max-file-handles 32768 +performance-schema-max-file-instances 10000 +performance-schema-max-mutex-classes 200 +performance-schema-max-mutex-instances 1000 +performance-schema-max-rwlock-classes 20 +performance-schema-max-rwlock-instances 1000 +performance-schema-max-table-handles 100000 +performance-schema-max-table-instances 50000 +performance-schema-max-thread-classes 50 +performance-schema-max-thread-instances 1000 +plugin-dir MYSQL_LIBDIR/plugin +plugin-load (No default value) +port 3306 +port-open-timeout 0 +preload-buffer-size 32768 +profiling-history-size 15 +query-alloc-block-size 8192 +query-cache-limit 1048576 +query-cache-min-res-unit 4096 +query-cache-size 0 +query-cache-type ON +query-cache-wlock-invalidate FALSE +query-prealloc-size 8192 +range-alloc-block-size 4096 +read-buffer-size 131072 +read-only FALSE +read-rnd-buffer-size 262144 +record-buffer 131072 +relay-log (No default value) +relay-log-index (No default value) +relay-log-info-file relay-log.info +relay-log-purge TRUE +relay-log-recovery FALSE +relay-log-space-limit 0 +replicate-same-server-id FALSE +report-host (No default value) +report-password (No default value) +report-port 3306 +report-user (No default value) +rpl-recovery-rank 0 +safe-user-create FALSE +secure-auth FALSE +secure-file-priv (No default value) +server-id 0 +shared-memory FALSE +shared-memory-base-name MYSQL +show-slave-auth-info FALSE +skip-grant-tables TRUE +skip-networking FALSE +skip-show-database FALSE +skip-slave-start FALSE +slave-compressed-protocol FALSE +slave-exec-mode STRICT +slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ +slave-net-timeout 3600 +slave-skip-errors (No default value) +slave-transaction-retries 10 +slow-launch-time 2 +slow-query-log FALSE +socket MySQL +sort-buffer-size 2097152 +sporadic-binlog-dump-fail FALSE +sql-mode +symbolic-links FALSE +sync-binlog 0 +sync-frm TRUE +sync-master-info 0 +sync-relay-log 0 +sync-relay-log-info 0 +sysdate-is-now FALSE +table-cache 400 +table-definition-cache 400 +table-lock-wait-timeout 50 +table-open-cache 400 +tc-heuristic-recover COMMIT +thread-cache-size 0 +thread-handling one-thread-per-connection +thread-stack 262144 +time-format %H:%i:%s +timed-mutexes FALSE +tmp-table-size 16777216 +tmpdir MYSQLTEST_VARDIR/tmp/ +transaction-alloc-block-size 8192 +transaction-isolation REPEATABLE-READ +transaction-prealloc-size 4096 +updatable-views-with-limit YES +use-symbolic-links FALSE +verbose TRUE +wait-timeout 28800 +warnings 1 To see what values a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index 1603ecec127..4f6e5238c3f 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -262,6 +262,7 @@ Database information_schema mtr mysql +performance_schema test prepare stmt4 from ' show tables from test like ''t2%'' '; execute stmt4; diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result index 564fb3626df..402d3e1d987 100644 --- a/mysql-test/r/schema.result +++ b/mysql-test/r/schema.result @@ -9,5 +9,6 @@ information_schema foo mtr mysql +performance_schema test drop schema foo; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index fc995d42fae..4dcf6c52673 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -142,6 +142,7 @@ Database information_schema mtr mysql +performance_schema test show databases like "test%"; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr diff --git a/mysql-test/suite/binlog/r/binlog_database.result b/mysql-test/suite/binlog/r/binlog_database.result index 1cc9281f3fc..eba93c3ae14 100644 --- a/mysql-test/suite/binlog/r/binlog_database.result +++ b/mysql-test/suite/binlog/r/binlog_database.result @@ -116,4 +116,5 @@ Database information_schema mtr mysql +performance_schema test diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 5ad12d953ab..1b36ce8f0d0 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -320,10 +320,10 @@ INSERT INTO t2 SET a = func_modify_t1(); SHOW BINLOG EVENTS FROM 12283; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 12283 Query 1 12351 BEGIN -master-bin.000001 12351 Table_map 1 12393 table_id: 44 (test.t2) -master-bin.000001 12393 Table_map 1 12435 table_id: 45 (test.t1) -master-bin.000001 12435 Write_rows 1 12473 table_id: 45 -master-bin.000001 12473 Write_rows 1 12511 table_id: 44 flags: STMT_END_F +master-bin.000001 12351 Table_map 1 12393 table_id: 62 (test.t2) +master-bin.000001 12393 Table_map 1 12435 table_id: 63 (test.t1) +master-bin.000001 12435 Write_rows 1 12473 table_id: 63 +master-bin.000001 12473 Write_rows 1 12511 table_id: 62 flags: STMT_END_F master-bin.000001 12511 Query 1 12580 COMMIT DROP TABLE t1,t2; DROP FUNCTION func_modify_t1; @@ -347,12 +347,12 @@ INSERT INTO t1 SET a = 2; SHOW BINLOG EVENTS FROM 13426; Log_name Pos Event_type Server_id End_log_pos Info master-bin.000001 13426 Query 1 13494 BEGIN -master-bin.000001 13494 Table_map 1 13535 table_id: 47 (test.t1) -master-bin.000001 13535 Table_map 1 13577 table_id: 48 (test.t3) -master-bin.000001 13577 Table_map 1 13619 table_id: 49 (test.t2) -master-bin.000001 13619 Write_rows 1 13657 table_id: 49 -master-bin.000001 13657 Write_rows 1 13695 table_id: 48 -master-bin.000001 13695 Write_rows 1 13729 table_id: 47 flags: STMT_END_F +master-bin.000001 13494 Table_map 1 13535 table_id: 65 (test.t1) +master-bin.000001 13535 Table_map 1 13577 table_id: 66 (test.t3) +master-bin.000001 13577 Table_map 1 13619 table_id: 67 (test.t2) +master-bin.000001 13619 Write_rows 1 13657 table_id: 67 +master-bin.000001 13657 Write_rows 1 13695 table_id: 66 +master-bin.000001 13695 Write_rows 1 13729 table_id: 65 flags: STMT_END_F master-bin.000001 13729 Query 1 13798 COMMIT DROP TABLE t1,t2,t3; SET SESSION binlog_format = STATEMENT; diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result index d96ad497da0..92e01814b0e 100644 --- a/mysql-test/suite/funcs_1/r/is_schemata.result +++ b/mysql-test/suite/funcs_1/r/is_schemata.result @@ -56,6 +56,7 @@ catalog_name schema_name sql_path def information_schema NULL def mtr NULL def mysql NULL +def performance_schema NULL def test NULL ############################################################################### # Testcases 3.2.9.2+3.2.9.3: INFORMATION_SCHEMA.SCHEMATA accessible information diff --git a/mysql-test/suite/jp/r/jp_create_db_sjis.result b/mysql-test/suite/jp/r/jp_create_db_sjis.result index fd66609b7bc..b7c09fbfbe9 100644 --- a/mysql-test/suite/jp/r/jp_create_db_sjis.result +++ b/mysql-test/suite/jp/r/jp_create_db_sjis.result @@ -13,6 +13,7 @@ information_schema “ú–{Œê ÆÎÝºÞ mysql +performance_schema test USE `ÆÎݺÞ`; USE `“ú–{Œê`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ucs2.result b/mysql-test/suite/jp/r/jp_create_db_ucs2.result index 3a3316ecbaf..3832ff5a0c7 100644 --- a/mysql-test/suite/jp/r/jp_create_db_ucs2.result +++ b/mysql-test/suite/jp/r/jp_create_db_ucs2.result @@ -14,6 +14,7 @@ information_schema íÜíÝíÞ ŽÆŽÎŽÝŽºŽÞ mysql +performance_schema test USE `ŽÆŽÎŽÝŽºŽÞ`; USE `ÆüËܸì`; diff --git a/mysql-test/suite/jp/r/jp_create_db_ujis.result b/mysql-test/suite/jp/r/jp_create_db_ujis.result index 4d6561b88ce..d6bf31336fd 100644 --- a/mysql-test/suite/jp/r/jp_create_db_ujis.result +++ b/mysql-test/suite/jp/r/jp_create_db_ujis.result @@ -13,6 +13,7 @@ information_schema íÜíÝíÞ ŽÆŽÎŽÝŽºŽÞ mysql +performance_schema test USE `ŽÆŽÎŽÝŽºŽÞ`; USE `ÆüËܸì`; diff --git a/mysql-test/suite/jp/r/jp_create_db_utf8.result b/mysql-test/suite/jp/r/jp_create_db_utf8.result index 2f70903ac71..62202d43df0 100644 --- a/mysql-test/suite/jp/r/jp_create_db_utf8.result +++ b/mysql-test/suite/jp/r/jp_create_db_utf8.result @@ -13,6 +13,7 @@ information_schema 龔龖龗 ニホï¾ï½ºï¾ž mysql +performance_schema test USE `ニホï¾ï½ºï¾ž`; USE `日本語`; diff --git a/mysql-test/suite/perfschema/include/binlog_common.inc b/mysql-test/suite/perfschema/include/binlog_common.inc new file mode 100644 index 00000000000..10afe54ab5b --- /dev/null +++ b/mysql-test/suite/perfschema/include/binlog_common.inc @@ -0,0 +1,49 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +RESET MASTER; + +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; + +update performance_schema.SETUP_INSTRUMENTS set enabled='NO' + where name like "wait/synch/rwlock/%"; + +select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT; + +--disable_warnings +drop table if exists test.t1; +drop table if exists test.t2; +--enable_warnings + +create table test.t1 (thread_id integer); +create table test.t2 (name varchar(128)); + +insert into test.t1 + select thread_id from performance_schema.EVENTS_WAITS_CURRENT; + +insert into test.t2 + select name from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/rwlock/%"; + +drop table test.t1; +drop table test.t2; + +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/rwlock/%"; + +--source include/show_binlog_events.inc + diff --git a/mysql-test/suite/perfschema/include/cleanup_helper.inc b/mysql-test/suite/perfschema/include/cleanup_helper.inc new file mode 100644 index 00000000000..5c2429ddb97 --- /dev/null +++ b/mysql-test/suite/perfschema/include/cleanup_helper.inc @@ -0,0 +1,25 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; + +disconnect con1; +disconnect con2; +disconnect con3; + +connection default; + diff --git a/mysql-test/suite/perfschema/include/privilege.inc b/mysql-test/suite/perfschema/include/privilege.inc new file mode 100644 index 00000000000..ef2acc995d5 --- /dev/null +++ b/mysql-test/suite/perfschema/include/privilege.inc @@ -0,0 +1,194 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--disable_warnings +drop table if exists test.t1; +--enable_warnings + +## The result of show grants is not consistent across platforms ... +## show grants; + +## Not enforced yet: deny CREATE_ACL and DROP_ACL +## Waiting to remove .FRM files first +## +## --error ER_DBACCESS_DENIED_ERROR +## create table performance_schema.t1(a int); +## +## --error ER_DBACCESS_DENIED_ERROR +## drop table performance_schema.t1; +## +## --error ER_DBACCESS_DENIED_ERROR +## create table performance_schema.SETUP_INSTRUMENTS(a int); +## +## --error ER_DBACCESS_DENIED_ERROR +## create table performance_schema.EVENTS_WAITS_CURRENT(a int); +## +## --error ER_DBACCESS_DENIED_ERROR +## create table performance_schema.FILE_INSTANCES(a int); +## +## --error ER_DBACCESS_DENIED_ERROR +## drop table performance_schema.SETUP_INSTRUMENTS; +## +## --error ER_DBACCESS_DENIED_ERROR +## drop table performance_schema.EVENTS_WAITS_CURRENT; +## +## --error ER_DBACCESS_DENIED_ERROR +## drop table performance_schema.FILE_INSTANCES; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.SETUP_INSTRUMENTS to test.t1; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.FILE_INSTANCES to test.t1; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.FILE_INSTANCES to performance_schema.t1; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.SETUP_INSTRUMENTS + to performance_schema.EVENTS_WAITS_CURRENT; + +--error ER_DBACCESS_DENIED_ERROR +rename table performance_schema.EVENTS_WAITS_CURRENT + to performance_schema.SETUP_INSTRUMENTS; + +--error ER_DBACCESS_DENIED_ERROR +create procedure performance_schema.my_proc() begin end; + +--error ER_DBACCESS_DENIED_ERROR +create function performance_schema.my_func() returns int return 0; + +--error ER_DBACCESS_DENIED_ERROR +create event performance_schema.my_event on schedule every 15 minute +do begin end; + +--error ER_DBACCESS_DENIED_ERROR +create trigger performance_schema.bi_setup_instruments + before insert on performance_schema.SETUP_INSTRUMENTS + for each row begin end; + +--error ER_DBACCESS_DENIED_ERROR +create trigger performance_schema.bi_events_waits_current + before insert on performance_schema.EVENTS_WAITS_CURRENT + for each row begin end; + +--error ER_DBACCESS_DENIED_ERROR +create trigger performance_schema.bi_file_instances + before insert on performance_schema.FILE_INSTANCES + for each row begin end; + +--error ER_WRONG_PERFSCHEMA_USAGE +create table test.t1(a int) engine=PERFORMANCE_SCHEMA; + +--error ER_WRONG_PERFSCHEMA_USAGE +create table test.t1 like performance_schema.SETUP_INSTRUMENTS; + +--error ER_WRONG_PERFSCHEMA_USAGE +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; + +--error ER_WRONG_PERFSCHEMA_USAGE +create table test.t1 like performance_schema.FILE_INSTANCES; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.SETUP_INSTRUMENTS + set name="foo"; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_CURRENT + set name="foo"; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.FILE_INSTANCES + set name="foo"; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_INSTRUMENTS; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_CURRENT; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_INSTANCES; + +lock table performance_schema.SETUP_INSTRUMENTS read; +unlock tables; + +lock table performance_schema.SETUP_INSTRUMENTS write; +unlock tables; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +lock table performance_schema.EVENTS_WAITS_CURRENT read; +unlock tables; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +lock table performance_schema.EVENTS_WAITS_CURRENT write; +unlock tables; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +lock table performance_schema.FILE_INSTANCES read; +unlock tables; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +lock table performance_schema.FILE_INSTANCES write; +unlock tables; + +--echo # +--echo # WL#4818, NFS2: Can use grants to give normal user access +--echo # to view data from _CURRENT and _HISTORY tables +--echo # +--echo # Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3. +--echo # (Except for EVENTS_WAITS_CURRENT, which is granted.) + +# Errors here will be caught by the diff afterwards +--disable_abort_on_error + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1; + +--enable_abort_on_error + diff --git a/mysql-test/suite/perfschema/include/setup_helper.inc b/mysql-test/suite/perfschema/include/setup_helper.inc new file mode 100644 index 00000000000..8a2dfa86496 --- /dev/null +++ b/mysql-test/suite/perfschema/include/setup_helper.inc @@ -0,0 +1,54 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +let $MYSQLD_DATADIR= `select @@datadir`; +let $MYSQLD_TMPDIR= `select @@tmpdir`; + +--disable_query_log +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_CONSUMERS set enabled='YES'; +--enable_query_log + +connect (con1, localhost, root, , ); + +let $con1_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST + where ID in (select connection_id())`; + +connect (con2, localhost, root, , ); + +let $con2_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST + where ID in (select connection_id())`; + +connect (con3, localhost, root, , ); + +let $con3_THREAD_ID=`select thread_id from performance_schema.PROCESSLIST + where ID in (select connection_id())`; + +connection default; + +--disable_query_log +prepare stmt_dump_events from + "select event_name, + left(source, locate(\":\", source)) as short_source, + operation, number_of_bytes + from performance_schema.EVENTS_WAITS_HISTORY_LONG + where thread_id=? order by event_id;"; + +prepare stmt_dump_thread from + "select name from performance_schema.PROCESSLIST where thread_id=? ;"; +--enable_query_log + diff --git a/mysql-test/suite/perfschema/include/start_server_common.inc b/mysql-test/suite/perfschema/include/start_server_common.inc new file mode 100644 index 00000000000..fa1cb953f59 --- /dev/null +++ b/mysql-test/suite/perfschema/include/start_server_common.inc @@ -0,0 +1,62 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +show databases; + +select count(*) from performance_schema.PERFORMANCE_TIMERS; +select count(*) from performance_schema.SETUP_CONSUMERS; +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +select count(*) from performance_schema.SETUP_TIMERS; + +# Make sure we don't crash, no matter what the starting parameters are + +--disable_result_log +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +--enable_result_log + +# This has a stable output, printing the result: +show variables like "performance_schema%"; + +# This has an unrepeatable output, it does depends too much on +# - the platform hardware (sizeof structures, padding) +# - the compiler used (sizeof(enum)) +# - the platform header files (sizeof(size_t)) +# - the code path in the server (what gets executed and instrumented +# at runtime) + +--disable_result_log +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +--enable_result_log + diff --git a/mysql-test/suite/perfschema/r/aggregate.result b/mysql-test/suite/perfschema/r/aggregate.result new file mode 100644 index 00000000000..598f9297cc5 --- /dev/null +++ b/mysql-test/suite/perfschema/r/aggregate.result @@ -0,0 +1,101 @@ +"General cleanup" +drop table if exists t1; +update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO'; +update performance_schema.SETUP_CONSUMERS set enabled = 'NO'; +truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE; +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +update performance_schema.SETUP_CONSUMERS set enabled = 'YES'; +update performance_schema.SETUP_INSTRUMENTS +set enabled = 'YES', timed = 'YES'; +create table t1 ( +id INT PRIMARY KEY, +b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; +insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8); +update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'; +set @dump_all=FALSE; +"Verifying file aggregate consistency" +SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.COUNT_READ <> SUM(i.COUNT_READ)) +OR @dump_all; +EVENT_NAME COUNT_READ SUM(i.COUNT_READ) +SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE)) +OR @dump_all; +EVENT_NAME COUNT_WRITE SUM(i.COUNT_WRITE) +SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ)) +OR @dump_all; +EVENT_NAME SUM_NUMBER_OF_BYTES_READ SUM(i.SUM_NUMBER_OF_BYTES_READ) +SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE)) +OR @dump_all; +EVENT_NAME SUM_NUMBER_OF_BYTES_WRITE SUM(i.SUM_NUMBER_OF_BYTES_WRITE) +"Verifying waits aggregate consistency (instance)" +SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_TIMER_WAIT <> SUM(i.SUM_TIMER_WAIT)) +OR @dump_all; +EVENT_NAME SUM_TIMER_WAIT SUM(i.SUM_TIMER_WAIT) +SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MIN_TIMER_WAIT <> MIN(i.MIN_TIMER_WAIT)) +AND (MIN(i.MIN_TIMER_WAIT) != 0) +OR @dump_all; +EVENT_NAME MIN_TIMER_WAIT MIN(i.MIN_TIMER_WAIT) +SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MAX_TIMER_WAIT <> MAX(i.MAX_TIMER_WAIT)) +OR @dump_all; +EVENT_NAME MAX_TIMER_WAIT MAX(i.MAX_TIMER_WAIT) +"Verifying waits aggregate consistency (thread)" +SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t +USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT)) +OR @dump_all; +EVENT_NAME SUM_TIMER_WAIT SUM(t.SUM_TIMER_WAIT) +SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t +USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT)) +AND (MIN(t.MIN_TIMER_WAIT) != 0) +OR @dump_all; +EVENT_NAME MIN_TIMER_WAIT MIN(t.MIN_TIMER_WAIT) +SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t +USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT)) +OR @dump_all; +EVENT_NAME MAX_TIMER_WAIT MAX(t.MAX_TIMER_WAIT) +update performance_schema.SETUP_CONSUMERS set enabled = 'YES'; +update performance_schema.SETUP_INSTRUMENTS +set enabled = 'YES', timed = 'YES'; +drop table test.t1; diff --git a/mysql-test/suite/perfschema/r/bad_option_1.result b/mysql-test/suite/perfschema/r/bad_option_1.result new file mode 100644 index 00000000000..02fd04afd33 --- /dev/null +++ b/mysql-test/suite/perfschema/r/bad_option_1.result @@ -0,0 +1,2 @@ +Found: unknown variable 'performance-schema-enabled=maybe' +Found: Aborting diff --git a/mysql-test/suite/perfschema/r/bad_option_2.result b/mysql-test/suite/perfschema/r/bad_option_2.result new file mode 100644 index 00000000000..d8fda2af3b6 --- /dev/null +++ b/mysql-test/suite/perfschema/r/bad_option_2.result @@ -0,0 +1 @@ +Found: ambiguous option '--performance-schema-max_=12' diff --git a/mysql-test/suite/perfschema/r/binlog_mix.result b/mysql-test/suite/perfschema/r/binlog_mix.result new file mode 100644 index 00000000000..b437f4eda1f --- /dev/null +++ b/mysql-test/suite/perfschema/r/binlog_mix.result @@ -0,0 +1,49 @@ +set binlog_format=mixed; +RESET MASTER; +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +update performance_schema.SETUP_INSTRUMENTS set enabled='NO' + where name like "wait/synch/rwlock/%"; +select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT; +count(*) > 0 +1 +drop table if exists test.t1; +drop table if exists test.t2; +create table test.t1 (thread_id integer); +create table test.t2 (name varchar(128)); +insert into test.t1 +select thread_id from performance_schema.EVENTS_WAITS_CURRENT; +insert into test.t2 +select name from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/rwlock/%"; +drop table test.t1; +drop table test.t2; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/rwlock/%"; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS) +master-bin.000001 # Update_rows # # table_id: # +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table if exists test.t1 +master-bin.000001 # Query # # use `test`; drop table if exists test.t2 +master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) +master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128)) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table test.t1 +master-bin.000001 # Query # # use `test`; drop table test.t2 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS) +master-bin.000001 # Update_rows # # table_id: # +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/perfschema/r/binlog_row.result b/mysql-test/suite/perfschema/r/binlog_row.result new file mode 100644 index 00000000000..50a201a81d9 --- /dev/null +++ b/mysql-test/suite/perfschema/r/binlog_row.result @@ -0,0 +1,49 @@ +set binlog_format=row; +RESET MASTER; +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +update performance_schema.SETUP_INSTRUMENTS set enabled='NO' + where name like "wait/synch/rwlock/%"; +select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT; +count(*) > 0 +1 +drop table if exists test.t1; +drop table if exists test.t2; +create table test.t1 (thread_id integer); +create table test.t2 (name varchar(128)); +insert into test.t1 +select thread_id from performance_schema.EVENTS_WAITS_CURRENT; +insert into test.t2 +select name from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/rwlock/%"; +drop table test.t1; +drop table test.t2; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/rwlock/%"; +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS) +master-bin.000001 # Update_rows # # table_id: # +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table if exists test.t1 +master-bin.000001 # Query # # use `test`; drop table if exists test.t2 +master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) +master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128)) +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t1) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (test.t2) +master-bin.000001 # Write_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # use `test`; drop table test.t1 +master-bin.000001 # Query # # use `test`; drop table test.t2 +master-bin.000001 # Query # # BEGIN +master-bin.000001 # Table_map # # table_id: # (performance_schema.SETUP_INSTRUMENTS) +master-bin.000001 # Update_rows # # table_id: # +master-bin.000001 # Update_rows # # table_id: # flags: STMT_END_F +master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/perfschema/r/binlog_stmt.result b/mysql-test/suite/perfschema/r/binlog_stmt.result new file mode 100644 index 00000000000..cec46b20670 --- /dev/null +++ b/mysql-test/suite/perfschema/r/binlog_stmt.result @@ -0,0 +1,48 @@ +set binlog_format=statement; +RESET MASTER; +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +update performance_schema.SETUP_INSTRUMENTS set enabled='NO' + where name like "wait/synch/rwlock/%"; +Warnings: +Note 1592 Statement may not be safe to log in statement format. +select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT; +count(*) > 0 +1 +drop table if exists test.t1; +drop table if exists test.t2; +create table test.t1 (thread_id integer); +create table test.t2 (name varchar(128)); +insert into test.t1 +select thread_id from performance_schema.EVENTS_WAITS_CURRENT; +Warnings: +Note 1592 Statement may not be safe to log in statement format. +insert into test.t2 +select name from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/rwlock/%"; +Warnings: +Note 1592 Statement may not be safe to log in statement format. +drop table test.t1; +drop table test.t2; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/rwlock/%"; +Warnings: +Note 1592 Statement may not be safe to log in statement format. +show binlog events from ; +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='NO' + where name like "wait/synch/rwlock/%" +master-bin.000001 # Query # # use `test`; drop table if exists test.t1 +master-bin.000001 # Query # # use `test`; drop table if exists test.t2 +master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) +master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128)) +master-bin.000001 # Query # # use `test`; insert into test.t1 +select thread_id from performance_schema.EVENTS_WAITS_CURRENT +master-bin.000001 # Query # # use `test`; insert into test.t2 +select name from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/rwlock/%" +master-bin.000001 # Query # # use `test`; drop table test.t1 +master-bin.000001 # Query # # use `test`; drop table test.t2 +master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/rwlock/%" diff --git a/mysql-test/suite/perfschema/r/cnf_option.result b/mysql-test/suite/perfschema/r/cnf_option.result new file mode 100644 index 00000000000..85adfb5113d --- /dev/null +++ b/mysql-test/suite/perfschema/r/cnf_option.result @@ -0,0 +1,6 @@ +show variables like 'performance_schema_max_thread_classes'; +Variable_name Value +performance_schema_max_thread_classes 12 +show variables like 'performance_schema_max_thread_instances'; +Variable_name Value +performance_schema_max_thread_instances 318 diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result new file mode 100644 index 00000000000..7bbc59ac452 --- /dev/null +++ b/mysql-test/suite/perfschema/r/column_privilege.result @@ -0,0 +1,27 @@ +show grants; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION +grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION; +grant SELECT(thread_id, event_id) on performance_schema.EVENTS_WAITS_CURRENT +to 'pfs_user_5'@localhost; +grant UPDATE(enabled) on performance_schema.SETUP_INSTRUMENTS +to 'pfs_user_5'@localhost; +flush privileges; +select thread_id from performance_schema.EVENTS_WAITS_CURRENT; +select thread_id, event_id from performance_schema.EVENTS_WAITS_CURRENT; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +select event_name from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'EVENTS_WAITS_CURRENT' +select thread_id, event_id, event_name +from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: SELECT command denied to user 'pfs_user_5'@'localhost' for column 'event_name' in table 'EVENTS_WAITS_CURRENT' +update performance_schema.SETUP_INSTRUMENTS set name='illegal'; +ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'name' in table 'SETUP_INSTRUMENTS' +update performance_schema.SETUP_INSTRUMENTS set timed='NO'; +ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'timed' in table 'SETUP_INSTRUMENTS' +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost; +DROP USER 'pfs_user_5'@localhost; +flush privileges; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE'; diff --git a/mysql-test/suite/perfschema/r/ddl_cond_instances.result b/mysql-test/suite/perfschema/r/ddl_cond_instances.result new file mode 100644 index 00000000000..33adcebaceb --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_cond_instances.result @@ -0,0 +1,8 @@ +alter table performance_schema.COND_INSTANCES add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.COND_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.COND_INSTANCES ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.COND_INSTANCES(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_events_waits_current.result b/mysql-test/suite/perfschema/r/ddl_events_waits_current.result new file mode 100644 index 00000000000..a438c93affe --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_events_waits_current.result @@ -0,0 +1,7 @@ +alter table performance_schema.EVENTS_WAITS_CURRENT add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.EVENTS_WAITS_CURRENT; +ALTER TABLE performance_schema.EVENTS_WAITS_CURRENT ADD INDEX test_index(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_CURRENT(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_events_waits_history.result b/mysql-test/suite/perfschema/r/ddl_events_waits_history.result new file mode 100644 index 00000000000..748dc2f29cd --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_events_waits_history.result @@ -0,0 +1,7 @@ +alter table performance_schema.EVENTS_WAITS_HISTORY add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.EVENTS_WAITS_HISTORY; +ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY ADD INDEX test_index(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result b/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result new file mode 100644 index 00000000000..1a047a765f6 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_events_waits_history_long.result @@ -0,0 +1,7 @@ +alter table performance_schema.EVENTS_WAITS_HISTORY_LONG add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; +ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG ADD INDEX test_index(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY_LONG(EVENT_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result new file mode 100644 index 00000000000..74fc4e1a640 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ews_by_event_name.result @@ -0,0 +1,7 @@ +alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(EVENT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME(EVENT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result b/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result new file mode 100644 index 00000000000..4a35565bae0 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ews_by_instance.result @@ -0,0 +1,7 @@ +alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE ADD INDEX test_index(EVENT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(EVENT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result new file mode 100644 index 00000000000..18d98006220 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_ews_by_thread_by_event_name.result @@ -0,0 +1,9 @@ +alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME ADD INDEX test_index(THREAD_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index +ON performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(THREAD_ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_file_instances.result b/mysql-test/suite/perfschema/r/ddl_file_instances.result new file mode 100644 index 00000000000..21e65c62405 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_file_instances.result @@ -0,0 +1,8 @@ +alter table performance_schema.FILE_INSTANCES add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.FILE_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.FILE_INSTANCES ADD INDEX test_index(FILE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.FILE_INSTANCES(FILE_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result b/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result new file mode 100644 index 00000000000..2f21ef56832 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_fs_by_event_name.result @@ -0,0 +1,7 @@ +alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +ALTER TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_EVENT_NAME(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result b/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result new file mode 100644 index 00000000000..8e256d1fd8d --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_fs_by_instance.result @@ -0,0 +1,7 @@ +alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE; +ALTER TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_INSTANCE(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_mutex_instances.result b/mysql-test/suite/perfschema/r/ddl_mutex_instances.result new file mode 100644 index 00000000000..35397a5294d --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_mutex_instances.result @@ -0,0 +1,8 @@ +alter table performance_schema.MUTEX_INSTANCES add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.MUTEX_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.MUTEX_INSTANCES ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.MUTEX_INSTANCES(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_performance_timers.result b/mysql-test/suite/perfschema/r/ddl_performance_timers.result new file mode 100644 index 00000000000..5de8193b205 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_performance_timers.result @@ -0,0 +1,8 @@ +alter table performance_schema.PERFORMANCE_TIMERS add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.PERFORMANCE_TIMERS; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.PERFORMANCE_TIMERS ADD INDEX test_index(TIMER_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.PERFORMANCE_TIMERS(TIMER_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_processlist.result b/mysql-test/suite/perfschema/r/ddl_processlist.result new file mode 100644 index 00000000000..5a9eb766349 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_processlist.result @@ -0,0 +1,8 @@ +alter table performance_schema.PROCESSLIST add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.PROCESSLIST; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.PROCESSLIST ADD INDEX test_index(ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.PROCESSLIST(ID); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result b/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result new file mode 100644 index 00000000000..849d191b17f --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_rwlock_instances.result @@ -0,0 +1,8 @@ +alter table performance_schema.RWLOCK_INSTANCES add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.RWLOCK_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.RWLOCK_INSTANCES ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.RWLOCK_INSTANCES(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_setup_consumers.result b/mysql-test/suite/perfschema/r/ddl_setup_consumers.result new file mode 100644 index 00000000000..f141725ee1f --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_setup_consumers.result @@ -0,0 +1,8 @@ +alter table performance_schema.SETUP_CONSUMERS add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.SETUP_CONSUMERS; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.SETUP_CONSUMERS ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_CONSUMERS(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_setup_instruments.result b/mysql-test/suite/perfschema/r/ddl_setup_instruments.result new file mode 100644 index 00000000000..42e54b587d8 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_setup_instruments.result @@ -0,0 +1,8 @@ +alter table performance_schema.SETUP_INSTRUMENTS add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.SETUP_INSTRUMENTS; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.SETUP_INSTRUMENTS ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_INSTRUMENTS(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_setup_objects.result b/mysql-test/suite/perfschema/r/ddl_setup_objects.result new file mode 100644 index 00000000000..c0f00745963 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_setup_objects.result @@ -0,0 +1,7 @@ +alter table performance_schema.SETUP_OBJECTS add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.SETUP_OBJECTS; +ALTER TABLE performance_schema.SETUP_OBJECTS ADD INDEX test_index(OBJECT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_OBJECTS(OBJECT_NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/ddl_setup_timers.result b/mysql-test/suite/perfschema/r/ddl_setup_timers.result new file mode 100644 index 00000000000..fc74730bd50 --- /dev/null +++ b/mysql-test/suite/perfschema/r/ddl_setup_timers.result @@ -0,0 +1,8 @@ +alter table performance_schema.SETUP_TIMERS add column foo integer; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +truncate table performance_schema.SETUP_TIMERS; +ERROR HY000: Invalid performance_schema usage. +ALTER TABLE performance_schema.SETUP_TIMERS ADD INDEX test_index(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_TIMERS(NAME); +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' diff --git a/mysql-test/suite/perfschema/r/dml_cond_instances.result b/mysql-test/suite/perfschema/r/dml_cond_instances.result new file mode 100644 index 00000000000..8adc632b91b --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_cond_instances.result @@ -0,0 +1,23 @@ +select * from performance_schema.COND_INSTANCES limit 1; +NAME OBJECT_INSTANCE_BEGIN +# # +select * from performance_schema.COND_INSTANCES +where name='FOO'; +NAME OBJECT_INSTANCE_BEGIN +insert into performance_schema.COND_INSTANCES +set name='FOO', object_instance_begin=12; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'COND_INSTANCES' +update performance_schema.COND_INSTANCES +set name='FOO'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'COND_INSTANCES' +delete from performance_schema.COND_INSTANCES +where name like "wait/%"; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'COND_INSTANCES' +delete from performance_schema.COND_INSTANCES; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'COND_INSTANCES' +LOCK TABLES performance_schema.COND_INSTANCES READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'COND_INSTANCES' +UNLOCK TABLES; +LOCK TABLES performance_schema.COND_INSTANCES WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'COND_INSTANCES' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_current.result b/mysql-test/suite/perfschema/r/dml_events_waits_current.result new file mode 100644 index 00000000000..5cd0dba7ad1 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_events_waits_current.result @@ -0,0 +1,28 @@ +select * from performance_schema.EVENTS_WAITS_CURRENT +where event_name like 'Wait/Synch/%' limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +select * from performance_schema.EVENTS_WAITS_CURRENT +where event_name='FOO'; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +insert into performance_schema.EVENTS_WAITS_CURRENT +set thread_id='1', event_id=1, +event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +update performance_schema.EVENTS_WAITS_CURRENT +set timer_start=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +update performance_schema.EVENTS_WAITS_CURRENT +set timer_start=12 where thread_id=0; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +delete from performance_schema.EVENTS_WAITS_CURRENT +where thread_id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +delete from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +UNLOCK TABLES; +LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history.result b/mysql-test/suite/perfschema/r/dml_events_waits_history.result new file mode 100644 index 00000000000..953922868fb --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_events_waits_history.result @@ -0,0 +1,36 @@ +select * from performance_schema.EVENTS_WAITS_HISTORY +where event_name like 'Wait/Synch/%' limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +select * from performance_schema.EVENTS_WAITS_HISTORY +where event_name='FOO'; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +select * from performance_schema.EVENTS_WAITS_HISTORY +where event_name like 'Wait/Synch/%' order by timer_wait limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +select * from performance_schema.EVENTS_WAITS_HISTORY +where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +insert into performance_schema.EVENTS_WAITS_HISTORY +set thread_id='1', event_id=1, +event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +update performance_schema.EVENTS_WAITS_HISTORY +set timer_start=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +update performance_schema.EVENTS_WAITS_HISTORY +set timer_start=12 where thread_id=0; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +delete from performance_schema.EVENTS_WAITS_HISTORY +where thread_id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +delete from performance_schema.EVENTS_WAITS_HISTORY; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +UNLOCK TABLES; +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result new file mode 100644 index 00000000000..494469a0db8 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_events_waits_history_long.result @@ -0,0 +1,36 @@ +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG +where event_name like 'Wait/Synch/%' limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG +where event_name='FOO'; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG +where event_name like 'Wait/Synch/%' order by timer_wait limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG +where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +# # # # # # # # NULL NULL NULL # NULL # NULL 0 +insert into performance_schema.EVENTS_WAITS_HISTORY_LONG +set thread_id='1', event_id=1, +event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +update performance_schema.EVENTS_WAITS_HISTORY_LONG +set timer_start=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +update performance_schema.EVENTS_WAITS_HISTORY_LONG +set timer_start=12 where thread_id=0; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +delete from performance_schema.EVENTS_WAITS_HISTORY_LONG +where thread_id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +delete from performance_schema.EVENTS_WAITS_HISTORY_LONG; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +UNLOCK TABLES; +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_event_name.result new file mode 100644 index 00000000000..675fba021fe --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ews_by_event_name.result @@ -0,0 +1,28 @@ +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +where event_name like 'Wait/Synch/%' limit 1; +EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +where event_name='FOO'; +EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +UNLOCK TABLES; +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_instance.result b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result new file mode 100644 index 00000000000..dc262982340 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ews_by_instance.result @@ -0,0 +1,45 @@ +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +where event_name like 'Wait/Synch/%' limit 1; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +where event_name='FOO'; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +order by count_star limit 1; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +order by count_star desc limit 1; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +where min_timer_wait > 0 order by count_star limit 1; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +where min_timer_wait > 0 order by count_star desc limit 1; +EVENT_NAME OBJECT_INSTANCE_BEGIN COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # # +insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +set event_name='FOO', object_instance_begin=0, +count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +UNLOCK TABLES; +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result new file mode 100644 index 00000000000..2a085659431 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_ews_by_thread_by_event_name.result @@ -0,0 +1,29 @@ +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +where event_name like 'Wait/Synch/%' limit 1; +THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +# # # # # # # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +where event_name='FOO'; +THREAD_ID EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT +insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +set event_name='FOO', thread_id=1, +count_star=1, sum_timer_wait=2, min_timer_wait=3, +avg_timer_wait=4, max_timer_wait=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +set count_star=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +set count_star=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +where count_star=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +UNLOCK TABLES; +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_file_instances.result b/mysql-test/suite/perfschema/r/dml_file_instances.result new file mode 100644 index 00000000000..e15d68cbad3 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_file_instances.result @@ -0,0 +1,23 @@ +select * from performance_schema.FILE_INSTANCES limit 1; +FILE_NAME EVENT_NAME OPEN_COUNT +# # # +select * from performance_schema.FILE_INSTANCES +where file_name='FOO'; +FILE_NAME EVENT_NAME OPEN_COUNT +insert into performance_schema.FILE_INSTANCES +set file_name='FOO', event_name='BAR', open_count=12; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +update performance_schema.FILE_INSTANCES +set file_name='FOO'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +delete from performance_schema.FILE_INSTANCES +where event_name like "wait/%"; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +delete from performance_schema.FILE_INSTANCES; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +LOCK TABLES performance_schema.FILE_INSTANCES READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +UNLOCK TABLES; +LOCK TABLES performance_schema.FILE_INSTANCES WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result b/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result new file mode 100644 index 00000000000..1ecc82f40a5 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_file_summary_by_event_name.result @@ -0,0 +1,28 @@ +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME +where event_name like 'Wait/io/%' limit 1; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +# # # # # +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME +where event_name='FOO'; +EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +insert into performance_schema.FILE_SUMMARY_BY_EVENT_NAME +set event_name='FOO', count_read=1, count_write=2, +sum_number_of_bytes_read=4, sum_number_of_bytes_write=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +update performance_schema.FILE_SUMMARY_BY_EVENT_NAME +set count_read=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +update performance_schema.FILE_SUMMARY_BY_EVENT_NAME +set count_write=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME +where count_read=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +UNLOCK TABLES; +LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_EVENT_NAME' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result b/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result new file mode 100644 index 00000000000..05b204cc1a9 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_file_summary_by_instance.result @@ -0,0 +1,28 @@ +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE +where event_name like 'Wait/io/%' limit 1; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +# # # # # # +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE +where event_name='FOO'; +FILE_NAME EVENT_NAME COUNT_READ COUNT_WRITE SUM_NUMBER_OF_BYTES_READ SUM_NUMBER_OF_BYTES_WRITE +insert into performance_schema.FILE_SUMMARY_BY_INSTANCE +set event_name='FOO', count_read=1, count_write=2, +sum_number_of_bytes_read=4, sum_number_of_bytes_write=5; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +update performance_schema.FILE_SUMMARY_BY_INSTANCE +set count_read=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +update performance_schema.FILE_SUMMARY_BY_INSTANCE +set count_write=12 where event_name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +delete from performance_schema.FILE_SUMMARY_BY_INSTANCE +where count_read=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +delete from performance_schema.FILE_SUMMARY_BY_INSTANCE; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +UNLOCK TABLES; +LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_mutex_instances.result b/mysql-test/suite/perfschema/r/dml_mutex_instances.result new file mode 100644 index 00000000000..655ca811c06 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_mutex_instances.result @@ -0,0 +1,23 @@ +select * from performance_schema.MUTEX_INSTANCES limit 1; +NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID +# # NULL +select * from performance_schema.MUTEX_INSTANCES +where name='FOO'; +NAME OBJECT_INSTANCE_BEGIN LOCKED_BY_THREAD_ID +insert into performance_schema.MUTEX_INSTANCES +set name='FOO', object_instance_begin=12; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES' +update performance_schema.MUTEX_INSTANCES +set name='FOO'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES' +delete from performance_schema.MUTEX_INSTANCES +where name like "wait/%"; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES' +delete from performance_schema.MUTEX_INSTANCES; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES' +LOCK TABLES performance_schema.MUTEX_INSTANCES READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES' +UNLOCK TABLES; +LOCK TABLES performance_schema.MUTEX_INSTANCES WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'MUTEX_INSTANCES' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_performance_timers.result b/mysql-test/suite/perfschema/r/dml_performance_timers.result new file mode 100644 index 00000000000..99c1c74b797 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_performance_timers.result @@ -0,0 +1,29 @@ +select * from performance_schema.PERFORMANCE_TIMERS; +TIMER_NAME TIMER_FREQUENCY TIMER_RESOLUTION TIMER_OVERHEAD +CYCLE +NANOSECOND +MICROSECOND +MILLISECOND +TICK +select * from performance_schema.PERFORMANCE_TIMERS +where timer_name='CYCLE'; +TIMER_NAME TIMER_FREQUENCY TIMER_RESOLUTION TIMER_OVERHEAD +CYCLE +insert into performance_schema.PERFORMANCE_TIMERS +set timer_name='FOO', timer_frequency=1, +timer_resolution=2, timer_overhead=3; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS' +update performance_schema.PERFORMANCE_TIMERS +set timer_frequency=12 where timer_name='CYCLE'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS' +delete from performance_schema.PERFORMANCE_TIMERS; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS' +delete from performance_schema.PERFORMANCE_TIMERS +where timer_name='CYCLE'; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS' +LOCK TABLES performance_schema.PERFORMANCE_TIMERS READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS' +UNLOCK TABLES; +LOCK TABLES performance_schema.PERFORMANCE_TIMERS WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PERFORMANCE_TIMERS' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_processlist.result b/mysql-test/suite/perfschema/r/dml_processlist.result new file mode 100644 index 00000000000..ee0da5a7f1d --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_processlist.result @@ -0,0 +1,27 @@ +select * from performance_schema.PROCESSLIST +where name like 'Thread/%' limit 1; +THREAD_ID ID NAME +# # # +select * from performance_schema.PROCESSLIST +where name='FOO'; +THREAD_ID ID NAME +insert into performance_schema.PROCESSLIST +set name='FOO', thread_id=1, id=2; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'PROCESSLIST' +update performance_schema.PROCESSLIST +set thread_id=12; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PROCESSLIST' +update performance_schema.PROCESSLIST +set thread_id=12 where name like "FOO"; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'PROCESSLIST' +delete from performance_schema.PROCESSLIST +where id=1; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PROCESSLIST' +delete from performance_schema.PROCESSLIST; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'PROCESSLIST' +LOCK TABLES performance_schema.PROCESSLIST READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PROCESSLIST' +UNLOCK TABLES; +LOCK TABLES performance_schema.PROCESSLIST WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'PROCESSLIST' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_rwlock_instances.result b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result new file mode 100644 index 00000000000..62b5fbeaa8a --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_rwlock_instances.result @@ -0,0 +1,23 @@ +select * from performance_schema.RWLOCK_INSTANCES limit 1; +NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT +# # NULL 0 +select * from performance_schema.RWLOCK_INSTANCES +where name='FOO'; +NAME OBJECT_INSTANCE_BEGIN WRITE_LOCKED_BY_THREAD_ID READ_LOCKED_BY_COUNT +insert into performance_schema.RWLOCK_INSTANCES +set name='FOO', object_instance_begin=12; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES' +update performance_schema.RWLOCK_INSTANCES +set name='FOO'; +ERROR 42000: UPDATE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES' +delete from performance_schema.RWLOCK_INSTANCES +where name like "wait/%"; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES' +delete from performance_schema.RWLOCK_INSTANCES; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES' +LOCK TABLES performance_schema.RWLOCK_INSTANCES READ; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES' +UNLOCK TABLES; +LOCK TABLES performance_schema.RWLOCK_INSTANCES WRITE; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'RWLOCK_INSTANCES' +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_setup_consumers.result b/mysql-test/suite/perfschema/r/dml_setup_consumers.result new file mode 100644 index 00000000000..44ed751dcd2 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_setup_consumers.result @@ -0,0 +1,45 @@ +select * from performance_schema.SETUP_CONSUMERS; +NAME ENABLED +events_waits_current YES +events_waits_history YES +events_waits_history_long YES +events_waits_summary_by_thread_by_event_name YES +events_waits_summary_by_event_name YES +events_waits_summary_by_instance YES +file_summary_by_event_name YES +file_summary_by_instance YES +select * from performance_schema.SETUP_CONSUMERS +where name='events_waits_current'; +NAME ENABLED +events_waits_current YES +select * from performance_schema.SETUP_CONSUMERS +where enabled='YES'; +NAME ENABLED +events_waits_current YES +events_waits_history YES +events_waits_history_long YES +events_waits_summary_by_thread_by_event_name YES +events_waits_summary_by_event_name YES +events_waits_summary_by_instance YES +file_summary_by_event_name YES +file_summary_by_instance YES +select * from performance_schema.SETUP_CONSUMERS +where enabled='NO'; +NAME ENABLED +insert into performance_schema.SETUP_CONSUMERS +set name='FOO', enabled='YES'; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS' +update performance_schema.SETUP_CONSUMERS +set name='FOO'; +ERROR HY000: Invalid performance_schema usage. +update performance_schema.SETUP_CONSUMERS +set enabled='YES'; +delete from performance_schema.SETUP_CONSUMERS; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS' +delete from performance_schema.SETUP_CONSUMERS +where name='events_waits_current'; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_CONSUMERS' +LOCK TABLES performance_schema.SETUP_CONSUMERS READ; +UNLOCK TABLES; +LOCK TABLES performance_schema.SETUP_CONSUMERS WRITE; +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_setup_instruments.result b/mysql-test/suite/perfschema/r/dml_setup_instruments.result new file mode 100644 index 00000000000..3a457578b3d --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_setup_instruments.result @@ -0,0 +1,72 @@ +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_INSTRUMENTS +where name like 'Wait/Synch/Mutex/sql/%' + and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex') +order by name limit 10; +NAME ENABLED TIMED +wait/synch/mutex/sql/Cversion_lock YES YES +wait/synch/mutex/sql/Delayed_insert::mutex YES YES +wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state YES YES +wait/synch/mutex/sql/hash_filo::lock YES YES +wait/synch/mutex/sql/LOCK_active_mi YES YES +wait/synch/mutex/sql/LOCK_connection_count YES YES +wait/synch/mutex/sql/LOCK_crypt YES YES +wait/synch/mutex/sql/LOCK_delayed_create YES YES +wait/synch/mutex/sql/LOCK_delayed_insert YES YES +wait/synch/mutex/sql/LOCK_delayed_status YES YES +select * from performance_schema.SETUP_INSTRUMENTS +where name like 'Wait/Synch/Rwlock/sql/%' + order by name limit 10; +NAME ENABLED TIMED +wait/synch/rwlock/sql/LOCK_dboptions YES YES +wait/synch/rwlock/sql/LOCK_grant YES YES +wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES +wait/synch/rwlock/sql/LOCK_sys_init_connect YES YES +wait/synch/rwlock/sql/LOCK_sys_init_slave YES YES +wait/synch/rwlock/sql/LOGGER::LOCK_logger YES YES +wait/synch/rwlock/sql/Query_cache_query::lock YES YES +wait/synch/rwlock/sql/THR_LOCK_servers YES YES +wait/synch/rwlock/sql/THR_LOCK_udf YES YES +select * from performance_schema.SETUP_INSTRUMENTS +where name like 'Wait/Synch/Cond/sql/%' + and name not in ( +'wait/synch/cond/sql/COND_handler_count', +'wait/synch/cond/sql/DEBUG_SYNC::cond') +order by name limit 10; +NAME ENABLED TIMED +wait/synch/cond/sql/COND_flush_thread_cache YES YES +wait/synch/cond/sql/COND_global_read_lock YES YES +wait/synch/cond/sql/COND_manager YES YES +wait/synch/cond/sql/COND_queue_state YES YES +wait/synch/cond/sql/COND_refresh YES YES +wait/synch/cond/sql/COND_rpl_status YES YES +wait/synch/cond/sql/COND_server_started YES YES +wait/synch/cond/sql/COND_thread_cache YES YES +wait/synch/cond/sql/COND_thread_count YES YES +wait/synch/cond/sql/Delayed_insert::cond YES YES +select * from performance_schema.SETUP_INSTRUMENTS +where name='Wait'; +select * from performance_schema.SETUP_INSTRUMENTS +where enabled='YES'; +insert into performance_schema.SETUP_INSTRUMENTS +set name='FOO', enabled='YES', timed='YES'; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +update performance_schema.SETUP_INSTRUMENTS +set name='FOO'; +ERROR HY000: Invalid performance_schema usage. +update performance_schema.SETUP_INSTRUMENTS +set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS +set timed='NO'; +select * from performance_schema.SETUP_INSTRUMENTS; +update performance_schema.SETUP_INSTRUMENTS +set enabled='YES', timed='YES'; +delete from performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +delete from performance_schema.SETUP_INSTRUMENTS +where name like 'Wait/Synch/%'; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +LOCK TABLES performance_schema.SETUP_INSTRUMENTS READ; +UNLOCK TABLES; +LOCK TABLES performance_schema.SETUP_INSTRUMENTS WRITE; +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_setup_objects.result b/mysql-test/suite/perfschema/r/dml_setup_objects.result new file mode 100644 index 00000000000..a9d97357227 --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_setup_objects.result @@ -0,0 +1,35 @@ +select * from performance_schema.SETUP_OBJECTS; +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED +select * from performance_schema.SETUP_OBJECTS +where object_type = 'TABLE'; +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED +select * from performance_schema.SETUP_OBJECTS +where enabled='YES'; +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED +insert into performance_schema.SETUP_OBJECTS +set object_type='TABLE', object_schema='FOO', object_name='BAR', +enabled='YES', timed='YES', aggregated='YES'; +ERROR HY000: Table storage engine for 'SETUP_OBJECTS' doesn't have this option +update performance_schema.SETUP_OBJECTS +set object_type='TABLE'; +update performance_schema.SETUP_OBJECTS +set object_schema='ILLEGAL'; +update performance_schema.SETUP_OBJECTS +set object_name='ILLEGAL'; +update performance_schema.SETUP_OBJECTS +set enabled='NO'; +update performance_schema.SETUP_OBJECTS +set timed='NO'; +update performance_schema.SETUP_OBJECTS +set aggregated='NO'; +select * from performance_schema.SETUP_OBJECTS; +OBJECT_TYPE OBJECT_SCHEMA OBJECT_NAME ENABLED TIMED AGGREGATED +update performance_schema.SETUP_OBJECTS +set enabled='YES', timed='YES', aggregated='YES'; +delete from performance_schema.SETUP_OBJECTS +where object_type = 'TABLE'; +delete from performance_schema.SETUP_OBJECTS; +LOCK TABLES performance_schema.SETUP_OBJECTS READ; +UNLOCK TABLES; +LOCK TABLES performance_schema.SETUP_OBJECTS WRITE; +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/dml_setup_timers.result b/mysql-test/suite/perfschema/r/dml_setup_timers.result new file mode 100644 index 00000000000..a9bee916cde --- /dev/null +++ b/mysql-test/suite/perfschema/r/dml_setup_timers.result @@ -0,0 +1,33 @@ +select * from performance_schema.SETUP_TIMERS; +NAME TIMER_NAME +wait CYCLE +select * from performance_schema.SETUP_TIMERS +where name='Wait'; +NAME TIMER_NAME +wait CYCLE +select * from performance_schema.SETUP_TIMERS +where timer_name='CYCLE'; +NAME TIMER_NAME +wait CYCLE +insert into performance_schema.SETUP_TIMERS +set name='FOO', timer_name='CYCLE'; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_TIMERS' +update performance_schema.SETUP_TIMERS +set name='FOO'; +ERROR HY000: Invalid performance_schema usage. +update performance_schema.SETUP_TIMERS +set timer_name='MILLISECOND'; +select * from performance_schema.SETUP_TIMERS; +NAME TIMER_NAME +wait MILLISECOND +update performance_schema.SETUP_TIMERS +set timer_name='CYCLE'; +delete from performance_schema.SETUP_TIMERS; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_TIMERS' +delete from performance_schema.SETUP_TIMERS +where name='Wait'; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_TIMERS' +LOCK TABLES performance_schema.SETUP_TIMERS READ; +UNLOCK TABLES; +LOCK TABLES performance_schema.SETUP_TIMERS WRITE; +UNLOCK TABLES; diff --git a/mysql-test/suite/perfschema/r/func_file_io.result b/mysql-test/suite/perfschema/r/func_file_io.result new file mode 100644 index 00000000000..69e6072fc22 --- /dev/null +++ b/mysql-test/suite/perfschema/r/func_file_io.result @@ -0,0 +1,117 @@ +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/io/file/%'; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; +INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +SELECT * FROM t1 WHERE id = 1; +id b +1 initial value +SET @before_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') +AND (OBJECT_NAME LIKE '%t1.MYD')); +SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; +has_instrumentation +Success +SELECT * FROM t1 WHERE id < 4; +id b +1 initial value +2 initial value +3 initial value +SET @after_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') +AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); +SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; +test_ff1_timed +Success +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled='NO'; +SET @before_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') +AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); +SELECT * FROM t1 WHERE id < 6; +id b +1 initial value +2 initial value +3 initial value +4 initial value +5 initial value +SET @after_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') +AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); +SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; +test_ff2_timed +Success +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/io/file/%'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'NO'; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +SELECT * FROM t1 WHERE id > 4; +id b +5 initial value +6 initial value +7 initial value +8 initial value +SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE TIMER_WAIT != NULL +OR TIMER_START != NULL +OR TIMER_END != NULL; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY +WHERE TIMER_WAIT != NULL +OR TIMER_START != NULL +OR TIMER_END != NULL; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE TIMER_WAIT != NULL +OR TIMER_START != NULL +OR TIMER_END != NULL; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'YES'; +SELECT * FROM t1 WHERE id < 4; +id b +1 initial value +2 initial value +3 initial value +DROP TABLE t1; +SELECT SUM(COUNT_READ) AS sum_count_read, +SUM(COUNT_WRITE) AS sum_count_write, +SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read, +SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write +FROM performance_schema.FILE_SUMMARY_BY_INSTANCE +WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL; +SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +WHERE COUNT_STAR > 0 +ORDER BY SUM_TIMER_WAIT DESC +LIMIT 10; +SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT +# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h +INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID) +LEFT JOIN information_schema.PROCESSLIST i USING (ID) +GROUP BY i.user +ORDER BY SUM_WAIT DESC +LIMIT 20; +SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h +INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID) +WHERE p.ID = 1 +GROUP BY h.EVENT_NAME +HAVING TOTAL_WAIT > 0; +SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h +INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID) +LEFT JOIN information_schema.PROCESSLIST i USING (ID) +GROUP BY i.user, h.operation +HAVING BYTES > 0 +ORDER BY i.user, h.operation; diff --git a/mysql-test/suite/perfschema/r/func_mutex.result b/mysql-test/suite/perfschema/r/func_mutex.result new file mode 100644 index 00000000000..e32d7267bb1 --- /dev/null +++ b/mysql-test/suite/perfschema/r/func_mutex.result @@ -0,0 +1,113 @@ +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/synch/mutex/%' + OR name LIKE 'wait/synch/rwlock/%'; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; +INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +SELECT * FROM t1 WHERE id = 1; +id b +1 initial value +SET @before_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); +SELECT * FROM t1; +id b +1 initial value +2 initial value +3 initial value +4 initial value +5 initial value +6 initial value +7 initial value +8 initial value +SET @after_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); +SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed; +test_fm1_timed +Success +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO' +WHERE NAME = 'wait/synch/mutex/sql/LOCK_open'; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +SELECT * FROM t1 WHERE id = 1; +id b +1 initial value +SET @before_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); +SELECT * FROM t1; +id b +1 initial value +2 initial value +3 initial value +4 initial value +5 initial value +6 initial value +7 initial value +8 initial value +SET @after_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); +SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed; +test_fm2_timed +Success +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +SELECT * FROM t1 WHERE id = 1; +id b +1 initial value +SET @before_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); +SELECT * FROM t1; +id b +1 initial value +2 initial value +3 initial value +4 initial value +5 initial value +6 initial value +7 initial value +8 initial value +SET @after_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); +SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed; +test_fm1_rw_timed +Success +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO' +WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant'; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +SELECT * FROM t1 WHERE id = 1; +id b +1 initial value +SET @before_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); +SELECT * FROM t1; +id b +1 initial value +2 initial value +3 initial value +4 initial value +5 initial value +6 initial value +7 initial value +8 initial value +SET @after_count = (SELECT SUM(TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); +SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; +test_fm2_rw_timed +Success +DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/r/global_read_lock.result b/mysql-test/suite/perfschema/r/global_read_lock.result new file mode 100644 index 00000000000..93d6adfd049 --- /dev/null +++ b/mysql-test/suite/perfschema/r/global_read_lock.result @@ -0,0 +1,33 @@ +use performance_schema; +grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; +flush privileges; +connect (con1, localhost, pfsuser, , test); +lock tables performance_schema.SETUP_INSTRUMENTS read; +select * from performance_schema.SETUP_INSTRUMENTS; +unlock tables; +lock tables performance_schema.SETUP_INSTRUMENTS write; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +unlock tables; +connection default; +flush tables with read lock; +connection con1; +lock tables performance_schema.SETUP_INSTRUMENTS read; +select * from performance_schema.SETUP_INSTRUMENTS; +unlock tables; +lock tables performance_schema.SETUP_INSTRUMENTS write; +connection default; +select event_name, +left(source, locate(":", source)) as short_source, +timer_end, timer_wait, operation +from performance_schema.EVENTS_WAITS_CURRENT +where event_name like "wait/synch/cond/sql/COND_global_read_lock"; +event_name short_source timer_end timer_wait operation +wait/synch/cond/sql/COND_global_read_lock lock.cc: NULL NULL wait +unlock tables; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +unlock tables; +connection default; +drop user pfsuser@localhost; +flush privileges; diff --git a/mysql-test/suite/perfschema/r/information_schema.result b/mysql-test/suite/perfschema/r/information_schema.result new file mode 100644 index 00000000000..86ebe80768c --- /dev/null +++ b/mysql-test/suite/perfschema/r/information_schema.result @@ -0,0 +1,198 @@ +select TABLE_SCHEMA, upper(TABLE_NAME), TABLE_CATALOG +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +TABLE_SCHEMA upper(TABLE_NAME) TABLE_CATALOG +performance_schema COND_INSTANCES def +performance_schema EVENTS_WAITS_CURRENT def +performance_schema EVENTS_WAITS_HISTORY def +performance_schema EVENTS_WAITS_HISTORY_LONG def +performance_schema EVENTS_WAITS_SUMMARY_BY_EVENT_NAME def +performance_schema EVENTS_WAITS_SUMMARY_BY_INSTANCE def +performance_schema EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME def +performance_schema FILE_INSTANCES def +performance_schema FILE_SUMMARY_BY_EVENT_NAME def +performance_schema FILE_SUMMARY_BY_INSTANCE def +performance_schema MUTEX_INSTANCES def +performance_schema PERFORMANCE_TIMERS def +performance_schema PROCESSLIST def +performance_schema RWLOCK_INSTANCES def +performance_schema SETUP_CONSUMERS def +performance_schema SETUP_INSTRUMENTS def +performance_schema SETUP_OBJECTS def +performance_schema SETUP_TIMERS def +select upper(TABLE_NAME), TABLE_TYPE, ENGINE +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) TABLE_TYPE ENGINE +COND_INSTANCES BASE TABLE PERFORMANCE_SCHEMA +EVENTS_WAITS_CURRENT BASE TABLE PERFORMANCE_SCHEMA +EVENTS_WAITS_HISTORY BASE TABLE PERFORMANCE_SCHEMA +EVENTS_WAITS_HISTORY_LONG BASE TABLE PERFORMANCE_SCHEMA +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA +EVENTS_WAITS_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA +FILE_INSTANCES BASE TABLE PERFORMANCE_SCHEMA +FILE_SUMMARY_BY_EVENT_NAME BASE TABLE PERFORMANCE_SCHEMA +FILE_SUMMARY_BY_INSTANCE BASE TABLE PERFORMANCE_SCHEMA +MUTEX_INSTANCES BASE TABLE PERFORMANCE_SCHEMA +PERFORMANCE_TIMERS BASE TABLE PERFORMANCE_SCHEMA +PROCESSLIST BASE TABLE PERFORMANCE_SCHEMA +RWLOCK_INSTANCES BASE TABLE PERFORMANCE_SCHEMA +SETUP_CONSUMERS BASE TABLE PERFORMANCE_SCHEMA +SETUP_INSTRUMENTS BASE TABLE PERFORMANCE_SCHEMA +SETUP_OBJECTS BASE TABLE PERFORMANCE_SCHEMA +SETUP_TIMERS BASE TABLE PERFORMANCE_SCHEMA +select upper(TABLE_NAME), VERSION, ROW_FORMAT +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) VERSION ROW_FORMAT +COND_INSTANCES 10 Dynamic +EVENTS_WAITS_CURRENT 10 Dynamic +EVENTS_WAITS_HISTORY 10 Dynamic +EVENTS_WAITS_HISTORY_LONG 10 Dynamic +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 10 Dynamic +EVENTS_WAITS_SUMMARY_BY_INSTANCE 10 Dynamic +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 10 Dynamic +FILE_INSTANCES 10 Dynamic +FILE_SUMMARY_BY_EVENT_NAME 10 Dynamic +FILE_SUMMARY_BY_INSTANCE 10 Dynamic +MUTEX_INSTANCES 10 Dynamic +PERFORMANCE_TIMERS 10 Fixed +PROCESSLIST 10 Dynamic +RWLOCK_INSTANCES 10 Dynamic +SETUP_CONSUMERS 10 Dynamic +SETUP_INSTRUMENTS 10 Dynamic +SETUP_OBJECTS 10 Dynamic +SETUP_TIMERS 10 Dynamic +select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) TABLE_ROWS AVG_ROW_LENGTH +COND_INSTANCES 1000 0 +EVENTS_WAITS_CURRENT 1000 0 +EVENTS_WAITS_HISTORY 1000 0 +EVENTS_WAITS_HISTORY_LONG 10000 0 +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 1000 0 +EVENTS_WAITS_SUMMARY_BY_INSTANCE 1000 0 +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 1000 0 +FILE_INSTANCES 1000 0 +FILE_SUMMARY_BY_EVENT_NAME 1000 0 +FILE_SUMMARY_BY_INSTANCE 1000 0 +MUTEX_INSTANCES 1000 0 +PERFORMANCE_TIMERS 5 0 +PROCESSLIST 1000 0 +RWLOCK_INSTANCES 1000 0 +SETUP_CONSUMERS 8 0 +SETUP_INSTRUMENTS 1000 0 +SETUP_OBJECTS 1000 0 +SETUP_TIMERS 1 0 +select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) DATA_LENGTH MAX_DATA_LENGTH +COND_INSTANCES 0 0 +EVENTS_WAITS_CURRENT 0 0 +EVENTS_WAITS_HISTORY 0 0 +EVENTS_WAITS_HISTORY_LONG 0 0 +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 0 0 +EVENTS_WAITS_SUMMARY_BY_INSTANCE 0 0 +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 0 0 +FILE_INSTANCES 0 0 +FILE_SUMMARY_BY_EVENT_NAME 0 0 +FILE_SUMMARY_BY_INSTANCE 0 0 +MUTEX_INSTANCES 0 0 +PERFORMANCE_TIMERS 0 0 +PROCESSLIST 0 0 +RWLOCK_INSTANCES 0 0 +SETUP_CONSUMERS 0 0 +SETUP_INSTRUMENTS 0 0 +SETUP_OBJECTS 0 0 +SETUP_TIMERS 0 0 +select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) INDEX_LENGTH DATA_FREE AUTO_INCREMENT +COND_INSTANCES 0 0 NULL +EVENTS_WAITS_CURRENT 0 0 NULL +EVENTS_WAITS_HISTORY 0 0 NULL +EVENTS_WAITS_HISTORY_LONG 0 0 NULL +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME 0 0 NULL +EVENTS_WAITS_SUMMARY_BY_INSTANCE 0 0 NULL +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME 0 0 NULL +FILE_INSTANCES 0 0 NULL +FILE_SUMMARY_BY_EVENT_NAME 0 0 NULL +FILE_SUMMARY_BY_INSTANCE 0 0 NULL +MUTEX_INSTANCES 0 0 NULL +PERFORMANCE_TIMERS 0 0 NULL +PROCESSLIST 0 0 NULL +RWLOCK_INSTANCES 0 0 NULL +SETUP_CONSUMERS 0 0 NULL +SETUP_INSTRUMENTS 0 0 NULL +SETUP_OBJECTS 0 0 NULL +SETUP_TIMERS 0 0 NULL +select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) CREATE_TIME UPDATE_TIME CHECK_TIME +COND_INSTANCES NULL NULL NULL +EVENTS_WAITS_CURRENT NULL NULL NULL +EVENTS_WAITS_HISTORY NULL NULL NULL +EVENTS_WAITS_HISTORY_LONG NULL NULL NULL +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME NULL NULL NULL +EVENTS_WAITS_SUMMARY_BY_INSTANCE NULL NULL NULL +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME NULL NULL NULL +FILE_INSTANCES NULL NULL NULL +FILE_SUMMARY_BY_EVENT_NAME NULL NULL NULL +FILE_SUMMARY_BY_INSTANCE NULL NULL NULL +MUTEX_INSTANCES NULL NULL NULL +PERFORMANCE_TIMERS NULL NULL NULL +PROCESSLIST NULL NULL NULL +RWLOCK_INSTANCES NULL NULL NULL +SETUP_CONSUMERS NULL NULL NULL +SETUP_INSTRUMENTS NULL NULL NULL +SETUP_OBJECTS NULL NULL NULL +SETUP_TIMERS NULL NULL NULL +select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) TABLE_COLLATION CHECKSUM +COND_INSTANCES utf8_general_ci NULL +EVENTS_WAITS_CURRENT utf8_general_ci NULL +EVENTS_WAITS_HISTORY utf8_general_ci NULL +EVENTS_WAITS_HISTORY_LONG utf8_general_ci NULL +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME utf8_general_ci NULL +EVENTS_WAITS_SUMMARY_BY_INSTANCE utf8_general_ci NULL +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME utf8_general_ci NULL +FILE_INSTANCES utf8_general_ci NULL +FILE_SUMMARY_BY_EVENT_NAME utf8_general_ci NULL +FILE_SUMMARY_BY_INSTANCE utf8_general_ci NULL +MUTEX_INSTANCES utf8_general_ci NULL +PERFORMANCE_TIMERS utf8_general_ci NULL +PROCESSLIST utf8_general_ci NULL +RWLOCK_INSTANCES utf8_general_ci NULL +SETUP_CONSUMERS utf8_general_ci NULL +SETUP_INSTRUMENTS utf8_general_ci NULL +SETUP_OBJECTS utf8_general_ci NULL +SETUP_TIMERS utf8_general_ci NULL +select upper(TABLE_NAME), TABLE_COMMENT +from information_schema.tables +where TABLE_SCHEMA='performance_schema'; +upper(TABLE_NAME) TABLE_COMMENT +COND_INSTANCES +EVENTS_WAITS_CURRENT +EVENTS_WAITS_HISTORY +EVENTS_WAITS_HISTORY_LONG +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +EVENTS_WAITS_SUMMARY_BY_INSTANCE +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +FILE_INSTANCES +FILE_SUMMARY_BY_EVENT_NAME +FILE_SUMMARY_BY_INSTANCE +MUTEX_INSTANCES +PERFORMANCE_TIMERS +PROCESSLIST +RWLOCK_INSTANCES +SETUP_CONSUMERS +SETUP_INSTRUMENTS +SETUP_OBJECTS +SETUP_TIMERS diff --git a/mysql-test/suite/perfschema/r/misc.result b/mysql-test/suite/perfschema/r/misc.result new file mode 100644 index 00000000000..d944b4b1d3d --- /dev/null +++ b/mysql-test/suite/perfschema/r/misc.result @@ -0,0 +1,13 @@ +SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE THREAD_ID IN +(SELECT THREAD_ID FROM performance_schema.PROCESSLIST) +AND EVENT_NAME IN +(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS +WHERE NAME LIKE "wait/synch/%") +LIMIT 1; +create table test.t1(a int) engine=performance_schema; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; +ERROR HY000: Invalid performance_schema usage. +create table performance_schema.t1(a int); +ERROR 42000: CREATE command denied to user 'root'@'localhost' for table 't1' diff --git a/mysql-test/suite/perfschema/r/myisam_file_io.result b/mysql-test/suite/perfschema/r/myisam_file_io.result new file mode 100644 index 00000000000..66c37c7d6d8 --- /dev/null +++ b/mysql-test/suite/perfschema/r/myisam_file_io.result @@ -0,0 +1,59 @@ +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/io/file/myisam/%"; +update performance_schema.SETUP_CONSUMERS +set enabled='YES'; +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; +drop table if exists test.no_index_tab; +create table test.no_index_tab ( a varchar(255), b int ) engine=myisam; +insert into no_index_tab set a = 'foo', b = 1; +insert into no_index_tab set a = 'foo', b = 1; +insert into no_index_tab set a = 'foo', b = 1; +select event_name, +left(source, locate(":", source)) as short_source, +operation, number_of_bytes, +substring(object_name, locate("no_index_tab", object_name)) as short_name +from performance_schema.EVENTS_WAITS_HISTORY_LONG +where operation not like "tell" + order by thread_id, event_id; +event_name short_source operation number_of_bytes short_name +wait/io/file/myisam/kfile mi_create.c: create NULL no_index_tab.MYI +wait/io/file/myisam/dfile mi_create.c: create NULL no_index_tab.MYD +wait/io/file/myisam/kfile mi_open.c: write 176 no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: write 100 no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: write 7 no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: write 7 no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: write 7 no_index_tab.MYI +wait/io/file/myisam/kfile mi_create.c: chsize 1024 no_index_tab.MYI +wait/io/file/myisam/dfile mi_create.c: close NULL no_index_tab.MYD +wait/io/file/myisam/kfile mi_create.c: close NULL no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: open NULL no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: read 24 no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: seek NULL no_index_tab.MYI +wait/io/file/myisam/kfile mi_open.c: read 297 no_index_tab.MYI +wait/io/file/myisam/dfile mi_open.c: open NULL no_index_tab.MYD +wait/io/file/myisam/kfile mi_locking.c: write 3 no_index_tab.MYI +wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD +wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI +wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD +wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI +wait/io/file/myisam/dfile mi_dynrec.c: write 20 no_index_tab.MYD +wait/io/file/myisam/kfile mi_open.c: write 124 no_index_tab.MYI +show status like 'performance_schema_%'; +Variable_name Value +Performance_schema_cond_classes_lost 0 +Performance_schema_cond_instances_lost 0 +Performance_schema_file_classes_lost 0 +Performance_schema_file_handles_lost 0 +Performance_schema_file_instances_lost 0 +Performance_schema_locker_lost 0 +Performance_schema_mutex_classes_lost 0 +Performance_schema_mutex_instances_lost 0 +Performance_schema_rwlock_classes_lost 0 +Performance_schema_rwlock_instances_lost 0 +Performance_schema_table_handles_lost 0 +Performance_schema_table_instances_lost 0 +Performance_schema_thread_classes_lost 0 +Performance_schema_thread_instances_lost 0 +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +drop table test.no_index_tab; diff --git a/mysql-test/suite/perfschema/r/no_threads.result b/mysql-test/suite/perfschema/r/no_threads.result new file mode 100644 index 00000000000..b38dc9fd733 --- /dev/null +++ b/mysql-test/suite/perfschema/r/no_threads.result @@ -0,0 +1,43 @@ +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_CONSUMERS set enabled='YES'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; +drop table if exists test.t1; +truncate table performance_schema.EVENTS_WAITS_CURRENT; +truncate table performance_schema.EVENTS_WAITS_HISTORY; +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; +show variables like "thread_handling"; +Variable_name Value +thread_handling no-threads +create table test.t1(a int) engine=MYISAM; +show variables like "performance_schema"; +Variable_name Value +performance_schema ON +show variables like "performance_schema_max_thread%"; +Variable_name Value +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 10 +select count(*) from performance_schema.PROCESSLIST +where name like "thread/sql/main"; +count(*) +1 +select count(*) from performance_schema.PROCESSLIST +where name like "thread/sql/OneConnection"; +count(*) +0 +select event_name, operation, +left(source, locate(":", source)) as short_source +from performance_schema.EVENTS_WAITS_CURRENT; +event_name operation short_source +wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c: +select event_name, operation, +left(source, locate(":", source)) as short_source +from performance_schema.EVENTS_WAITS_HISTORY; +event_name operation short_source +wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c: +select event_name, operation, +left(source, locate(":", source)) as short_source +from performance_schema.EVENTS_WAITS_HISTORY_LONG; +event_name operation short_source +wait/synch/mutex/mysys/THR_LOCK_myisam lock mi_create.c: +drop table test.t1; diff --git a/mysql-test/suite/perfschema/r/one_thread_per_con.result b/mysql-test/suite/perfschema/r/one_thread_per_con.result new file mode 100644 index 00000000000..9677a09933a --- /dev/null +++ b/mysql-test/suite/perfschema/r/one_thread_per_con.result @@ -0,0 +1,38 @@ +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; +drop table if exists test.t1; +drop table if exists test.t2; +drop table if exists test.t3; +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; +show variables like "thread_handling"; +Variable_name Value +thread_handling one-thread-per-connection +"----------------- Connection 1" +create table test.t1(a int) engine=MYISAM; +"----------------- Connection 2" +create table test.t2(a int) engine=MYISAM; +"----------------- Connection 3" +create table test.t3(a int) engine=MYISAM; +"----------------- Connection default" +execute stmt_dump_events using @tid; +event_name short_source operation number_of_bytes +wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL +execute stmt_dump_thread using @tid; +name +thread/sql/one_connection +execute stmt_dump_events using @tid; +event_name short_source operation number_of_bytes +wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL +execute stmt_dump_thread using @tid; +name +thread/sql/one_connection +execute stmt_dump_events using @tid; +event_name short_source operation number_of_bytes +wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL +execute stmt_dump_thread using @tid; +name +thread/sql/one_connection +drop table test.t1; +drop table test.t2; +drop table test.t3; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result new file mode 100644 index 00000000000..ddbc150a72a --- /dev/null +++ b/mysql-test/suite/perfschema/r/privilege.result @@ -0,0 +1,577 @@ +show grants; +Grants for root@localhost +GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION +grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION; +grant ALL on performance_schema.* to 'pfs_user_2'@localhost +with GRANT OPTION; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE on performance_schema.* to 'pfs_user_2'@localhost; +grant DROP on performance_schema.* to 'pfs_user_2'@localhost; +grant REFERENCES on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INDEX on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant ALTER on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE TEMPORARY TABLES on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant EXECUTE on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE VIEW on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant SHOW VIEW on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE ROUTINE on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant ALTER ROUTINE on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant EVENT on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant TRIGGER on performance_schema.* to 'pfs_user_2'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant SELECT on performance_schema.* to 'pfs_user_2'@localhost; +grant INSERT on performance_schema.* to 'pfs_user_2'@localhost; +grant UPDATE on performance_schema.* to 'pfs_user_2'@localhost; +grant DELETE on performance_schema.* to 'pfs_user_2'@localhost; +grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost; +grant ALL on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost +with GRANT OPTION; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant DROP on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +grant REFERENCES on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INDEX on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant ALTER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant SHOW VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant TRIGGER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INSERT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +grant DELETE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; +ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +grant SELECT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost +with GRANT OPTION; +grant UPDATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost +with GRANT OPTION; +grant ALL on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost +with GRANT OPTION; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant DROP on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +grant REFERENCES on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INDEX on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant ALTER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant SHOW VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant TRIGGER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INSERT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +grant UPDATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +grant DELETE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; +ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +grant SELECT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost +with GRANT OPTION; +grant ALL on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost +with GRANT OPTION; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant DROP on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +grant REFERENCES on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INDEX on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant ALTER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant CREATE VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant SHOW VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant TRIGGER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +grant INSERT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: INSERT,GRANT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +grant UPDATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: UPDATE,GRANT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +grant DELETE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; +ERROR 42000: DELETE,GRANT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +grant SELECT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost +with GRANT OPTION; +grant LOCK TABLES on performance_schema.* to 'pfs_user_3'@localhost +with GRANT OPTION; +flush privileges; +drop table if exists test.t1; +rename table performance_schema.SETUP_INSTRUMENTS to test.t1; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to test.t1; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to performance_schema.t1; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS +to performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT +to performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create procedure performance_schema.my_proc() begin end; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create function performance_schema.my_func() returns int return 0; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create event performance_schema.my_event on schedule every 15 minute +do begin end; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_setup_instruments +before insert on performance_schema.SETUP_INSTRUMENTS +for each row begin end; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_events_waits_current +before insert on performance_schema.EVENTS_WAITS_CURRENT +for each row begin end; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_file_instances +before insert on performance_schema.FILE_INSTANCES +for each row begin end; +ERROR 42000: Access denied for user 'root'@'localhost' to database 'performance_schema' +create table test.t1(a int) engine=PERFORMANCE_SCHEMA; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.SETUP_INSTRUMENTS; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.FILE_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +insert into performance_schema.SETUP_INSTRUMENTS +set name="foo"; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +insert into performance_schema.EVENTS_WAITS_CURRENT +set name="foo"; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +insert into performance_schema.FILE_INSTANCES +set name="foo"; +ERROR 42000: INSERT command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +delete from performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'SETUP_INSTRUMENTS' +delete from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +delete from performance_schema.FILE_INSTANCES; +ERROR 42000: DELETE command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +lock table performance_schema.SETUP_INSTRUMENTS read; +unlock tables; +lock table performance_schema.SETUP_INSTRUMENTS write; +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.FILE_INSTANCES read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +lock table performance_schema.FILE_INSTANCES write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'root'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +# +# WL#4818, NFS2: Can use grants to give normal user access +# to view data from _CURRENT and _HISTORY tables +# +# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3. +# (Except for EVENTS_WAITS_CURRENT, which is granted.) +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1; +can select +can select +drop table if exists test.t1; +rename table performance_schema.SETUP_INSTRUMENTS to test.t1; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to test.t1; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS +to performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT +to performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create procedure performance_schema.my_proc() begin end; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create function performance_schema.my_func() returns int return 0; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create event performance_schema.my_event on schedule every 15 minute +do begin end; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_setup_instruments +before insert on performance_schema.SETUP_INSTRUMENTS +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_events_waits_current +before insert on performance_schema.EVENTS_WAITS_CURRENT +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_file_instances +before insert on performance_schema.FILE_INSTANCES +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema' +create table test.t1(a int) engine=PERFORMANCE_SCHEMA; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.SETUP_INSTRUMENTS; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.FILE_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +insert into performance_schema.SETUP_INSTRUMENTS +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'SETUP_INSTRUMENTS' +insert into performance_schema.EVENTS_WAITS_CURRENT +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT' +insert into performance_schema.FILE_INSTANCES +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES' +delete from performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'SETUP_INSTRUMENTS' +delete from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT' +delete from performance_schema.FILE_INSTANCES; +ERROR 42000: DELETE command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES' +lock table performance_schema.SETUP_INSTRUMENTS read; +unlock tables; +lock table performance_schema.SETUP_INSTRUMENTS write; +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.FILE_INSTANCES read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +lock table performance_schema.FILE_INSTANCES write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_1'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +# +# WL#4818, NFS2: Can use grants to give normal user access +# to view data from _CURRENT and _HISTORY tables +# +# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3. +# (Except for EVENTS_WAITS_CURRENT, which is granted.) +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1; +can select +can select +drop table if exists test.t1; +rename table performance_schema.SETUP_INSTRUMENTS to test.t1; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to test.t1; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS +to performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT +to performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create procedure performance_schema.my_proc() begin end; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create function performance_schema.my_func() returns int return 0; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create event performance_schema.my_event on schedule every 15 minute +do begin end; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_setup_instruments +before insert on performance_schema.SETUP_INSTRUMENTS +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_events_waits_current +before insert on performance_schema.EVENTS_WAITS_CURRENT +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_file_instances +before insert on performance_schema.FILE_INSTANCES +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema' +create table test.t1(a int) engine=PERFORMANCE_SCHEMA; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.SETUP_INSTRUMENTS; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.FILE_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +insert into performance_schema.SETUP_INSTRUMENTS +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'SETUP_INSTRUMENTS' +insert into performance_schema.EVENTS_WAITS_CURRENT +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT' +insert into performance_schema.FILE_INSTANCES +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES' +delete from performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'SETUP_INSTRUMENTS' +delete from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT' +delete from performance_schema.FILE_INSTANCES; +ERROR 42000: DELETE command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES' +lock table performance_schema.SETUP_INSTRUMENTS read; +unlock tables; +lock table performance_schema.SETUP_INSTRUMENTS write; +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.FILE_INSTANCES read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +lock table performance_schema.FILE_INSTANCES write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_2'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +# +# WL#4818, NFS2: Can use grants to give normal user access +# to view data from _CURRENT and _HISTORY tables +# +# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3. +# (Except for EVENTS_WAITS_CURRENT, which is granted.) +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1; +can select +can select +drop table if exists test.t1; +rename table performance_schema.SETUP_INSTRUMENTS to test.t1; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to test.t1; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to test.t1; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.FILE_INSTANCES to performance_schema.t1; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.SETUP_INSTRUMENTS +to performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +rename table performance_schema.EVENTS_WAITS_CURRENT +to performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create procedure performance_schema.my_proc() begin end; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create function performance_schema.my_func() returns int return 0; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create event performance_schema.my_event on schedule every 15 minute +do begin end; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_setup_instruments +before insert on performance_schema.SETUP_INSTRUMENTS +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_events_waits_current +before insert on performance_schema.EVENTS_WAITS_CURRENT +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create trigger performance_schema.bi_file_instances +before insert on performance_schema.FILE_INSTANCES +for each row begin end; +ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema' +create table test.t1(a int) engine=PERFORMANCE_SCHEMA; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.SETUP_INSTRUMENTS; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; +ERROR HY000: Invalid performance_schema usage. +create table test.t1 like performance_schema.FILE_INSTANCES; +ERROR HY000: Invalid performance_schema usage. +insert into performance_schema.SETUP_INSTRUMENTS +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'SETUP_INSTRUMENTS' +insert into performance_schema.EVENTS_WAITS_CURRENT +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT' +insert into performance_schema.FILE_INSTANCES +set name="foo"; +ERROR 42000: INSERT command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES' +delete from performance_schema.SETUP_INSTRUMENTS; +ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'SETUP_INSTRUMENTS' +delete from performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT' +delete from performance_schema.FILE_INSTANCES; +ERROR 42000: DELETE command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES' +lock table performance_schema.SETUP_INSTRUMENTS read; +unlock tables; +lock table performance_schema.SETUP_INSTRUMENTS write; +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.EVENTS_WAITS_CURRENT write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_CURRENT' +unlock tables; +lock table performance_schema.FILE_INSTANCES read; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +lock table performance_schema.FILE_INSTANCES write; +ERROR 42000: SELECT,LOCK TABL command denied to user 'pfs_user_3'@'localhost' for table 'FILE_INSTANCES' +unlock tables; +# +# WL#4818, NFS2: Can use grants to give normal user access +# to view data from _CURRENT and _HISTORY tables +# +# Should work as pfs_user_1 and pfs_user_2, but not as pfs_user_3. +# (Except for EVENTS_WAITS_CURRENT, which is granted.) +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY LIMIT 1; +ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_HISTORY' +SELECT "can select" FROM performance_schema.EVENTS_WAITS_HISTORY_LONG LIMIT 1; +ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +SELECT "can select" FROM performance_schema.EVENTS_WAITS_CURRENT LIMIT 1; +can select +can select +SELECT "can select" FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE LIMIT 1; +ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +SELECT "can select" FROM performance_schema.FILE_SUMMARY_BY_INSTANCE LIMIT 1; +ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +revoke all privileges, grant option from 'pfs_user_1'@localhost; +revoke all privileges, grant option from 'pfs_user_2'@localhost; +revoke all privileges, grant option from 'pfs_user_3'@localhost; +drop user 'pfs_user_1'@localhost; +drop user 'pfs_user_2'@localhost; +drop user 'pfs_user_3'@localhost; +flush privileges; +# Test cases from WL#4818 +# Setup user +CREATE user pfs_user_4; +# +# WL#4818, NFS4: Normal user does not have access to view data +# without grants +# +# Select as pfs_user_4 should fail without grant +SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY; +ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY' +SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY_LONG; +ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +SELECT event_id FROM performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_CURRENT' +SELECT event_name FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE; +ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'FILE_SUMMARY_BY_INSTANCE' +# +# WL#4818, NFS3: Normal user does not have access to change what is +# instrumented without grants +# +# User pfs_user_4 should not be allowed to tweak instrumentation without +# explicit grant +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; +ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_INSTRUMENTS' +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/synch/mutex/%' + OR name LIKE 'wait/synch/rwlock/%'; +ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_INSTRUMENTS' +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_CONSUMERS' +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK'; +ERROR 42000: UPDATE command denied to user 'pfs_user_4'@'localhost' for table 'SETUP_TIMERS' +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY_LONG' +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_HISTORY' +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'EVENTS_WAITS_CURRENT' +# +# WL#4814, NFS1: Can use grants to give normal user access +# to turn on and off instrumentation +# +# Grant access to change tables with the root account +GRANT UPDATE ON performance_schema.SETUP_CONSUMERS TO pfs_user_4; +GRANT UPDATE ON performance_schema.SETUP_TIMERS TO pfs_user_4; +GRANT UPDATE, SELECT ON performance_schema.SETUP_INSTRUMENTS TO pfs_user_4; +GRANT DROP ON performance_schema.EVENTS_WAITS_CURRENT TO pfs_user_4; +GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY TO pfs_user_4; +GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY_LONG TO pfs_user_4; +# User pfs_user_4 should now be allowed to tweak instrumentation +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/synch/mutex/%' + OR name LIKE 'wait/synch/rwlock/%'; +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK'; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; +# Clean up +REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4; +DROP USER pfs_user_4; +flush privileges; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE'; diff --git a/mysql-test/suite/perfschema/r/query_cache.result b/mysql-test/suite/perfschema/r/query_cache.result new file mode 100644 index 00000000000..06862009493 --- /dev/null +++ b/mysql-test/suite/perfschema/r/query_cache.result @@ -0,0 +1,66 @@ +drop table if exists t1; +create table t1 (a int not null); +insert into t1 values (1), (2), (3); +SET GLOBAL query_cache_size=1355776; +flush query cache; +reset query cache; +select * from t1; +a +1 +2 +3 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 0 +select * from t1; +a +1 +2 +3 +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1; +spins +NULL +select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1; +name +wait/io/file/csv/data +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1; +spins +NULL +select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1; +name +wait/io/file/csv/data +show status like "Qcache_queries_in_cache"; +Variable_name Value +Qcache_queries_in_cache 1 +show status like "Qcache_inserts"; +Variable_name Value +Qcache_inserts 1 +show status like "Qcache_hits"; +Variable_name Value +Qcache_hits 1 +SET GLOBAL query_cache_size= default; +drop table t1; diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result new file mode 100644 index 00000000000..6a30eb4ab8b --- /dev/null +++ b/mysql-test/suite/perfschema/r/read_only.result @@ -0,0 +1,49 @@ +use performance_schema; +set @start_read_only= @@global.read_only; +grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost; +flush privileges; +connect (con1, localhost, pfsuser, , test); +connection default; +set global read_only=0; +connection con1; +select @@global.read_only; +@@global.read_only +0 +show grants; +Grants for pfsuser@localhost +GRANT USAGE ON *.* TO 'pfsuser'@'localhost' +GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost' +select * from performance_schema.SETUP_INSTRUMENTS; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +connection default; +set global read_only=1; +connection con1; +select @@global.read_only; +@@global.read_only +1 +show grants; +Grants for pfsuser@localhost +GRANT USAGE ON *.* TO 'pfsuser'@'localhost' +GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost' +select * from performance_schema.SETUP_INSTRUMENTS; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +connection default; +grant super on *.* to pfsuser@localhost; +flush privileges; +connect (con1, localhost, pfsuser, , test); +select @@global.read_only; +@@global.read_only +1 +show grants; +Grants for pfsuser@localhost +GRANT SUPER ON *.* TO 'pfsuser'@'localhost' +GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost' +select * from performance_schema.SETUP_INSTRUMENTS; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +connection default; +set global read_only= @start_read_only; +drop user pfsuser@localhost; +flush privileges; diff --git a/mysql-test/suite/perfschema/r/schema.result b/mysql-test/suite/perfschema/r/schema.result new file mode 100644 index 00000000000..d402df70ed5 --- /dev/null +++ b/mysql-test/suite/perfschema/r/schema.result @@ -0,0 +1,211 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +use performance_schema; +show tables; +Tables_in_performance_schema +COND_INSTANCES +EVENTS_WAITS_CURRENT +EVENTS_WAITS_HISTORY +EVENTS_WAITS_HISTORY_LONG +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +EVENTS_WAITS_SUMMARY_BY_INSTANCE +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +FILE_INSTANCES +FILE_SUMMARY_BY_EVENT_NAME +FILE_SUMMARY_BY_INSTANCE +MUTEX_INSTANCES +PERFORMANCE_TIMERS +PROCESSLIST +RWLOCK_INSTANCES +SETUP_CONSUMERS +SETUP_INSTRUMENTS +SETUP_OBJECTS +SETUP_TIMERS +show create table COND_INSTANCES; +Table Create Table +COND_INSTANCES CREATE TABLE `COND_INSTANCES` ( + `NAME` varchar(128) NOT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table EVENTS_WAITS_CURRENT; +Table Create Table +EVENTS_WAITS_CURRENT CREATE TABLE `EVENTS_WAITS_CURRENT` ( + `THREAD_ID` int(11) NOT NULL, + `EVENT_ID` bigint(20) unsigned NOT NULL, + `EVENT_NAME` varchar(128) NOT NULL, + `SOURCE` varchar(64) DEFAULT NULL, + `TIMER_START` bigint(20) unsigned DEFAULT NULL, + `TIMER_END` bigint(20) unsigned DEFAULT NULL, + `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL, + `SPINS` int(10) unsigned DEFAULT NULL, + `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, + `OBJECT_NAME` varchar(512) DEFAULT NULL, + `OBJECT_TYPE` varchar(64) DEFAULT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL, + `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL, + `OPERATION` varchar(16) NOT NULL, + `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL, + `FLAGS` int(10) unsigned DEFAULT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table EVENTS_WAITS_HISTORY; +Table Create Table +EVENTS_WAITS_HISTORY CREATE TABLE `EVENTS_WAITS_HISTORY` ( + `THREAD_ID` int(11) NOT NULL, + `EVENT_ID` bigint(20) unsigned NOT NULL, + `EVENT_NAME` varchar(128) NOT NULL, + `SOURCE` varchar(64) DEFAULT NULL, + `TIMER_START` bigint(20) unsigned DEFAULT NULL, + `TIMER_END` bigint(20) unsigned DEFAULT NULL, + `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL, + `SPINS` int(10) unsigned DEFAULT NULL, + `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, + `OBJECT_NAME` varchar(512) DEFAULT NULL, + `OBJECT_TYPE` varchar(64) DEFAULT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL, + `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL, + `OPERATION` varchar(16) NOT NULL, + `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL, + `FLAGS` int(10) unsigned DEFAULT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table EVENTS_WAITS_HISTORY_LONG; +Table Create Table +EVENTS_WAITS_HISTORY_LONG CREATE TABLE `EVENTS_WAITS_HISTORY_LONG` ( + `THREAD_ID` int(11) NOT NULL, + `EVENT_ID` bigint(20) unsigned NOT NULL, + `EVENT_NAME` varchar(128) NOT NULL, + `SOURCE` varchar(64) DEFAULT NULL, + `TIMER_START` bigint(20) unsigned DEFAULT NULL, + `TIMER_END` bigint(20) unsigned DEFAULT NULL, + `TIMER_WAIT` bigint(20) unsigned DEFAULT NULL, + `SPINS` int(10) unsigned DEFAULT NULL, + `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, + `OBJECT_NAME` varchar(512) DEFAULT NULL, + `OBJECT_TYPE` varchar(64) DEFAULT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL, + `NESTING_EVENT_ID` bigint(20) unsigned DEFAULT NULL, + `OPERATION` varchar(16) NOT NULL, + `NUMBER_OF_BYTES` bigint(20) unsigned DEFAULT NULL, + `FLAGS` int(10) unsigned DEFAULT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +Table Create Table +EVENTS_WAITS_SUMMARY_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_EVENT_NAME` ( + `EVENT_NAME` varchar(128) NOT NULL, + `COUNT_STAR` bigint(20) unsigned NOT NULL, + `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE; +Table Create Table +EVENTS_WAITS_SUMMARY_BY_INSTANCE CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_INSTANCE` ( + `EVENT_NAME` varchar(128) NOT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL, + `COUNT_STAR` bigint(20) unsigned NOT NULL, + `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +Table Create Table +EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME CREATE TABLE `EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME` ( + `THREAD_ID` int(11) NOT NULL, + `EVENT_NAME` varchar(128) NOT NULL, + `COUNT_STAR` bigint(20) unsigned NOT NULL, + `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL, + `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table FILE_INSTANCES; +Table Create Table +FILE_INSTANCES CREATE TABLE `FILE_INSTANCES` ( + `FILE_NAME` varchar(512) NOT NULL, + `EVENT_NAME` varchar(128) NOT NULL, + `OPEN_COUNT` int(10) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table FILE_SUMMARY_BY_EVENT_NAME; +Table Create Table +FILE_SUMMARY_BY_EVENT_NAME CREATE TABLE `FILE_SUMMARY_BY_EVENT_NAME` ( + `EVENT_NAME` varchar(128) NOT NULL, + `COUNT_READ` bigint(20) unsigned NOT NULL, + `COUNT_WRITE` bigint(20) unsigned NOT NULL, + `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL, + `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table FILE_SUMMARY_BY_INSTANCE; +Table Create Table +FILE_SUMMARY_BY_INSTANCE CREATE TABLE `FILE_SUMMARY_BY_INSTANCE` ( + `FILE_NAME` varchar(512) NOT NULL, + `EVENT_NAME` varchar(128) NOT NULL, + `COUNT_READ` bigint(20) unsigned NOT NULL, + `COUNT_WRITE` bigint(20) unsigned NOT NULL, + `SUM_NUMBER_OF_BYTES_READ` bigint(20) unsigned NOT NULL, + `SUM_NUMBER_OF_BYTES_WRITE` bigint(20) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table MUTEX_INSTANCES; +Table Create Table +MUTEX_INSTANCES CREATE TABLE `MUTEX_INSTANCES` ( + `NAME` varchar(128) NOT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL, + `LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table PERFORMANCE_TIMERS; +Table Create Table +PERFORMANCE_TIMERS CREATE TABLE `PERFORMANCE_TIMERS` ( + `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL, + `TIMER_FREQUENCY` bigint(20) DEFAULT NULL, + `TIMER_RESOLUTION` bigint(20) DEFAULT NULL, + `TIMER_OVERHEAD` bigint(20) DEFAULT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table PROCESSLIST; +Table Create Table +PROCESSLIST CREATE TABLE `PROCESSLIST` ( + `THREAD_ID` int(11) NOT NULL, + `ID` int(11) NOT NULL, + `NAME` varchar(64) NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table RWLOCK_INSTANCES; +Table Create Table +RWLOCK_INSTANCES CREATE TABLE `RWLOCK_INSTANCES` ( + `NAME` varchar(128) NOT NULL, + `OBJECT_INSTANCE_BEGIN` bigint(20) NOT NULL, + `WRITE_LOCKED_BY_THREAD_ID` int(11) DEFAULT NULL, + `READ_LOCKED_BY_COUNT` int(10) unsigned NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table SETUP_CONSUMERS; +Table Create Table +SETUP_CONSUMERS CREATE TABLE `SETUP_CONSUMERS` ( + `NAME` varchar(64) NOT NULL, + `ENABLED` enum('YES','NO') NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table SETUP_INSTRUMENTS; +Table Create Table +SETUP_INSTRUMENTS CREATE TABLE `SETUP_INSTRUMENTS` ( + `NAME` varchar(128) NOT NULL, + `ENABLED` enum('YES','NO') NOT NULL, + `TIMED` enum('YES','NO') NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table SETUP_OBJECTS; +Table Create Table +SETUP_OBJECTS CREATE TABLE `SETUP_OBJECTS` ( + `OBJECT_TYPE` varchar(64) DEFAULT NULL, + `OBJECT_SCHEMA` varchar(64) DEFAULT NULL, + `OBJECT_NAME` varchar(64) DEFAULT NULL, + `ENABLED` enum('YES','NO') NOT NULL, + `TIMED` enum('YES','NO') NOT NULL, + `AGGREGATED` enum('YES','NO') NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 +show create table SETUP_TIMERS; +Table Create Table +SETUP_TIMERS CREATE TABLE `SETUP_TIMERS` ( + `NAME` varchar(64) NOT NULL, + `TIMER_NAME` enum('CYCLE','NANOSECOND','MICROSECOND','MILLISECOND','TICK') NOT NULL +) ENGINE=PERFORMANCE_SCHEMA DEFAULT CHARSET=utf8 diff --git a/mysql-test/suite/perfschema/r/selects.result b/mysql-test/suite/perfschema/r/selects.result new file mode 100644 index 00000000000..b5bef207303 --- /dev/null +++ b/mysql-test/suite/perfschema/r/selects.result @@ -0,0 +1,97 @@ +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; +INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); +SELECT OPERATION, SUM(NUMBER_OF_BYTES) AS TOTAL +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +GROUP BY OPERATION +HAVING TOTAL IS NOT NULL +ORDER BY OPERATION +LIMIT 1; +OPERATION TOTAL +chsize [NUM_BYTES] +SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE THREAD_ID IN +(SELECT THREAD_ID FROM performance_schema.PROCESSLIST) +AND EVENT_NAME IN +(SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS +WHERE NAME LIKE "wait/synch/%") +LIMIT 1; +EVENT_ID +[EVENT_ID] +SELECT DISTINCT EVENT_ID +FROM performance_schema.EVENTS_WAITS_CURRENT +JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID) +JOIN performance_schema.EVENTS_WAITS_HISTORY_LONG USING (EVENT_ID) +ORDER BY EVENT_ID +LIMIT 1; +EVENT_ID +[EVENT_ID] +SELECT t1.THREAD_ID, t2.EVENT_ID, t3.EVENT_NAME, t4.TIMER_WAIT +FROM performance_schema.EVENTS_WAITS_HISTORY t1 +JOIN performance_schema.EVENTS_WAITS_HISTORY t2 USING (EVENT_ID) +JOIN performance_schema.EVENTS_WAITS_HISTORY t3 ON (t2.THREAD_ID = t3.THREAD_ID) +JOIN performance_schema.EVENTS_WAITS_HISTORY t4 ON (t3.EVENT_NAME = t4.EVENT_NAME) +ORDER BY t1.EVENT_ID, t2.EVENT_ID +LIMIT 5; +THREAD_ID EVENT_ID EVENT_NAME TIMER_WAIT +[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT] +[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT] +[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT] +[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT] +[THREAD_ID] [EVENT_ID] [EVENT_NAME] [TIMER_WAIT] +SELECT THREAD_ID, EVENT_ID FROM ( +SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT +UNION +SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY +UNION +SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +) t1 ORDER BY THREAD_ID, EVENT_ID +LIMIT 5; +THREAD_ID EVENT_ID +[THREAD_ID] [EVENT_ID] +[THREAD_ID] [EVENT_ID] +[THREAD_ID] [EVENT_ID] +[THREAD_ID] [EVENT_ID] +[THREAD_ID] [EVENT_ID] +CREATE EVENT t_ps_event +ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND +DO SELECT DISTINCT EVENT_ID +FROM performance_schema.EVENTS_WAITS_CURRENT +JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID) +ORDER BY EVENT_ID +LIMIT 1; +ALTER TABLE t1 ADD COLUMN c INT; +CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1 +FOR EACH ROW BEGIN +SET NEW.c = (SELECT MAX(EVENT_ID) +FROM performance_schema.EVENTS_WAITS_CURRENT); +END; +| +INSERT INTO t1 (id) VALUES (11), (12), (13); +SELECT id, c FROM t1 WHERE id > 10 ORDER BY c; +id c +11 [EVENT_ID] +12 [EVENT_ID] +13 [EVENT_ID] +DROP TRIGGER t_ps_trigger; +CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT) +BEGIN +SELECT id FROM performance_schema.PROCESSLIST +WHERE THREAD_ID = tid INTO pid; +END; +| +CALL t_ps_proc(0, @p_id); +CREATE FUNCTION t_ps_func(tid INT) RETURNS int +BEGIN +return (SELECT id FROM performance_schema.PROCESSLIST +WHERE THREAD_ID = tid); +END; +| +SELECT t_ps_func(0) = @p_id; +t_ps_func(0) = @p_id +1 +DROP PROCEDURE t_ps_proc; +DROP FUNCTION t_ps_func; +DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/r/server_init.result b/mysql-test/suite/perfschema/r/server_init.result new file mode 100644 index 00000000000..ac340f8eb67 --- /dev/null +++ b/mysql-test/suite/perfschema/r/server_init.result @@ -0,0 +1,233 @@ +use performance_schema; +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_threads"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_malloc"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_open"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_isam"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_heap"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_net"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_charset"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/mysys/THR_LOCK_time"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/mysys/THR_COND_threads"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_mysql_create_db"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_open"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_lock_db"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_thread_count"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_mapped_file"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_status"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_error_log"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_delayed_insert"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_uuid_generator"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_delayed_status"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_delayed_create"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_crypt"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_slave_list"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_active_mi"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_manager"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_global_read_lock"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_global_system_variables"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_user_conn"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_connection_count"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_server_started"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_rpl_status"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOG_INFO::lock"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_event_metadata"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_event_queue"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_user_locks"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/Cversion_lock"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_xid_cache"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_plugin"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/LOCK_gdl"; +count(name) +1 +select count(name) from MUTEX_INSTANCES +where name like "wait/synch/mutex/sql/tz_LOCK"; +count(name) +1 +select count(name) from RWLOCK_INSTANCES +where name like "wait/synch/rwlock/sql/LOCK_grant"; +count(name) +1 +select count(name) from RWLOCK_INSTANCES +where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect"; +count(name) +1 +select count(name) from RWLOCK_INSTANCES +where name like "wait/synch/rwlock/sql/LOCK_sys_init_slave"; +count(name) +1 +select count(name) from RWLOCK_INSTANCES +where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_server_started"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_refresh"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_thread_count"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_manager"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_global_read_lock"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_thread_cache"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_flush_thread_cache"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_rpl_status"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/Event_scheduler::COND_state"; +count(name) +1 +select count(name) from COND_INSTANCES +where name like "wait/synch/cond/sql/COND_queue_state"; +count(name) +1 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_class.result b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result new file mode 100644 index 00000000000..d6089139d5a --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_class.result @@ -0,0 +1,74 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 0 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_cond_classes"; +Variable_name Value +performance_schema_max_cond_classes 0 +select count(*) from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/cond/%"; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_COND_CLASSES_LOST'; +variable_value > 0 +1 +select count(*) from performance_schema.COND_INSTANCES; +count(*) +0 +show status like "performance_schema_cond_instances_lost"; +Variable_name Value +Performance_schema_cond_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result new file mode 100644 index 00000000000..eaa04c7629d --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_cond_inst.result @@ -0,0 +1,77 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 0 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_cond_classes"; +Variable_name Value +performance_schema_max_cond_classes 80 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/cond/%"; +count(*) > 0 +1 +show status like "performance_schema_cond_classes_lost"; +Variable_name Value +Performance_schema_cond_classes_lost 0 +show variables like "performance_schema_max_cond_instances"; +Variable_name Value +performance_schema_max_cond_instances 0 +select count(*) from performance_schema.COND_INSTANCES; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_COND_INSTANCES_LOST'; +variable_value > 0 +1 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_class.result b/mysql-test/suite/perfschema/r/start_server_no_file_class.result new file mode 100644 index 00000000000..d68ec00a456 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_file_class.result @@ -0,0 +1,74 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 0 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_file_classes"; +Variable_name Value +performance_schema_max_file_classes 0 +select count(*) from performance_schema.SETUP_INSTRUMENTS +where name like "wait/io/file/%"; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_FILE_CLASSES_LOST'; +variable_value > 0 +1 +select count(*) from performance_schema.FILE_INSTANCES; +count(*) +0 +show status like "performance_schema_file_instances_lost"; +Variable_name Value +Performance_schema_file_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_file_inst.result b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result new file mode 100644 index 00000000000..258712ebf68 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_file_inst.result @@ -0,0 +1,77 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 0 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_file_classes"; +Variable_name Value +performance_schema_max_file_classes 50 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS +where name like "wait/io/file/%"; +count(*) > 0 +1 +show status like "performance_schema_file_classes_lost"; +Variable_name Value +Performance_schema_file_classes_lost 0 +show variables like "performance_schema_max_file_instances"; +Variable_name Value +performance_schema_max_file_instances 0 +select count(*) from performance_schema.FILE_INSTANCES; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_FILE_INSTANCES_LOST'; +variable_value > 0 +1 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result new file mode 100644 index 00000000000..d221cb2c22a --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_class.result @@ -0,0 +1,74 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 0 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_mutex_classes"; +Variable_name Value +performance_schema_max_mutex_classes 0 +select count(*) from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/mutex/%"; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_CLASSES_LOST'; +variable_value > 0 +1 +select count(*) from performance_schema.MUTEX_INSTANCES; +count(*) +0 +show status like "performance_schema_mutex_instances_lost"; +Variable_name Value +Performance_schema_mutex_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result new file mode 100644 index 00000000000..adfd4c5ec17 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_mutex_inst.result @@ -0,0 +1,77 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 0 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_mutex_classes"; +Variable_name Value +performance_schema_max_mutex_classes 200 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/mutex/%"; +count(*) > 0 +1 +show status like "performance_schema_mutex_classes_lost"; +Variable_name Value +Performance_schema_mutex_classes_lost 0 +show variables like "performance_schema_max_mutex_instances"; +Variable_name Value +performance_schema_max_mutex_instances 0 +select count(*) from performance_schema.MUTEX_INSTANCES; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_INSTANCES_LOST'; +variable_value > 0 +1 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result new file mode 100644 index 00000000000..5248becf0e5 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_class.result @@ -0,0 +1,74 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 0 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_rwlock_classes"; +Variable_name Value +performance_schema_max_rwlock_classes 0 +select count(*) from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/rwlock/%"; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_CLASSES_LOST'; +variable_value > 0 +1 +select count(*) from performance_schema.RWLOCK_INSTANCES; +count(*) +0 +show status like "performance_schema_rwlock_instances_lost"; +Variable_name Value +Performance_schema_rwlock_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result new file mode 100644 index 00000000000..e7a94c4a60d --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_rwlock_inst.result @@ -0,0 +1,77 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 0 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_rwlock_classes"; +Variable_name Value +performance_schema_max_rwlock_classes 20 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS +where name like "wait/synch/rwlock/%"; +count(*) > 0 +1 +show status like "performance_schema_rwlock_classes_lost"; +Variable_name Value +Performance_schema_rwlock_classes_lost 0 +show variables like "performance_schema_max_rwlock_instances"; +Variable_name Value +performance_schema_max_rwlock_instances 0 +select count(*) from performance_schema.RWLOCK_INSTANCES; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_INSTANCES_LOST'; +variable_value > 0 +1 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_class.result b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result new file mode 100644 index 00000000000..92f1ec29b38 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_class.result @@ -0,0 +1,74 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 0 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_thread_classes"; +Variable_name Value +performance_schema_max_thread_classes 0 +select count(*) from performance_schema.SETUP_INSTRUMENTS +where name like "thread/%"; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST'; +variable_value > 0 +1 +select count(*) from performance_schema.PROCESSLIST; +count(*) +0 +show status like "performance_schema_thread_instances_lost"; +Variable_name Value +Performance_schema_thread_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result new file mode 100644 index 00000000000..3ecf7fe98db --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_no_thread_inst.result @@ -0,0 +1,73 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 0 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show variables like "performance_schema_max_thread_classes"; +Variable_name Value +performance_schema_max_thread_classes 50 +show status like "performance_schema_thread_classes_lost"; +Variable_name Value +Performance_schema_thread_classes_lost 0 +show variables like "performance_schema_max_thread_instances"; +Variable_name Value +performance_schema_max_thread_instances 0 +select count(*) from performance_schema.PROCESSLIST; +count(*) +0 +select variable_value > 0 from information_schema.global_status +where variable_name like 'PERFORMANCE_SCHEMA_THREAD_INSTANCES_LOST'; +variable_value > 0 +1 diff --git a/mysql-test/suite/perfschema/r/start_server_off.result b/mysql-test/suite/perfschema/r/start_server_off.result new file mode 100644 index 00000000000..4ce5aa75ce7 --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_off.result @@ -0,0 +1,73 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +0 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema OFF +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show status like "performance_schema%"; +Variable_name Value +Performance_schema_cond_classes_lost 0 +Performance_schema_cond_instances_lost 0 +Performance_schema_file_classes_lost 0 +Performance_schema_file_handles_lost 0 +Performance_schema_file_instances_lost 0 +Performance_schema_locker_lost 0 +Performance_schema_mutex_classes_lost 0 +Performance_schema_mutex_instances_lost 0 +Performance_schema_rwlock_classes_lost 0 +Performance_schema_rwlock_instances_lost 0 +Performance_schema_table_handles_lost 0 +Performance_schema_table_instances_lost 0 +Performance_schema_thread_classes_lost 0 +Performance_schema_thread_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/start_server_on.result b/mysql-test/suite/perfschema/r/start_server_on.result new file mode 100644 index 00000000000..1d9dc731c7b --- /dev/null +++ b/mysql-test/suite/perfschema/r/start_server_on.result @@ -0,0 +1,73 @@ +show databases; +Database +information_schema +mtr +mysql +performance_schema +test +select count(*) from performance_schema.PERFORMANCE_TIMERS; +count(*) +5 +select count(*) from performance_schema.SETUP_CONSUMERS; +count(*) +8 +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; +count(*) > 0 +1 +select count(*) from performance_schema.SETUP_TIMERS; +count(*) +1 +select * from performance_schema.COND_INSTANCES; +select * from performance_schema.EVENTS_WAITS_CURRENT; +select * from performance_schema.EVENTS_WAITS_HISTORY; +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +select * from performance_schema.FILE_INSTANCES; +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE; +select * from performance_schema.MUTEX_INSTANCES; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.PROCESSLIST; +select * from performance_schema.RWLOCK_INSTANCES; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_OBJECTS; +select * from performance_schema.SETUP_TIMERS; +show variables like "performance_schema%"; +Variable_name Value +performance_schema ON +performance_schema_events_waits_history_long_size 10000 +performance_schema_events_waits_history_size 10 +performance_schema_max_cond_classes 80 +performance_schema_max_cond_instances 1000 +performance_schema_max_file_classes 50 +performance_schema_max_file_handles 32768 +performance_schema_max_file_instances 10000 +performance_schema_max_mutex_classes 200 +performance_schema_max_mutex_instances 1000 +performance_schema_max_rwlock_classes 20 +performance_schema_max_rwlock_instances 1000 +performance_schema_max_table_handles 100000 +performance_schema_max_table_instances 50000 +performance_schema_max_thread_classes 50 +performance_schema_max_thread_instances 1000 +show engine PERFORMANCE_SCHEMA status; +show status like "performance_schema%"; +show status like "performance_schema%"; +Variable_name Value +Performance_schema_cond_classes_lost 0 +Performance_schema_cond_instances_lost 0 +Performance_schema_file_classes_lost 0 +Performance_schema_file_handles_lost 0 +Performance_schema_file_instances_lost 0 +Performance_schema_locker_lost 0 +Performance_schema_mutex_classes_lost 0 +Performance_schema_mutex_instances_lost 0 +Performance_schema_rwlock_classes_lost 0 +Performance_schema_rwlock_instances_lost 0 +Performance_schema_table_handles_lost 0 +Performance_schema_table_instances_lost 0 +Performance_schema_thread_classes_lost 0 +Performance_schema_thread_instances_lost 0 diff --git a/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result new file mode 100644 index 00000000000..cdf0029eeb9 --- /dev/null +++ b/mysql-test/suite/perfschema/r/tampered_perfschema_table1.result @@ -0,0 +1,6 @@ +call mtr.add_suppression( +"Column count of mysql.SETUP_INSTRUMENTS is wrong. " +"Expected 4, found 3. The table is probably corrupted"); +select * from performance_schema.SETUP_INSTRUMENTS limit 1; +ERROR HY000: Native table 'performance_schema'.'SETUP_INSTRUMENTS' has the wrong structure +select * from performance_schema.SETUP_CONSUMERS limit 1; diff --git a/mysql-test/suite/perfschema/t/aggregate.test b/mysql-test/suite/perfschema/t/aggregate.test new file mode 100644 index 00000000000..7c01bdd0a4b --- /dev/null +++ b/mysql-test/suite/perfschema/t/aggregate.test @@ -0,0 +1,187 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Verify that statistics aggregated by different criteria are consistent. + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--echo "General cleanup" + +--disable_warnings +drop table if exists t1; +--enable_warnings + +update performance_schema.SETUP_INSTRUMENTS set enabled = 'NO'; +update performance_schema.SETUP_CONSUMERS set enabled = 'NO'; + +# Cleanup statistics +truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME; +truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE; +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; + +# Start recording data +update performance_schema.SETUP_CONSUMERS set enabled = 'YES'; +update performance_schema.SETUP_INSTRUMENTS + set enabled = 'YES', timed = 'YES'; + + +create table t1 ( + id INT PRIMARY KEY, + b CHAR(100) DEFAULT 'initial value') + ENGINE=MyISAM; + +insert into t1 (id) values (1), (2), (3), (4), (5), (6), (7), (8); + +# Stop recording data, so the select below don't add noise. +update performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO'; + +# Helper to debug +set @dump_all=FALSE; + +# Note that in general: +# - COUNT/SUM/MAX(FILE_SUMMARY_BY_EVENT_NAME) >= +# COUNT/SUM/MAX(FILE_SUMMARY_BY_INSTANCE). +# - MIN(FILE_SUMMARY_BY_EVENT_NAME) <= +# MIN(FILE_SUMMARY_BY_INSTANCE). +# There will be equality only when file instances are not removed, +# aka when a file is not deleted from the file system, +# because doing so removes a row in FILE_SUMMARY_BY_INSTANCE. + +# Likewise: +# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) >= +# COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_INSTANCE) +# - MIN(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) <= +# MIN(EVENTS_WAITS_SUMMARY_BY_INSTANCE) +# There will be equality only when an instrument instance +# is not removed, which is next to impossible to predictably guarantee +# in the server. +# For example, a MyISAM table removed from the table cache +# will cause a mysql_mutex_destroy on myisam/MYISAM_SHARE::intern_lock. +# Another example, a thread terminating will cause a mysql_mutex_destroy +# on sql/LOCK_delete +# Both cause a row to be deleted from EVENTS_WAITS_SUMMARY_BY_INSTANCE. + +# Likewise: +# - COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) >= +# COUNT/SUM/MAX(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME) +# - MIN(EVENTS_WAITS_SUMMARY_BY_EVENT_NAME) <= +# MIN(EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME) +# There will be equality only when no thread is removed, +# that is if no thread disconnects, or no sub thread (for example insert +# delayed) ever completes. +# A thread completing will cause rows in +# EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME to be removed. + +--echo "Verifying file aggregate consistency" + +# Since the code generating the load in this test does: +# - create table +# - insert +# - does not cause temporary tables to be used +# we can test for equality here for file aggregates. + +# If any of these queries returns data, the test failed. + +SELECT EVENT_NAME, e.COUNT_READ, SUM(i.COUNT_READ) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.COUNT_READ <> SUM(i.COUNT_READ)) +OR @dump_all; + +SELECT EVENT_NAME, e.COUNT_WRITE, SUM(i.COUNT_WRITE) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.COUNT_WRITE <> SUM(i.COUNT_WRITE)) +OR @dump_all; + +SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_READ, SUM(i.SUM_NUMBER_OF_BYTES_READ) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_NUMBER_OF_BYTES_READ <> SUM(i.SUM_NUMBER_OF_BYTES_READ)) +OR @dump_all; + +SELECT EVENT_NAME, e.SUM_NUMBER_OF_BYTES_WRITE, SUM(i.SUM_NUMBER_OF_BYTES_WRITE) +FROM performance_schema.FILE_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.FILE_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_NUMBER_OF_BYTES_WRITE <> SUM(i.SUM_NUMBER_OF_BYTES_WRITE)) +OR @dump_all; + +--echo "Verifying waits aggregate consistency (instance)" + +SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(i.SUM_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_TIMER_WAIT <> SUM(i.SUM_TIMER_WAIT)) +OR @dump_all; + +SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(i.MIN_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MIN_TIMER_WAIT <> MIN(i.MIN_TIMER_WAIT)) +AND (MIN(i.MIN_TIMER_WAIT) != 0) +OR @dump_all; + +SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(i.MAX_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE AS i USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MAX_TIMER_WAIT <> MAX(i.MAX_TIMER_WAIT)) +OR @dump_all; + +--echo "Verifying waits aggregate consistency (thread)" + +SELECT EVENT_NAME, e.SUM_TIMER_WAIT, SUM(t.SUM_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t +USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.SUM_TIMER_WAIT <> SUM(t.SUM_TIMER_WAIT)) +OR @dump_all; + +SELECT EVENT_NAME, e.MIN_TIMER_WAIT, MIN(t.MIN_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t +USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MIN_TIMER_WAIT <> MIN(t.MIN_TIMER_WAIT)) +AND (MIN(t.MIN_TIMER_WAIT) != 0) +OR @dump_all; + +SELECT EVENT_NAME, e.MAX_TIMER_WAIT, MAX(t.MAX_TIMER_WAIT) +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME AS e +JOIN performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME AS t +USING (EVENT_NAME) +GROUP BY EVENT_NAME +HAVING (e.MAX_TIMER_WAIT <> MAX(t.MAX_TIMER_WAIT)) +OR @dump_all; + + +# Cleanup + +update performance_schema.SETUP_CONSUMERS set enabled = 'YES'; +update performance_schema.SETUP_INSTRUMENTS + set enabled = 'YES', timed = 'YES'; + +drop table test.t1; diff --git a/mysql-test/suite/perfschema/t/bad_option_1.test b/mysql-test/suite/perfschema/t/bad_option_1.test new file mode 100644 index 00000000000..9962f327093 --- /dev/null +++ b/mysql-test/suite/perfschema/t/bad_option_1.test @@ -0,0 +1,45 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Check error handling for invalid server start options + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--error 7 +--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-enabled=maybe > $MYSQLTEST_VARDIR/tmp/bad_option_1.txt 2>&1 + +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_1.txt"; + open(FILE, "<", $fname) or die; + my @lines= ; + # those must be in the file for the test to pass + my @patterns= + ("unknown variable 'performance-schema-enabled=maybe'", + "Aborting"); + foreach my $one_line (@lines) + { + foreach my $one_pattern (@patterns) + { + # print pattern, not line, to get a stable output + print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/); + } + } + close FILE; +EOF + diff --git a/mysql-test/suite/perfschema/t/bad_option_2.test b/mysql-test/suite/perfschema/t/bad_option_2.test new file mode 100644 index 00000000000..a8d15764864 --- /dev/null +++ b/mysql-test/suite/perfschema/t/bad_option_2.test @@ -0,0 +1,44 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Check error handling for ambiguous server start options + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--error 3 +--exec $MYSQLD_BOOTSTRAP_CMD --loose-console --performance-schema-max_=12 > $MYSQLTEST_VARDIR/tmp/bad_option_2.txt 2>&1 + +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/bad_option_2.txt"; + open(FILE, "<", $fname) or die; + my @lines= ; + # those must be in the file for the test to pass + my @patterns= + ("ambiguous option '--performance-schema-max_=12'"); + foreach my $one_line (@lines) + { + foreach my $one_pattern (@patterns) + { + # print pattern, not line, to get a stable output + print "Found: $one_pattern\n" if ($one_line =~ /$one_pattern/); + } + } + close FILE; +EOF + diff --git a/mysql-test/suite/perfschema/t/binlog_mix.test b/mysql-test/suite/perfschema/t/binlog_mix.test new file mode 100644 index 00000000000..4fe7d68b555 --- /dev/null +++ b/mysql-test/suite/perfschema/t/binlog_mix.test @@ -0,0 +1,28 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/have_log_bin.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# See Bug#46896 binlog: case sensitivity of table names +--source include/have_lowercase0.inc + +set binlog_format=mixed; + +--source ../include/binlog_common.inc + diff --git a/mysql-test/suite/perfschema/t/binlog_row.test b/mysql-test/suite/perfschema/t/binlog_row.test new file mode 100644 index 00000000000..c1c1e06d3f0 --- /dev/null +++ b/mysql-test/suite/perfschema/t/binlog_row.test @@ -0,0 +1,28 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/have_log_bin.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# See Bug#46896 binlog: case sensitivity of table names +--source include/have_lowercase0.inc + +set binlog_format=row; + +--source ../include/binlog_common.inc + diff --git a/mysql-test/suite/perfschema/t/binlog_stmt.test b/mysql-test/suite/perfschema/t/binlog_stmt.test new file mode 100644 index 00000000000..759c34634c8 --- /dev/null +++ b/mysql-test/suite/perfschema/t/binlog_stmt.test @@ -0,0 +1,25 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/have_log_bin.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc + +set binlog_format=statement; + +--source ../include/binlog_common.inc + diff --git a/mysql-test/suite/perfschema/t/cnf_option.cnf b/mysql-test/suite/perfschema/t/cnf_option.cnf new file mode 100644 index 00000000000..2892908fbb6 --- /dev/null +++ b/mysql-test/suite/perfschema/t/cnf_option.cnf @@ -0,0 +1,25 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Check server start options, read from a .cnf file + +# Use default setting for mysqld processes +!include include/default_mysqld.cnf + +[mysqld.1] +loose-performance-schema-max-thread_instances=318 +loose-performance-schema-max-thread_classes=12 + diff --git a/mysql-test/suite/perfschema/t/cnf_option.test b/mysql-test/suite/perfschema/t/cnf_option.test new file mode 100644 index 00000000000..c968307ee00 --- /dev/null +++ b/mysql-test/suite/perfschema/t/cnf_option.test @@ -0,0 +1,24 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Check server start options, read from a .cnf file + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +show variables like 'performance_schema_max_thread_classes'; +show variables like 'performance_schema_max_thread_instances'; + diff --git a/mysql-test/suite/perfschema/t/column_privilege.test b/mysql-test/suite/perfschema/t/column_privilege.test new file mode 100644 index 00000000000..b6bcbdb3396 --- /dev/null +++ b/mysql-test/suite/perfschema/t/column_privilege.test @@ -0,0 +1,82 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Test how columns privileges can be used on performance schema tables, +# for very fine control. + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +show grants; + +grant usage on *.* to 'pfs_user_5'@localhost with GRANT OPTION; + +# Test per column privileges on performance_schema + +grant SELECT(thread_id, event_id) on performance_schema.EVENTS_WAITS_CURRENT + to 'pfs_user_5'@localhost; + +grant UPDATE(enabled) on performance_schema.SETUP_INSTRUMENTS + to 'pfs_user_5'@localhost; + +flush privileges; + +connect (con1, localhost, pfs_user_5, , ); + +# Commented because the result is not consistent (uppercase/lowercase) +# show grants; + +# For statements that works, we do not look at the output +--disable_result_log + +select thread_id from performance_schema.EVENTS_WAITS_CURRENT; + +select thread_id, event_id from performance_schema.EVENTS_WAITS_CURRENT; + +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; + +--enable_result_log + +# For statements that are denied, check the error number and error text. + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_COLUMNACCESS_DENIED_ERROR +select event_name from performance_schema.EVENTS_WAITS_CURRENT; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_COLUMNACCESS_DENIED_ERROR +select thread_id, event_id, event_name + from performance_schema.EVENTS_WAITS_CURRENT; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_COLUMNACCESS_DENIED_ERROR +update performance_schema.SETUP_INSTRUMENTS set name='illegal'; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_COLUMNACCESS_DENIED_ERROR +update performance_schema.SETUP_INSTRUMENTS set timed='NO'; + +# Cleanup + +--connection default +--disconnect con1 +REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost; +DROP USER 'pfs_user_5'@localhost; +flush privileges; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE'; + diff --git a/mysql-test/suite/perfschema/t/ddl_cond_instances.test b/mysql-test/suite/perfschema/t/ddl_cond_instances.test new file mode 100644 index 00000000000..e78429cb181 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_cond_instances.test @@ -0,0 +1,32 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.COND_INSTANCES add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.COND_INSTANCES; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.COND_INSTANCES ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.COND_INSTANCES(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_events_waits_current.test b/mysql-test/suite/perfschema/t/ddl_events_waits_current.test new file mode 100644 index 00000000000..34f735c1271 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_events_waits_current.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.EVENTS_WAITS_CURRENT add column foo integer; + +truncate table performance_schema.EVENTS_WAITS_CURRENT; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.EVENTS_WAITS_CURRENT ADD INDEX test_index(EVENT_ID); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_CURRENT(EVENT_ID); + diff --git a/mysql-test/suite/perfschema/t/ddl_events_waits_history.test b/mysql-test/suite/perfschema/t/ddl_events_waits_history.test new file mode 100644 index 00000000000..76ebe3d85c4 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_events_waits_history.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.EVENTS_WAITS_HISTORY add column foo integer; + +truncate table performance_schema.EVENTS_WAITS_HISTORY; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY ADD INDEX test_index(EVENT_ID); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY(EVENT_ID); + diff --git a/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test b/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test new file mode 100644 index 00000000000..549c5d6880b --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_events_waits_history_long.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.EVENTS_WAITS_HISTORY_LONG add column foo integer; + +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG ADD INDEX test_index(EVENT_ID); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_HISTORY_LONG(EVENT_ID); + diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test new file mode 100644 index 00000000000..fbf2d2925a7 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_ews_by_event_name.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME add column foo integer; + +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(EVENT_NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME(EVENT_NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test b/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test new file mode 100644 index 00000000000..e6dad07fd63 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_ews_by_instance.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE add column foo integer; + +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE ADD INDEX test_index(EVENT_NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE(EVENT_NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test new file mode 100644 index 00000000000..5b65ec26064 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_ews_by_thread_by_event_name.test @@ -0,0 +1,33 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + add column foo integer; + +truncate table performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME ADD INDEX test_index(THREAD_ID); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index + ON performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME(THREAD_ID); + diff --git a/mysql-test/suite/perfschema/t/ddl_file_instances.test b/mysql-test/suite/perfschema/t/ddl_file_instances.test new file mode 100644 index 00000000000..a9c9a2a95b6 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_file_instances.test @@ -0,0 +1,32 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.FILE_INSTANCES add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.FILE_INSTANCES; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.FILE_INSTANCES ADD INDEX test_index(FILE_NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.FILE_INSTANCES(FILE_NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test b/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test new file mode 100644 index 00000000000..2581f07c0d2 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_fs_by_event_name.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.FILE_SUMMARY_BY_EVENT_NAME add column foo integer; + +truncate table performance_schema.FILE_SUMMARY_BY_EVENT_NAME; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_EVENT_NAME(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test b/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test new file mode 100644 index 00000000000..e06ad2eb7cd --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_fs_by_instance.test @@ -0,0 +1,31 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.FILE_SUMMARY_BY_INSTANCE add column foo integer; + +truncate table performance_schema.FILE_SUMMARY_BY_INSTANCE; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.FILE_SUMMARY_BY_INSTANCE(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_mutex_instances.test b/mysql-test/suite/perfschema/t/ddl_mutex_instances.test new file mode 100644 index 00000000000..6489a689620 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_mutex_instances.test @@ -0,0 +1,32 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.MUTEX_INSTANCES add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.MUTEX_INSTANCES; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.MUTEX_INSTANCES ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.MUTEX_INSTANCES(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_performance_timers.test b/mysql-test/suite/perfschema/t/ddl_performance_timers.test new file mode 100644 index 00000000000..b692291b8cf --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_performance_timers.test @@ -0,0 +1,32 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.PERFORMANCE_TIMERS add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.PERFORMANCE_TIMERS; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.PERFORMANCE_TIMERS ADD INDEX test_index(TIMER_NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.PERFORMANCE_TIMERS(TIMER_NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_processlist.test b/mysql-test/suite/perfschema/t/ddl_processlist.test new file mode 100644 index 00000000000..fb133b66e26 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_processlist.test @@ -0,0 +1,32 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.PROCESSLIST add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.PROCESSLIST; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.PROCESSLIST ADD INDEX test_index(ID); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.PROCESSLIST(ID); + diff --git a/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test b/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test new file mode 100644 index 00000000000..c07cd1ede48 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_rwlock_instances.test @@ -0,0 +1,32 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.RWLOCK_INSTANCES add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.RWLOCK_INSTANCES; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.RWLOCK_INSTANCES ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.RWLOCK_INSTANCES(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_setup_consumers.test b/mysql-test/suite/perfschema/t/ddl_setup_consumers.test new file mode 100644 index 00000000000..c44db822145 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_setup_consumers.test @@ -0,0 +1,33 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.SETUP_CONSUMERS add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.SETUP_CONSUMERS; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.SETUP_CONSUMERS ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_CONSUMERS(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_setup_instruments.test b/mysql-test/suite/perfschema/t/ddl_setup_instruments.test new file mode 100644 index 00000000000..c20c386447c --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_setup_instruments.test @@ -0,0 +1,33 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.SETUP_INSTRUMENTS add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.SETUP_INSTRUMENTS; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.SETUP_INSTRUMENTS ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_INSTRUMENTS(NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_setup_objects.test b/mysql-test/suite/perfschema/t/ddl_setup_objects.test new file mode 100644 index 00000000000..6ae6156ef00 --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_setup_objects.test @@ -0,0 +1,32 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_result '\'setup_objects' '\'SETUP_OBJECTS' +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.SETUP_OBJECTS add column foo integer; + +truncate table performance_schema.SETUP_OBJECTS; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.SETUP_OBJECTS ADD INDEX test_index(OBJECT_NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_OBJECTS(OBJECT_NAME); + diff --git a/mysql-test/suite/perfschema/t/ddl_setup_timers.test b/mysql-test/suite/perfschema/t/ddl_setup_timers.test new file mode 100644 index 00000000000..b9a5c32ecbe --- /dev/null +++ b/mysql-test/suite/perfschema/t/ddl_setup_timers.test @@ -0,0 +1,33 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_result '\'setup_timers' '\'SETUP_TIMERS' +-- error ER_DBACCESS_DENIED_ERROR +alter table performance_schema.SETUP_TIMERS add column foo integer; + +-- error ER_WRONG_PERFSCHEMA_USAGE +truncate table performance_schema.SETUP_TIMERS; + +-- error ER_DBACCESS_DENIED_ERROR +ALTER TABLE performance_schema.SETUP_TIMERS ADD INDEX test_index(NAME); + +-- error ER_DBACCESS_DENIED_ERROR +CREATE UNIQUE INDEX test_index ON performance_schema.SETUP_TIMERS(NAME); + diff --git a/mysql-test/suite/perfschema/t/disabled.def b/mysql-test/suite/perfschema/t/disabled.def new file mode 100644 index 00000000000..56bcf811ff6 --- /dev/null +++ b/mysql-test/suite/perfschema/t/disabled.def @@ -0,0 +1,27 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +############################################################################## +# +# List the test cases that are to be disabled temporarily. +# +# Separate the test case name and the comment with ':'. +# +# : BUG# +# +# Do not use any TAB characters for whitespace. +# +############################################################################## + diff --git a/mysql-test/suite/perfschema/t/dml_cond_instances.test b/mysql-test/suite/perfschema/t/dml_cond_instances.test new file mode 100644 index 00000000000..1d1614db73f --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_cond_instances.test @@ -0,0 +1,55 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # +select * from performance_schema.COND_INSTANCES limit 1; + +select * from performance_schema.COND_INSTANCES + where name='FOO'; + +--replace_result '\'cond_instances' '\'COND_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.COND_INSTANCES + set name='FOO', object_instance_begin=12; + +--replace_result '\'cond_instances' '\'COND_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.COND_INSTANCES + set name='FOO'; + +--replace_result '\'cond_instances' '\'COND_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.COND_INSTANCES + where name like "wait/%"; + +--replace_result '\'cond_instances' '\'COND_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.COND_INSTANCES; + +--replace_result '\'cond_instances' '\'COND_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.COND_INSTANCES READ; +UNLOCK TABLES; + +--replace_result '\'cond_instances' '\'COND_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.COND_INSTANCES WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_current.test b/mysql-test/suite/perfschema/t/dml_events_waits_current.test new file mode 100644 index 00000000000..3a93b98cb57 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_events_waits_current.test @@ -0,0 +1,62 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_CURRENT + where event_name like 'Wait/Synch/%' limit 1; + +select * from performance_schema.EVENTS_WAITS_CURRENT + where event_name='FOO'; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_CURRENT + set thread_id='1', event_id=1, + event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_CURRENT + set timer_start=12; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_CURRENT + set timer_start=12 where thread_id=0; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_CURRENT + where thread_id=1; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_CURRENT; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT READ; +UNLOCK TABLES; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_CURRENT WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history.test b/mysql-test/suite/perfschema/t/dml_events_waits_history.test new file mode 100644 index 00000000000..174ef2147d1 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_events_waits_history.test @@ -0,0 +1,70 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_HISTORY + where event_name like 'Wait/Synch/%' limit 1; + +select * from performance_schema.EVENTS_WAITS_HISTORY + where event_name='FOO'; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_HISTORY + where event_name like 'Wait/Synch/%' order by timer_wait limit 1; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_HISTORY + where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_HISTORY + set thread_id='1', event_id=1, + event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_HISTORY + set timer_start=12; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_HISTORY + set timer_start=12 where thread_id=0; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_HISTORY + where thread_id=1; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_HISTORY; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY READ; +UNLOCK TABLES; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test new file mode 100644 index 00000000000..73dc0aefd06 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_events_waits_history_long.test @@ -0,0 +1,70 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG + where event_name like 'Wait/Synch/%' limit 1; + +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG + where event_name='FOO'; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG + where event_name like 'Wait/Synch/%' order by timer_wait limit 1; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 12 # 14 # +select * from performance_schema.EVENTS_WAITS_HISTORY_LONG + where event_name like 'Wait/Synch/%' order by timer_wait desc limit 1; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_HISTORY_LONG + set thread_id='1', event_id=1, + event_name='FOO', timer_start=1, timer_end=2, timer_wait=3; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_HISTORY_LONG + set timer_start=12; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_HISTORY_LONG + set timer_start=12 where thread_id=0; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_HISTORY_LONG + where thread_id=1; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_HISTORY_LONG; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG READ; +UNLOCK TABLES; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_HISTORY_LONG WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_event_name.test new file mode 100644 index 00000000000..c1fddbe9f87 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_ews_by_event_name.test @@ -0,0 +1,62 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + where event_name like 'Wait/Synch/%' limit 1; + +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + where event_name='FOO'; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + set event_name='FOO', count_star=1, sum_timer_wait=2, min_timer_wait=3, + avg_timer_wait=4, max_timer_wait=5; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + set count_star=12; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + set count_star=12 where event_name like "FOO"; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + where count_star=1; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME READ; +UNLOCK TABLES; + +--replace_result '\'events_waits_summary_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_EVENT_NAME' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_instance.test b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test new file mode 100644 index 00000000000..4c386313bc5 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_ews_by_instance.test @@ -0,0 +1,79 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + where event_name like 'Wait/Synch/%' limit 1; + +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + where event_name='FOO'; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + order by count_star limit 1; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + order by count_star desc limit 1; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + where min_timer_wait > 0 order by count_star limit 1; + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + where min_timer_wait > 0 order by count_star desc limit 1; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + set event_name='FOO', object_instance_begin=0, + count_star=1, sum_timer_wait=2, min_timer_wait=3, + avg_timer_wait=4, max_timer_wait=5; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + set count_star=12; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + set count_star=12 where event_name like "FOO"; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE + where count_star=1; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE READ; +UNLOCK TABLES; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test new file mode 100644 index 00000000000..ce29e59d014 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_ews_by_thread_by_event_name.test @@ -0,0 +1,63 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + where event_name like 'Wait/Synch/%' limit 1; + +select * from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + where event_name='FOO'; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + set event_name='FOO', thread_id=1, + count_star=1, sum_timer_wait=2, min_timer_wait=3, + avg_timer_wait=4, max_timer_wait=5; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + set count_star=12; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + set count_star=12 where event_name like "FOO"; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME + where count_star=1; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME READ; +UNLOCK TABLES; + +--replace_result '\'events_waits_summary_by_thread_by_event_name' '\'EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_file_instances.test b/mysql-test/suite/perfschema/t/dml_file_instances.test new file mode 100644 index 00000000000..71a053c21be --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_file_instances.test @@ -0,0 +1,55 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # +select * from performance_schema.FILE_INSTANCES limit 1; + +select * from performance_schema.FILE_INSTANCES + where file_name='FOO'; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.FILE_INSTANCES + set file_name='FOO', event_name='BAR', open_count=12; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.FILE_INSTANCES + set file_name='FOO'; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_INSTANCES + where event_name like "wait/%"; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_INSTANCES; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.FILE_INSTANCES READ; +UNLOCK TABLES; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.FILE_INSTANCES WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test b/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test new file mode 100644 index 00000000000..3753f581560 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_file_summary_by_event_name.test @@ -0,0 +1,62 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME + where event_name like 'Wait/io/%' limit 1; + +select * from performance_schema.FILE_SUMMARY_BY_EVENT_NAME + where event_name='FOO'; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.FILE_SUMMARY_BY_EVENT_NAME + set event_name='FOO', count_read=1, count_write=2, + sum_number_of_bytes_read=4, sum_number_of_bytes_write=5; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.FILE_SUMMARY_BY_EVENT_NAME + set count_read=12; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.FILE_SUMMARY_BY_EVENT_NAME + set count_write=12 where event_name like "FOO"; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME + where count_read=1; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_SUMMARY_BY_EVENT_NAME; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME READ; +UNLOCK TABLES; + +--replace_result '\'file_summary_by_event_name' '\'FILE_SUMMARY_BY_EVENT_NAME' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.FILE_SUMMARY_BY_EVENT_NAME WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test b/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test new file mode 100644 index 00000000000..07372af5f36 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_file_summary_by_instance.test @@ -0,0 +1,62 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # 4 # 5 # 6 # +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE + where event_name like 'Wait/io/%' limit 1; + +select * from performance_schema.FILE_SUMMARY_BY_INSTANCE + where event_name='FOO'; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.FILE_SUMMARY_BY_INSTANCE + set event_name='FOO', count_read=1, count_write=2, + sum_number_of_bytes_read=4, sum_number_of_bytes_write=5; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.FILE_SUMMARY_BY_INSTANCE + set count_read=12; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.FILE_SUMMARY_BY_INSTANCE + set count_write=12 where event_name like "FOO"; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_SUMMARY_BY_INSTANCE + where count_read=1; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.FILE_SUMMARY_BY_INSTANCE; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE READ; +UNLOCK TABLES; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.FILE_SUMMARY_BY_INSTANCE WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_mutex_instances.test b/mysql-test/suite/perfschema/t/dml_mutex_instances.test new file mode 100644 index 00000000000..e3062c7b34c --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_mutex_instances.test @@ -0,0 +1,55 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # +select * from performance_schema.MUTEX_INSTANCES limit 1; + +select * from performance_schema.MUTEX_INSTANCES + where name='FOO'; + +--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.MUTEX_INSTANCES + set name='FOO', object_instance_begin=12; + +--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.MUTEX_INSTANCES + set name='FOO'; + +--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.MUTEX_INSTANCES + where name like "wait/%"; + +--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.MUTEX_INSTANCES; + +--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.MUTEX_INSTANCES READ; +UNLOCK TABLES; + +--replace_result '\'mutex_instances' '\'MUTEX_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.MUTEX_INSTANCES WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_performance_timers.test b/mysql-test/suite/perfschema/t/dml_performance_timers.test new file mode 100644 index 00000000000..9c2efb6f709 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_performance_timers.test @@ -0,0 +1,57 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 2 3 4 +select * from performance_schema.PERFORMANCE_TIMERS; + +--replace_column 2 3 4 +select * from performance_schema.PERFORMANCE_TIMERS + where timer_name='CYCLE'; + +--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.PERFORMANCE_TIMERS + set timer_name='FOO', timer_frequency=1, + timer_resolution=2, timer_overhead=3; + +--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.PERFORMANCE_TIMERS + set timer_frequency=12 where timer_name='CYCLE'; + +--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.PERFORMANCE_TIMERS; + +--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.PERFORMANCE_TIMERS + where timer_name='CYCLE'; + +--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.PERFORMANCE_TIMERS READ; +UNLOCK TABLES; + +--replace_result '\'performance_timers' '\'PERFORMANCE_TIMERS' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.PERFORMANCE_TIMERS WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_processlist.test b/mysql-test/suite/perfschema/t/dml_processlist.test new file mode 100644 index 00000000000..6062b8481f0 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_processlist.test @@ -0,0 +1,61 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # 3 # +select * from performance_schema.PROCESSLIST + where name like 'Thread/%' limit 1; + +select * from performance_schema.PROCESSLIST + where name='FOO'; + +--replace_result '\'processlist' '\'PROCESSLIST' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.PROCESSLIST + set name='FOO', thread_id=1, id=2; + +--replace_result '\'processlist' '\'PROCESSLIST' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.PROCESSLIST + set thread_id=12; + +--replace_result '\'processlist' '\'PROCESSLIST' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.PROCESSLIST + set thread_id=12 where name like "FOO"; + +--replace_result '\'processlist' '\'PROCESSLIST' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.PROCESSLIST + where id=1; + +--replace_result '\'processlist' '\'PROCESSLIST' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.PROCESSLIST; + +--replace_result '\'processlist' '\'PROCESSLIST' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.PROCESSLIST READ; +UNLOCK TABLES; + +--replace_result '\'processlist' '\'PROCESSLIST' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.PROCESSLIST WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_rwlock_instances.test b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test new file mode 100644 index 00000000000..251168237eb --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_rwlock_instances.test @@ -0,0 +1,55 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--replace_column 1 # 2 # +select * from performance_schema.RWLOCK_INSTANCES limit 1; + +select * from performance_schema.RWLOCK_INSTANCES + where name='FOO'; + +--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.RWLOCK_INSTANCES + set name='FOO', object_instance_begin=12; + +--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +update performance_schema.RWLOCK_INSTANCES + set name='FOO'; + +--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.RWLOCK_INSTANCES + where name like "wait/%"; + +--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.RWLOCK_INSTANCES; + +--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.RWLOCK_INSTANCES READ; +UNLOCK TABLES; + +--replace_result '\'rwlock_instances' '\'RWLOCK_INSTANCES' +-- error ER_TABLEACCESS_DENIED_ERROR +LOCK TABLES performance_schema.RWLOCK_INSTANCES WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_setup_consumers.test b/mysql-test/suite/perfschema/t/dml_setup_consumers.test new file mode 100644 index 00000000000..85b65864f91 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_setup_consumers.test @@ -0,0 +1,59 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +select * from performance_schema.SETUP_CONSUMERS; + +select * from performance_schema.SETUP_CONSUMERS + where name='events_waits_current'; + +select * from performance_schema.SETUP_CONSUMERS + where enabled='YES'; + +select * from performance_schema.SETUP_CONSUMERS + where enabled='NO'; + +--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.SETUP_CONSUMERS + set name='FOO', enabled='YES'; + +--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' +--error ER_WRONG_PERFSCHEMA_USAGE +update performance_schema.SETUP_CONSUMERS + set name='FOO'; + +update performance_schema.SETUP_CONSUMERS + set enabled='YES'; + +--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_CONSUMERS; + +--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_CONSUMERS + where name='events_waits_current'; + +LOCK TABLES performance_schema.SETUP_CONSUMERS READ; +UNLOCK TABLES; + +LOCK TABLES performance_schema.SETUP_CONSUMERS WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_setup_instruments.test b/mysql-test/suite/perfschema/t/dml_setup_instruments.test new file mode 100644 index 00000000000..f737160cebd --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_setup_instruments.test @@ -0,0 +1,100 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# The query result are not re producible, +# due to variations in platforms and plugins +# We still execute the select statement, for: +# - code coverage +# - make sure it does not crash +# - valgrind coverage + +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +--enable_result_log + +# DEBUG_SYNC::mutex is dependent on the build (DEBUG only) + +select * from performance_schema.SETUP_INSTRUMENTS + where name like 'Wait/Synch/Mutex/sql/%' + and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex') + order by name limit 10; + +select * from performance_schema.SETUP_INSTRUMENTS + where name like 'Wait/Synch/Rwlock/sql/%' + order by name limit 10; + +# COND_handler_count is dependent on the build (Windows only) +# DEBUG_SYNC::cond is dependent on the build (DEBUG only) + +select * from performance_schema.SETUP_INSTRUMENTS + where name like 'Wait/Synch/Cond/sql/%' + and name not in ( + 'wait/synch/cond/sql/COND_handler_count', + 'wait/synch/cond/sql/DEBUG_SYNC::cond') + order by name limit 10; + +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS + where name='Wait'; +--enable_result_log + +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS + where enabled='YES'; +--enable_result_log + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.SETUP_INSTRUMENTS + set name='FOO', enabled='YES', timed='YES'; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_WRONG_PERFSCHEMA_USAGE +update performance_schema.SETUP_INSTRUMENTS + set name='FOO'; + +update performance_schema.SETUP_INSTRUMENTS + set enabled='NO'; + +update performance_schema.SETUP_INSTRUMENTS + set timed='NO'; + +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +--enable_result_log + +update performance_schema.SETUP_INSTRUMENTS + set enabled='YES', timed='YES'; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_INSTRUMENTS; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_INSTRUMENTS + where name like 'Wait/Synch/%'; + +LOCK TABLES performance_schema.SETUP_INSTRUMENTS READ; +UNLOCK TABLES; + +LOCK TABLES performance_schema.SETUP_INSTRUMENTS WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_setup_objects.test b/mysql-test/suite/perfschema/t/dml_setup_objects.test new file mode 100644 index 00000000000..21fac64d924 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_setup_objects.test @@ -0,0 +1,75 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +select * from performance_schema.SETUP_OBJECTS; + +select * from performance_schema.SETUP_OBJECTS + where object_type = 'TABLE'; + +select * from performance_schema.SETUP_OBJECTS + where enabled='YES'; + +# Not implemented yet +--replace_result '\'setup_objects' '\'SETUP_OBJECTS' +--error ER_ILLEGAL_HA +insert into performance_schema.SETUP_OBJECTS + set object_type='TABLE', object_schema='FOO', object_name='BAR', + enabled='YES', timed='YES', aggregated='YES'; + +# Not implemented yet +# --error ER_ILLEGAL_HA +update performance_schema.SETUP_OBJECTS + set object_type='TABLE'; + +# Not implemented yet +# --error ER_ILLEGAL_HA +update performance_schema.SETUP_OBJECTS + set object_schema='ILLEGAL'; + +# Not implemented yet +# --error ER_ILLEGAL_HA +update performance_schema.SETUP_OBJECTS + set object_name='ILLEGAL'; + +update performance_schema.SETUP_OBJECTS + set enabled='NO'; + +update performance_schema.SETUP_OBJECTS + set timed='NO'; + +update performance_schema.SETUP_OBJECTS + set aggregated='NO'; + +select * from performance_schema.SETUP_OBJECTS; + +update performance_schema.SETUP_OBJECTS + set enabled='YES', timed='YES', aggregated='YES'; + +delete from performance_schema.SETUP_OBJECTS + where object_type = 'TABLE'; + +delete from performance_schema.SETUP_OBJECTS; + +LOCK TABLES performance_schema.SETUP_OBJECTS READ; +UNLOCK TABLES; + +LOCK TABLES performance_schema.SETUP_OBJECTS WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/dml_setup_timers.test b/mysql-test/suite/perfschema/t/dml_setup_timers.test new file mode 100644 index 00000000000..5b5850db575 --- /dev/null +++ b/mysql-test/suite/perfschema/t/dml_setup_timers.test @@ -0,0 +1,61 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +select * from performance_schema.SETUP_TIMERS; + +select * from performance_schema.SETUP_TIMERS + where name='Wait'; + +select * from performance_schema.SETUP_TIMERS + where timer_name='CYCLE'; + +--replace_result '\'setup_timers' '\'SETUP_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +insert into performance_schema.SETUP_TIMERS + set name='FOO', timer_name='CYCLE'; + +--replace_result '\'setup_timers' '\'SETUP_TIMERS' +--error ER_WRONG_PERFSCHEMA_USAGE +update performance_schema.SETUP_TIMERS + set name='FOO'; + +update performance_schema.SETUP_TIMERS + set timer_name='MILLISECOND'; + +select * from performance_schema.SETUP_TIMERS; + +update performance_schema.SETUP_TIMERS + set timer_name='CYCLE'; + +--replace_result '\'setup_timers' '\'SETUP_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_TIMERS; + +--replace_result '\'setup_timers' '\'SETUP_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +delete from performance_schema.SETUP_TIMERS + where name='Wait'; + +LOCK TABLES performance_schema.SETUP_TIMERS READ; +UNLOCK TABLES; + +LOCK TABLES performance_schema.SETUP_TIMERS WRITE; +UNLOCK TABLES; + diff --git a/mysql-test/suite/perfschema/t/func_file_io.test b/mysql-test/suite/perfschema/t/func_file_io.test new file mode 100644 index 00000000000..4317f68d13b --- /dev/null +++ b/mysql-test/suite/perfschema/t/func_file_io.test @@ -0,0 +1,192 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +## +## WL#4814, 4.1.4 FILE IO +## +## Functional testing of File IO +## + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/io/file/%'; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# TODO: Change to InnoDB when it gets instrumentation +# + +CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; + +INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +# +# FF1: Count for file should increase with instrumentation enabled and +# FF2: Count for file should not increase with instrumentation disabled +# + +SELECT * FROM t1 WHERE id = 1; + +SET @before_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') + AND (OBJECT_NAME LIKE '%t1.MYD')); + +SELECT IF(@before_count > 0, 'Success', 'Failure') has_instrumentation; + +SELECT * FROM t1 WHERE id < 4; + +SET @after_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') + AND (OBJECT_NAME LIKE '%t1.MYD') AND (1 = 1)); + +SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_ff1_timed; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled='NO'; + +SET @before_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') + AND (OBJECT_NAME LIKE '%t1.MYD') AND (2 = 2)); + +SELECT * FROM t1 WHERE id < 6; + +SET @after_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/io/file/myisam/dfile') + AND (OBJECT_NAME LIKE '%t1.MYD') AND (3 = 3)); + +SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_ff2_timed; + +# +# Check not timed measurements +# + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/io/file/%'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'NO'; + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +SELECT * FROM t1 WHERE id > 4; + +SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +WHERE TIMER_WAIT != NULL + OR TIMER_START != NULL + OR TIMER_END != NULL; + +SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY +WHERE TIMER_WAIT != NULL + OR TIMER_START != NULL + OR TIMER_END != NULL; + +SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE TIMER_WAIT != NULL + OR TIMER_START != NULL + OR TIMER_END != NULL; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET timed = 'YES'; + +SELECT * FROM t1 WHERE id < 4; + +DROP TABLE t1; + +# +# FF4: Use-case from Enterprise Monitor +# + +--disable_result_log +SELECT SUM(COUNT_READ) AS sum_count_read, + SUM(COUNT_WRITE) AS sum_count_write, + SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read, + SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write +FROM performance_schema.FILE_SUMMARY_BY_INSTANCE +WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL; +--enable_result_log + +# +# FF5: Troubleshooting tasks +# +# These queries will give different results based on timing, +# but at least they should not crash. +# + +# +# Total and average wait time for different events on system level +# +--disable_result_log +SELECT EVENT_NAME, COUNT_STAR, AVG_TIMER_WAIT, SUM_TIMER_WAIT +FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +WHERE COUNT_STAR > 0 +ORDER BY SUM_TIMER_WAIT DESC +LIMIT 10; +--enable_result_log + +# +# Total and average wait time for different users +# + +--disable_result_log +SELECT i.user, SUM(TIMER_WAIT) SUM_WAIT +# ((TIME_TO_SEC(TIMEDIFF(NOW(), i.startup_time)) * 1000) / SUM(TIMER_WAIT)) * 100 WAIT_PERCENTAGE +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h +INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID) +LEFT JOIN information_schema.PROCESSLIST i USING (ID) +GROUP BY i.user +ORDER BY SUM_WAIT DESC +LIMIT 20; +--enable_result_log + +# +# Total and average wait times for different events for a session +# +--disable_result_log +SELECT h.EVENT_NAME, SUM(h.TIMER_WAIT) TOTAL_WAIT +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h +INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID) +WHERE p.ID = 1 +GROUP BY h.EVENT_NAME +HAVING TOTAL_WAIT > 0; +--enable_result_log + +# +# Which user reads and writes data +# + +--disable_result_log +SELECT i.user, h.operation, SUM(NUMBER_OF_BYTES) bytes +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG h +INNER JOIN performance_schema.PROCESSLIST p USING (THREAD_ID) +LEFT JOIN information_schema.PROCESSLIST i USING (ID) +GROUP BY i.user, h.operation +HAVING BYTES > 0 +ORDER BY i.user, h.operation; +--enable_result_log diff --git a/mysql-test/suite/perfschema/t/func_mutex.test b/mysql-test/suite/perfschema/t/func_mutex.test new file mode 100644 index 00000000000..98cb905c67c --- /dev/null +++ b/mysql-test/suite/perfschema/t/func_mutex.test @@ -0,0 +1,131 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +## +## WL#4818, 4.1.3 MUTEXES, RW-LOCKS, ... +## +## Functional testing of mutexes and RW-locks +## + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/synch/mutex/%' + OR name LIKE 'wait/synch/rwlock/%'; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings + +# +# TODO: Change to InnoDB when it gets instrumentation +# + +CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; + +INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); + +# +# FM1: Count for mutex should increase with instrumentation enabled and +# FM2: Count for mutex should not increase with instrumentation disabled +# + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +SELECT * FROM t1 WHERE id = 1; + +SET @before_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); + +SELECT * FROM t1; + +SET @after_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); + +SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_timed; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO' +WHERE NAME = 'wait/synch/mutex/sql/LOCK_open'; + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +SELECT * FROM t1 WHERE id = 1; + +SET @before_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); + +SELECT * FROM t1; + +SET @after_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/mutex/sql/LOCK_open')); + +SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_timed; + +# +# Repeat for RW-lock +# + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +SELECT * FROM t1 WHERE id = 1; + +SET @before_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + +SELECT * FROM t1; + +SET @after_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + +SELECT IF((@after_count - @before_count) > 0, 'Success', 'Failure') test_fm1_rw_timed; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO' +WHERE NAME = 'wait/synch/rwlock/sql/LOCK_grant'; + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +SELECT * FROM t1 WHERE id = 1; + +SET @before_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + +SELECT * FROM t1; + +SET @after_count = (SELECT SUM(TIMER_WAIT) + FROM performance_schema.EVENTS_WAITS_HISTORY_LONG + WHERE (EVENT_NAME = 'wait/synch/rwlock/sql/LOCK_grant')); + +SELECT IF((COALESCE(@after_count, 0) - COALESCE(@before_count, 0)) = 0, 'Success', 'Failure') test_fm2_rw_timed; + +DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/t/global_read_lock.test b/mysql-test/suite/perfschema/t/global_read_lock.test new file mode 100644 index 00000000000..16971023cbb --- /dev/null +++ b/mysql-test/suite/perfschema/t/global_read_lock.test @@ -0,0 +1,90 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# +# Test the effect of a flush tables with read lock on SETUP_ tables. + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +use performance_schema; + +grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost; +flush privileges; + +--echo connect (con1, localhost, pfsuser, , test); +connect (con1, localhost, pfsuser, , test); + +lock tables performance_schema.SETUP_INSTRUMENTS read; +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +--enable_result_log +unlock tables; + +lock tables performance_schema.SETUP_INSTRUMENTS write; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +unlock tables; + +--echo connection default; +connection default; + +flush tables with read lock; + +--echo connection con1; +connection con1; + +lock tables performance_schema.SETUP_INSTRUMENTS read; +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +--enable_result_log +unlock tables; + +# This will block +--send +lock tables performance_schema.SETUP_INSTRUMENTS write; + +--echo connection default; +connection default; + +let $wait_condition= select 1 from performance_schema.EVENTS_WAITS_CURRENT where event_name like "wait/synch/cond/sql/COND_global_read_lock"; + +--source include/wait_condition.inc + +# Observe the blocked thread in the performance schema :) +select event_name, + left(source, locate(":", source)) as short_source, + timer_end, timer_wait, operation + from performance_schema.EVENTS_WAITS_CURRENT + where event_name like "wait/synch/cond/sql/COND_global_read_lock"; + +unlock tables; + +connection con1; +--reap + +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +unlock tables; + +disconnect con1; + +--echo connection default; +connection default; + +drop user pfsuser@localhost; +flush privileges; + diff --git a/mysql-test/suite/perfschema/t/information_schema.test b/mysql-test/suite/perfschema/t/information_schema.test new file mode 100644 index 00000000000..3d2822a1db3 --- /dev/null +++ b/mysql-test/suite/perfschema/t/information_schema.test @@ -0,0 +1,67 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# Several selects so the output is readable + +# Note that TABLE_NAME is in uppercase is some platforms, +# and in lowercase in others. +# Using upper(TABLE_NAME) to have consistent results. + +select TABLE_SCHEMA, upper(TABLE_NAME), TABLE_CATALOG + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), TABLE_TYPE, ENGINE + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), VERSION, ROW_FORMAT + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), TABLE_ROWS, AVG_ROW_LENGTH + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), DATA_LENGTH, MAX_DATA_LENGTH + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), INDEX_LENGTH, DATA_FREE, AUTO_INCREMENT + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), CREATE_TIME, UPDATE_TIME, CHECK_TIME + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), TABLE_COLLATION, CHECKSUM + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + +# TABLESPACE_NAME does not exist in 5.4 +# select upper(TABLE_NAME), CREATE_OPTIONS, TABLESPACE_NAME +# from information_schema.tables +# where TABLE_SCHEMA='performance_schema'; + +select upper(TABLE_NAME), TABLE_COMMENT + from information_schema.tables + where TABLE_SCHEMA='performance_schema'; + diff --git a/mysql-test/suite/perfschema/t/misc.test b/mysql-test/suite/perfschema/t/misc.test new file mode 100644 index 00000000000..d9b97d8441e --- /dev/null +++ b/mysql-test/suite/perfschema/t/misc.test @@ -0,0 +1,57 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# Miscelaneous + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# Bug#45496 Performance schema: assertion fails in +# ha_perfschema::rnd_init:223 +# + +--disable_result_log +SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE THREAD_ID IN + (SELECT THREAD_ID FROM performance_schema.PROCESSLIST) +AND EVENT_NAME IN + (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS + WHERE NAME LIKE "wait/synch/%") +LIMIT 1; +--enable_result_log + +# +# Bug#45088 Should not be able to create tables of engine PERFORMANCE_SCHEMA +# + +--error ER_WRONG_PERFSCHEMA_USAGE +create table test.t1(a int) engine=performance_schema; + +# +# Bug#44897 Performance Schema: can create a ghost table in another database +# + +--error ER_WRONG_PERFSCHEMA_USAGE +create table test.t1 like performance_schema.EVENTS_WAITS_CURRENT; + +# +# Bug#44898 PerformanceSchema: can create a table in db performance_schema, cannot insert +# + +--error ER_TABLEACCESS_DENIED_ERROR +create table performance_schema.t1(a int); + diff --git a/mysql-test/suite/perfschema/t/myisam_file_io.opt b/mysql-test/suite/perfschema/t/myisam_file_io.opt new file mode 100644 index 00000000000..f2e233bd4ab --- /dev/null +++ b/mysql-test/suite/perfschema/t/myisam_file_io.opt @@ -0,0 +1 @@ +--performance_schema_events_waits_history_long_size=5000 diff --git a/mysql-test/suite/perfschema/t/myisam_file_io.test b/mysql-test/suite/perfschema/t/myisam_file_io.test new file mode 100644 index 00000000000..53d2ea6dbe6 --- /dev/null +++ b/mysql-test/suite/perfschema/t/myisam_file_io.test @@ -0,0 +1,63 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# Setup + +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/io/file/myisam/%"; + +update performance_schema.SETUP_CONSUMERS + set enabled='YES'; + +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; + +# Code to test + +--disable_warnings +drop table if exists test.no_index_tab; +--enable_warnings + +create table test.no_index_tab ( a varchar(255), b int ) engine=myisam; +insert into no_index_tab set a = 'foo', b = 1; +insert into no_index_tab set a = 'foo', b = 1; +insert into no_index_tab set a = 'foo', b = 1; + +# Verification +# Note that mi_create.c contains mysql_file_tell() calls in debug only, +# so the result are filtered to remove 'tell'. + +select event_name, + left(source, locate(":", source)) as short_source, + operation, number_of_bytes, + substring(object_name, locate("no_index_tab", object_name)) as short_name + from performance_schema.EVENTS_WAITS_HISTORY_LONG + where operation not like "tell" + order by thread_id, event_id; + +# In case of failures, this will tell if file io are lost. +show status like 'performance_schema_%'; + +# Cleanup + +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; + +drop table test.no_index_tab; + diff --git a/mysql-test/suite/perfschema/t/no_threads-master.opt b/mysql-test/suite/perfschema/t/no_threads-master.opt new file mode 100644 index 00000000000..b15ab02821d --- /dev/null +++ b/mysql-test/suite/perfschema/t/no_threads-master.opt @@ -0,0 +1 @@ +--one-thread --thread-handling=no-threads --loose-performance-schema-max-thread_instances=10 diff --git a/mysql-test/suite/perfschema/t/no_threads.test b/mysql-test/suite/perfschema/t/no_threads.test new file mode 100644 index 00000000000..3d3f712e364 --- /dev/null +++ b/mysql-test/suite/perfschema/t/no_threads.test @@ -0,0 +1,69 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + + +# Setup : in this main thread + +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_CONSUMERS set enabled='YES'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; + +--disable_warnings +drop table if exists test.t1; +--enable_warnings + +truncate table performance_schema.EVENTS_WAITS_CURRENT; +truncate table performance_schema.EVENTS_WAITS_HISTORY; +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; + +show variables like "thread_handling"; + +# Code to test : in this main thread + +create table test.t1(a int) engine=MYISAM; + +show variables like "performance_schema"; +show variables like "performance_schema_max_thread%"; + +# Verification : in this main thread + +select count(*) from performance_schema.PROCESSLIST + where name like "thread/sql/main"; + +select count(*) from performance_schema.PROCESSLIST + where name like "thread/sql/OneConnection"; + +select event_name, operation, + left(source, locate(":", source)) as short_source + from performance_schema.EVENTS_WAITS_CURRENT; + +select event_name, operation, + left(source, locate(":", source)) as short_source + from performance_schema.EVENTS_WAITS_HISTORY; + +select event_name, operation, + left(source, locate(":", source)) as short_source + from performance_schema.EVENTS_WAITS_HISTORY_LONG; + +# Cleanup + +drop table test.t1; + diff --git a/mysql-test/suite/perfschema/t/one_thread_per_con-master.opt b/mysql-test/suite/perfschema/t/one_thread_per_con-master.opt new file mode 100644 index 00000000000..d6685208673 --- /dev/null +++ b/mysql-test/suite/perfschema/t/one_thread_per_con-master.opt @@ -0,0 +1 @@ +--thread_handling=one-thread-per-connection diff --git a/mysql-test/suite/perfschema/t/one_thread_per_con.test b/mysql-test/suite/perfschema/t/one_thread_per_con.test new file mode 100644 index 00000000000..7d0daffe228 --- /dev/null +++ b/mysql-test/suite/perfschema/t/one_thread_per_con.test @@ -0,0 +1,94 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# Setup + +--source ../include/setup_helper.inc + +# We use a myisam table here because CREATE TABLE has a known, +# stable behavior (it will lock THR_LOCK_myisam once). +# The point is not to test myisam, but to test that each +# connection is properly instrumented, with one-thread-per-connection + +update performance_schema.SETUP_INSTRUMENTS set enabled='YES' + where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; + +--disable_warnings +drop table if exists test.t1; +drop table if exists test.t2; +drop table if exists test.t3; +--enable_warnings + +truncate table performance_schema.EVENTS_WAITS_HISTORY_LONG; + +show variables like "thread_handling"; + +# Code to test + +connection con1; + +-- echo "----------------- Connection 1" +create table test.t1(a int) engine=MYISAM; + +connection con2; + +-- echo "----------------- Connection 2" +create table test.t2(a int) engine=MYISAM; + +connection con3; + +-- echo "----------------- Connection 3" +create table test.t3(a int) engine=MYISAM; + +# Verification + +connection default; + +-- echo "----------------- Connection default" + +--disable_query_log +eval set @tid= $con1_THREAD_ID; +--enable_query_log + +execute stmt_dump_events using @tid; +execute stmt_dump_thread using @tid; + +--disable_query_log +eval set @tid= $con2_THREAD_ID; +--enable_query_log + +execute stmt_dump_events using @tid; +execute stmt_dump_thread using @tid; + +--disable_query_log +eval set @tid= $con3_THREAD_ID; +--enable_query_log + +execute stmt_dump_events using @tid; +execute stmt_dump_thread using @tid; + +# Cleanup + +drop table test.t1; +drop table test.t2; +drop table test.t3; + +--source ../include/cleanup_helper.inc + diff --git a/mysql-test/suite/perfschema/t/pool_of_threads-master.opt b/mysql-test/suite/perfschema/t/pool_of_threads-master.opt new file mode 100644 index 00000000000..75a5cd77203 --- /dev/null +++ b/mysql-test/suite/perfschema/t/pool_of_threads-master.opt @@ -0,0 +1 @@ +--loose-pool-of-threads diff --git a/mysql-test/suite/perfschema/t/privilege.test b/mysql-test/suite/perfschema/t/privilege.test new file mode 100644 index 00000000000..d2f3c2a9e6b --- /dev/null +++ b/mysql-test/suite/perfschema/t/privilege.test @@ -0,0 +1,362 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +show grants; + +grant ALL on *.* to 'pfs_user_1'@localhost with GRANT OPTION; + +# Test denied privileges on performance_schema.* + +--error ER_DBACCESS_DENIED_ERROR +grant ALL on performance_schema.* to 'pfs_user_2'@localhost + with GRANT OPTION; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant CREATE on performance_schema.* to 'pfs_user_2'@localhost; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant DROP on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant REFERENCES on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant INDEX on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant ALTER on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant CREATE TEMPORARY TABLES on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant EXECUTE on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant CREATE VIEW on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant SHOW VIEW on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant CREATE ROUTINE on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant ALTER ROUTINE on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant EVENT on performance_schema.* to 'pfs_user_2'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant TRIGGER on performance_schema.* to 'pfs_user_2'@localhost; + +# Test allowed privileges on performance_schema.* + +grant SELECT on performance_schema.* to 'pfs_user_2'@localhost; +grant INSERT on performance_schema.* to 'pfs_user_2'@localhost; +grant UPDATE on performance_schema.* to 'pfs_user_2'@localhost; +grant DELETE on performance_schema.* to 'pfs_user_2'@localhost; +grant LOCK TABLES on performance_schema.* to 'pfs_user_2'@localhost; + +# Test denied privileges on specific performance_schema tables. +# SETUP_INSTRUMENT : example of PFS_updatable_acl +# EVENTS_WAITS_CURRENT : example of PFS_truncatable_acl +# FILE_INSTANCES : example of PFS_readonly_acl + +--error ER_DBACCESS_DENIED_ERROR +grant ALL on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost + with GRANT OPTION; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant CREATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant DROP on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant REFERENCES on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant INDEX on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant ALTER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant CREATE VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant SHOW VIEW on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant TRIGGER on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +grant INSERT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +grant DELETE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost; + +grant SELECT on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost + with GRANT OPTION; + +grant UPDATE on performance_schema.SETUP_INSTRUMENTS to 'pfs_user_3'@localhost + with GRANT OPTION; + +--error ER_DBACCESS_DENIED_ERROR +grant ALL on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost + with GRANT OPTION; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant CREATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant DROP on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant REFERENCES on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant INDEX on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant ALTER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant CREATE VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant SHOW VIEW on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant TRIGGER on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +grant INSERT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +grant UPDATE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +grant DELETE on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost; + +grant SELECT on performance_schema.EVENTS_WAITS_CURRENT to 'pfs_user_3'@localhost + with GRANT OPTION; + +--error ER_DBACCESS_DENIED_ERROR +grant ALL on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost + with GRANT OPTION; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant CREATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +# will be ER_DBACCESS_DENIED_ERROR once .FRM are removed +grant DROP on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant REFERENCES on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant INDEX on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant ALTER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant CREATE VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant SHOW VIEW on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--error ER_DBACCESS_DENIED_ERROR +grant TRIGGER on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +grant INSERT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +grant UPDATE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +--replace_result '\'file_instances' '\'FILE_INSTANCES' +--error ER_TABLEACCESS_DENIED_ERROR +grant DELETE on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost; + +grant SELECT on performance_schema.FILE_INSTANCES to 'pfs_user_3'@localhost + with GRANT OPTION; + +# See bug#45354 LOCK TABLES is not a TABLE privilege +grant LOCK TABLES on performance_schema.* to 'pfs_user_3'@localhost + with GRANT OPTION; + +flush privileges; + +--source ../include/privilege.inc + +connect (con1, localhost, pfs_user_1, , ); + +--source ../include/privilege.inc + +--disconnect con1 + +connect (con2, localhost, pfs_user_2, , ); + +--source ../include/privilege.inc + +--disconnect con2 + +connect (con3, localhost, pfs_user_3, , ); + +--source ../include/privilege.inc + +--disconnect con3 + +--connection default + +revoke all privileges, grant option from 'pfs_user_1'@localhost; +revoke all privileges, grant option from 'pfs_user_2'@localhost; +revoke all privileges, grant option from 'pfs_user_3'@localhost; +drop user 'pfs_user_1'@localhost; +drop user 'pfs_user_2'@localhost; +drop user 'pfs_user_3'@localhost; +flush privileges; + +--echo # Test cases from WL#4818 +--echo # Setup user + +CREATE user pfs_user_4; +--connect (pfs_user_4, localhost, pfs_user_4, , ) + +--echo # +--echo # WL#4818, NFS4: Normal user does not have access to view data +--echo # without grants +--echo # + +--connection pfs_user_4 +--echo # Select as pfs_user_4 should fail without grant + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +SELECT event_id FROM performance_schema.EVENTS_WAITS_HISTORY_LONG; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +SELECT event_id FROM performance_schema.EVENTS_WAITS_CURRENT; + +--replace_result '\'events_waits_summary_by_instance' '\'EVENTS_WAITS_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +SELECT event_name FROM performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE; + +--replace_result '\'file_summary_by_instance' '\'FILE_SUMMARY_BY_INSTANCE' +--error ER_TABLEACCESS_DENIED_ERROR +SELECT event_name FROM performance_schema.FILE_SUMMARY_BY_INSTANCE; + +--echo # +--echo # WL#4818, NFS3: Normal user does not have access to change what is +--echo # instrumented without grants +--echo # + +--connection pfs_user_4 +--echo # User pfs_user_4 should not be allowed to tweak instrumentation without +--echo # explicit grant + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; + +--replace_result '\'setup_instruments' '\'SETUP_INSTRUMENTS' +--error ER_TABLEACCESS_DENIED_ERROR +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/synch/mutex/%' + OR name LIKE 'wait/synch/rwlock/%'; + +--replace_result '\'setup_consumers' '\'SETUP_CONSUMERS' +--error ER_TABLEACCESS_DENIED_ERROR +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; + +--replace_result '\'setup_timers' '\'SETUP_TIMERS' +--error ER_TABLEACCESS_DENIED_ERROR +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK'; + +--replace_result '\'events_waits_history_long' '\'EVENTS_WAITS_HISTORY_LONG' +--error ER_TABLEACCESS_DENIED_ERROR +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; + +--replace_result '\'events_waits_history' '\'EVENTS_WAITS_HISTORY' +--error ER_TABLEACCESS_DENIED_ERROR +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; + +--replace_result '\'events_waits_current' '\'EVENTS_WAITS_CURRENT' +--error ER_TABLEACCESS_DENIED_ERROR +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +--echo # +--echo # WL#4814, NFS1: Can use grants to give normal user access +--echo # to turn on and off instrumentation +--echo # + +--connection default +--echo # Grant access to change tables with the root account + +GRANT UPDATE ON performance_schema.SETUP_CONSUMERS TO pfs_user_4; +GRANT UPDATE ON performance_schema.SETUP_TIMERS TO pfs_user_4; +GRANT UPDATE, SELECT ON performance_schema.SETUP_INSTRUMENTS TO pfs_user_4; +GRANT DROP ON performance_schema.EVENTS_WAITS_CURRENT TO pfs_user_4; +GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY TO pfs_user_4; +GRANT DROP ON performance_schema.EVENTS_WAITS_HISTORY_LONG TO pfs_user_4; + +--connection pfs_user_4 +--echo # User pfs_user_4 should now be allowed to tweak instrumentation + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'NO', timed = 'YES'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES' +WHERE name LIKE 'wait/synch/mutex/%' + OR name LIKE 'wait/synch/rwlock/%'; + +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; + +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'TICK'; + +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_HISTORY; +TRUNCATE TABLE performance_schema.EVENTS_WAITS_CURRENT; + +--echo # Clean up + +--connection default +--disconnect pfs_user_4 +REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4; +DROP USER pfs_user_4; +flush privileges; +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; +UPDATE performance_schema.SETUP_CONSUMERS SET enabled = 'YES'; +UPDATE performance_schema.SETUP_TIMERS SET timer_name = 'CYCLE'; + diff --git a/mysql-test/suite/perfschema/t/query_cache.test b/mysql-test/suite/perfschema/t/query_cache.test new file mode 100644 index 00000000000..a50b3b99650 --- /dev/null +++ b/mysql-test/suite/perfschema/t/query_cache.test @@ -0,0 +1,68 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +# This test verifies that performance schema tables, because they contain +# data that is volatile, are never cached in the query cache. + +--source include/have_query_cache.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +create table t1 (a int not null); +insert into t1 values (1), (2), (3); + +SET GLOBAL query_cache_size=1355776; + +flush query cache; +reset query cache; + +select * from t1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; + +select * from t1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; + +select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1; + +select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; + +select spins from performance_schema.EVENTS_WAITS_CURRENT order by event_name limit 1; + +select name from performance_schema.SETUP_INSTRUMENTS order by name limit 1; + +show status like "Qcache_queries_in_cache"; +show status like "Qcache_inserts"; +show status like "Qcache_hits"; + +SET GLOBAL query_cache_size= default; + +drop table t1; + diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test new file mode 100644 index 00000000000..62631fa048f --- /dev/null +++ b/mysql-test/suite/perfschema/t/read_only.test @@ -0,0 +1,96 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA +# +# Check that +# - a regular user can not update SETUP_ tables under --read-only +# - a user with SUPER privileges cam + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +use performance_schema; + +set @start_read_only= @@global.read_only; + +grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost; +flush privileges; + +--echo connect (con1, localhost, pfsuser, , test); +connect (con1, localhost, pfsuser, , test); + +--echo connection default; +connection default; + +set global read_only=0; + +--echo connection con1; +connection con1; + +select @@global.read_only; +show grants; +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +--enable_result_log + +--echo connection default; +connection default; + +set global read_only=1; + +--echo connection con1; +connection con1; + +select @@global.read_only; +show grants; +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +--error ER_OPTION_PREVENTS_STATEMENT +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +--error ER_OPTION_PREVENTS_STATEMENT +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +--enable_result_log + +--echo connection default; +connection default; + +grant super on *.* to pfsuser@localhost; +flush privileges; + +disconnect con1; +--echo connect (con1, localhost, pfsuser, , test); +connect (con1, localhost, pfsuser, , test); + +select @@global.read_only; +show grants; +--disable_result_log +select * from performance_schema.SETUP_INSTRUMENTS; +update performance_schema.SETUP_INSTRUMENTS set enabled='NO'; +update performance_schema.SETUP_INSTRUMENTS set enabled='YES'; +--enable_result_log + +disconnect con1; + +--echo connection default; +connection default; + +set global read_only= @start_read_only; + +drop user pfsuser@localhost; +flush privileges; + diff --git a/mysql-test/suite/perfschema/t/schema.test b/mysql-test/suite/perfschema/t/schema.test new file mode 100644 index 00000000000..d13c399a97b --- /dev/null +++ b/mysql-test/suite/perfschema/t/schema.test @@ -0,0 +1,46 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc +--source include/have_lowercase0.inc + +show databases; + +use performance_schema; + +show tables; + +show create table COND_INSTANCES; +show create table EVENTS_WAITS_CURRENT; +show create table EVENTS_WAITS_HISTORY; +show create table EVENTS_WAITS_HISTORY_LONG; +show create table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME; +show create table EVENTS_WAITS_SUMMARY_BY_INSTANCE; +show create table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME; +show create table FILE_INSTANCES; +show create table FILE_SUMMARY_BY_EVENT_NAME; +show create table FILE_SUMMARY_BY_INSTANCE; +show create table MUTEX_INSTANCES; +show create table PERFORMANCE_TIMERS; +show create table PROCESSLIST; +show create table RWLOCK_INSTANCES; +show create table SETUP_CONSUMERS; +show create table SETUP_INSTRUMENTS; +show create table SETUP_OBJECTS; +show create table SETUP_TIMERS; + diff --git a/mysql-test/suite/perfschema/t/selects.test b/mysql-test/suite/perfschema/t/selects.test new file mode 100644 index 00000000000..d5268e8465c --- /dev/null +++ b/mysql-test/suite/perfschema/t/selects.test @@ -0,0 +1,156 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# +# WL#4814, 4.1.2 STORAGE ENGINE, FSE8: Selects +# + +# Make some data that we can work on: + +UPDATE performance_schema.SETUP_INSTRUMENTS SET enabled = 'YES', timed = 'YES'; + +--disable_warnings +DROP TABLE IF EXISTS t1; +--enable_warnings +CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') +ENGINE=MyISAM; +INSERT INTO t1 (id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); + +# ORDER BY, GROUP BY and HAVING + +--replace_column 2 [NUM_BYTES] +SELECT OPERATION, SUM(NUMBER_OF_BYTES) AS TOTAL +FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +GROUP BY OPERATION +HAVING TOTAL IS NOT NULL +ORDER BY OPERATION +LIMIT 1; + +# Sub SELECT +--replace_column 1 [EVENT_ID] +SELECT EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE THREAD_ID IN + (SELECT THREAD_ID FROM performance_schema.PROCESSLIST) +AND EVENT_NAME IN + (SELECT NAME FROM performance_schema.SETUP_INSTRUMENTS + WHERE NAME LIKE "wait/synch/%") +LIMIT 1; + +# JOIN + +--replace_column 1 [EVENT_ID] +SELECT DISTINCT EVENT_ID +FROM performance_schema.EVENTS_WAITS_CURRENT +JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID) +JOIN performance_schema.EVENTS_WAITS_HISTORY_LONG USING (EVENT_ID) +ORDER BY EVENT_ID +LIMIT 1; + +# Self JOIN + +--replace_column 1 [THREAD_ID] 2 [EVENT_ID] 3 [EVENT_NAME] 4 [TIMER_WAIT] +SELECT t1.THREAD_ID, t2.EVENT_ID, t3.EVENT_NAME, t4.TIMER_WAIT +FROM performance_schema.EVENTS_WAITS_HISTORY t1 +JOIN performance_schema.EVENTS_WAITS_HISTORY t2 USING (EVENT_ID) +JOIN performance_schema.EVENTS_WAITS_HISTORY t3 ON (t2.THREAD_ID = t3.THREAD_ID) +JOIN performance_schema.EVENTS_WAITS_HISTORY t4 ON (t3.EVENT_NAME = t4.EVENT_NAME) +ORDER BY t1.EVENT_ID, t2.EVENT_ID +LIMIT 5; + +# UNION +--replace_column 1 [THREAD_ID] 2 [EVENT_ID] +SELECT THREAD_ID, EVENT_ID FROM ( +SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_CURRENT +UNION +SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY +UNION +SELECT THREAD_ID, EVENT_ID FROM performance_schema.EVENTS_WAITS_HISTORY_LONG +) t1 ORDER BY THREAD_ID, EVENT_ID +LIMIT 5; + +# EVENT + +CREATE EVENT t_ps_event +ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND +DO SELECT DISTINCT EVENT_ID + FROM performance_schema.EVENTS_WAITS_CURRENT + JOIN performance_schema.EVENTS_WAITS_HISTORY USING (EVENT_ID) + ORDER BY EVENT_ID + LIMIT 1; + +--sleep 2 + +# TRIGGER + +ALTER TABLE t1 ADD COLUMN c INT; + +delimiter |; + +CREATE TRIGGER t_ps_trigger BEFORE INSERT ON t1 + FOR EACH ROW BEGIN + SET NEW.c = (SELECT MAX(EVENT_ID) + FROM performance_schema.EVENTS_WAITS_CURRENT); + END; +| + +delimiter ;| + +INSERT INTO t1 (id) VALUES (11), (12), (13); + +--replace_column 2 [EVENT_ID] +SELECT id, c FROM t1 WHERE id > 10 ORDER BY c; + +DROP TRIGGER t_ps_trigger; + +# PROCEDURE + +delimiter |; + +CREATE PROCEDURE t_ps_proc(IN tid INT, OUT pid INT) +BEGIN + SELECT id FROM performance_schema.PROCESSLIST + WHERE THREAD_ID = tid INTO pid; +END; + +| + +delimiter ;| + +CALL t_ps_proc(0, @p_id); + +# FUNCTION + +delimiter |; + +CREATE FUNCTION t_ps_func(tid INT) RETURNS int +BEGIN + return (SELECT id FROM performance_schema.PROCESSLIST + WHERE THREAD_ID = tid); +END; + +| + +delimiter ;| + +SELECT t_ps_func(0) = @p_id; + +DROP PROCEDURE t_ps_proc; +DROP FUNCTION t_ps_func; + +# Clean up +DROP TABLE t1; diff --git a/mysql-test/suite/perfschema/t/server_init.test b/mysql-test/suite/perfschema/t/server_init.test new file mode 100644 index 00000000000..cd9357cce67 --- /dev/null +++ b/mysql-test/suite/perfschema/t/server_init.test @@ -0,0 +1,263 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# This test verifies that the mysys and server instruments are properly +# initialized and recorded by the performance schema during the bootstrap +# sequence in mysqld main(). +# Note that some globals mutexes/rwlocks/conds that depend on #ifdef options +# or runtime options are not tested here, to have a predictable result. + +use performance_schema; + +# Verify that these global mutexes have been properly initilized in mysys + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_threads"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_malloc"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_open"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_isam"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_myisam"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/mysys/THR_LOCK_myisam_log"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_heap"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_net"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_charset"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/mysys/THR_LOCK_time"; + +# There are no global rwlock in mysys + +# Verify that these global conditions have been properly initilized in mysys + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/mysys/THR_COND_threads"; + +# Verify that these global mutexes have been properly initilized in sql + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_mysql_create_db"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_open"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_lock_db"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_thread_count"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_mapped_file"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_status"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_error_log"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_delayed_insert"; + +# Named LOCK_uuid_short in 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/LOCK_uuid_short"; + +# Named LOCK_uuid_generator in 5.5, LOCK_uuid_short in 6.0 +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_uuid_generator"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_delayed_status"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_delayed_create"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_crypt"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_slave_list"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_active_mi"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_manager"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_global_read_lock"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_global_system_variables"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_user_conn"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_prepared_stmt_count"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_connection_count"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_server_started"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_rpl_status"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOG_INFO::lock"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/Query_cache::structure_guard_mutex"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/Event_scheduler::LOCK_scheduler_state"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_event_metadata"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_event_queue"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_user_locks"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/LOCK_mdl"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/Cversion_lock"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/LOCK_audit_mask"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_xid_cache"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_plugin"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/LOCK_gdl"; + +select count(name) from MUTEX_INSTANCES + where name like "wait/synch/mutex/sql/tz_LOCK"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/slave_start"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML_active"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from MUTEX_INSTANCES +# where name like "wait/synch/mutex/sql/BML_class::THR_LOCK_BML_get"; + +# Verify that these global rwlocks have been properly initilized in sql + +select count(name) from RWLOCK_INSTANCES + where name like "wait/synch/rwlock/sql/LOCK_grant"; + +select count(name) from RWLOCK_INSTANCES + where name like "wait/synch/rwlock/sql/LOCK_sys_init_connect"; + +select count(name) from RWLOCK_INSTANCES + where name like "wait/synch/rwlock/sql/LOCK_sys_init_slave"; + +select count(name) from RWLOCK_INSTANCES + where name like "wait/synch/rwlock/sql/LOCK_system_variables_hash"; + +# Verify that these global conditions have been properly initilized in sql + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_server_started"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_refresh"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_thread_count"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_manager"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_global_read_lock"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_thread_cache"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_flush_thread_cache"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_rpl_status"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/Query_cache::COND_cache_status_changed"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/Event_scheduler::COND_state"; + +select count(name) from COND_INSTANCES + where name like "wait/synch/cond/sql/COND_queue_state"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from COND_INSTANCES +# where name like "wait/synch/cond/sql/COND_mdl"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from COND_INSTANCES +# where name like "wait/synch/cond/sql/BML_class::COND_BML"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from COND_INSTANCES +# where name like "wait/synch/cond/sql/BML_class::COND_BML_registered"; + +# Does not exist in mysql 5.5, 6.0 only +# select count(name) from COND_INSTANCES +# where name like "wait/synch/cond/sql/BML_class::COND_BML_release"; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt new file mode 100644 index 00000000000..714888a6de1 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_cond_class-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_cond_classes=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_class.test b/mysql-test/suite/perfschema/t/start_server_no_cond_class.test new file mode 100644 index 00000000000..34ff61c358e --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_cond_class.test @@ -0,0 +1,38 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no classes +show variables like "performance_schema_max_cond_classes"; + +select count(*) from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/cond/%"; + +# We lost all the classes +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_COND_CLASSES_LOST'; + +# Expect no instances +select count(*) from performance_schema.COND_INSTANCES; + +# Expect no instances lost +show status like "performance_schema_cond_instances_lost"; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt new file mode 100644 index 00000000000..4b33152f89a --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_cond_inst-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_cond_instances=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test b/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test new file mode 100644 index 00000000000..fe2177adb82 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_cond_inst.test @@ -0,0 +1,41 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect classes +show variables like "performance_schema_max_cond_classes"; + +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/cond/%"; + +# Expect no class lost +show status like "performance_schema_cond_classes_lost"; + +# Expect no instances +show variables like "performance_schema_max_cond_instances"; + +select count(*) from performance_schema.COND_INSTANCES; + +# Expect instances lost +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_COND_INSTANCES_LOST'; + + diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt new file mode 100644 index 00000000000..f4b6d1ec893 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_file_class-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_file_classes=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_class.test b/mysql-test/suite/perfschema/t/start_server_no_file_class.test new file mode 100644 index 00000000000..ca84fbbdcf2 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_file_class.test @@ -0,0 +1,38 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no classes +show variables like "performance_schema_max_file_classes"; + +select count(*) from performance_schema.SETUP_INSTRUMENTS + where name like "wait/io/file/%"; + +# We lost all the classes +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_FILE_CLASSES_LOST'; + +# Expect no instances +select count(*) from performance_schema.FILE_INSTANCES; + +# Expect no instances lost +show status like "performance_schema_file_instances_lost"; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt new file mode 100644 index 00000000000..7f0d246f97a --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_file_inst-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_file_instances=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_file_inst.test b/mysql-test/suite/perfschema/t/start_server_no_file_inst.test new file mode 100644 index 00000000000..dbbba7bbe4a --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_file_inst.test @@ -0,0 +1,41 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect classes +show variables like "performance_schema_max_file_classes"; + +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS + where name like "wait/io/file/%"; + +# Expect no class lost +show status like "performance_schema_file_classes_lost"; + +# Expect no instances +show variables like "performance_schema_max_file_instances"; + +select count(*) from performance_schema.FILE_INSTANCES; + +# Expect instances lost +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_FILE_INSTANCES_LOST'; + + diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt new file mode 100644 index 00000000000..173851434eb --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_class-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_mutex_classes=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test b/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test new file mode 100644 index 00000000000..142e150ede6 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_class.test @@ -0,0 +1,38 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no classes +show variables like "performance_schema_max_mutex_classes"; + +select count(*) from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/mutex/%"; + +# We lost all the classes +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_CLASSES_LOST'; + +# Expect no instances +select count(*) from performance_schema.MUTEX_INSTANCES; + +# Expect no instances lost +show status like "performance_schema_mutex_instances_lost"; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt new file mode 100644 index 00000000000..5bdd7d39b4a --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_mutex_instances=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test new file mode 100644 index 00000000000..5a03251d97a --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_mutex_inst.test @@ -0,0 +1,41 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect classes +show variables like "performance_schema_max_mutex_classes"; + +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/mutex/%"; + +# Expect no class lost +show status like "performance_schema_mutex_classes_lost"; + +# Expect no instances +show variables like "performance_schema_max_mutex_instances"; + +select count(*) from performance_schema.MUTEX_INSTANCES; + +# Expect instances lost +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_MUTEX_INSTANCES_LOST'; + + diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt new file mode 100644 index 00000000000..f0d15c86ddc --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_rwlock_classes=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test new file mode 100644 index 00000000000..e4dfe121fcf --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_class.test @@ -0,0 +1,38 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no classes +show variables like "performance_schema_max_rwlock_classes"; + +select count(*) from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/rwlock/%"; + +# We lost all the classes +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_CLASSES_LOST'; + +# Expect no instances +select count(*) from performance_schema.RWLOCK_INSTANCES; + +# Expect no instances lost +show status like "performance_schema_rwlock_instances_lost"; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt new file mode 100644 index 00000000000..fc1f5f89902 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_rwlock_instances=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test new file mode 100644 index 00000000000..1d79d2d3991 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_rwlock_inst.test @@ -0,0 +1,41 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect classes +show variables like "performance_schema_max_rwlock_classes"; + +select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS + where name like "wait/synch/rwlock/%"; + +# Expect no class lost +show status like "performance_schema_rwlock_classes_lost"; + +# Expect no instances +show variables like "performance_schema_max_rwlock_instances"; + +select count(*) from performance_schema.RWLOCK_INSTANCES; + +# Expect instances lost +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_RWLOCK_INSTANCES_LOST'; + + diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt b/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt new file mode 100644 index 00000000000..91286cef859 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_thread_class-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_thread_classes=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_class.test b/mysql-test/suite/perfschema/t/start_server_no_thread_class.test new file mode 100644 index 00000000000..ba214ba9966 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_thread_class.test @@ -0,0 +1,38 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect no classes +show variables like "performance_schema_max_thread_classes"; + +select count(*) from performance_schema.SETUP_INSTRUMENTS + where name like "thread/%"; + +# We lost all the classes +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_THREAD_CLASSES_LOST'; + +# Expect no instances +select count(*) from performance_schema.PROCESSLIST; + +# Expect no instances lost +show status like "performance_schema_thread_instances_lost"; + diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt b/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt new file mode 100644 index 00000000000..6e9d13c2b4c --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_thread_inst-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema --loose-performance_schema_max_thread_instances=0 diff --git a/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test b/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test new file mode 100644 index 00000000000..7d8a44ebcd5 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_no_thread_inst.test @@ -0,0 +1,42 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expect classes +show variables like "performance_schema_max_thread_classes"; + +# Not observable yet +# select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS +# where name like "thread/%"; + +# Expect no class lost +show status like "performance_schema_thread_classes_lost"; + +# Expect no instances +show variables like "performance_schema_max_thread_instances"; + +select count(*) from performance_schema.PROCESSLIST; + +# Expect instances lost +select variable_value > 0 from information_schema.global_status + where variable_name like 'PERFORMANCE_SCHEMA_THREAD_INSTANCES_LOST'; + + diff --git a/mysql-test/suite/perfschema/t/start_server_off-master.opt b/mysql-test/suite/perfschema/t/start_server_off-master.opt new file mode 100644 index 00000000000..600566e870b --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_off-master.opt @@ -0,0 +1 @@ +--loose-disable-performance-schema diff --git a/mysql-test/suite/perfschema/t/start_server_off.test b/mysql-test/suite/perfschema/t/start_server_off.test new file mode 100644 index 00000000000..bd9db97840d --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_off.test @@ -0,0 +1,25 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expecting all off / zero +show status like "performance_schema%"; + diff --git a/mysql-test/suite/perfschema/t/start_server_on-master.opt b/mysql-test/suite/perfschema/t/start_server_on-master.opt new file mode 100644 index 00000000000..542720c44d7 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_on-master.opt @@ -0,0 +1 @@ +--loose-enable-performance-schema diff --git a/mysql-test/suite/perfschema/t/start_server_on.test b/mysql-test/suite/perfschema/t/start_server_on.test new file mode 100644 index 00000000000..54714616a08 --- /dev/null +++ b/mysql-test/suite/perfschema/t/start_server_on.test @@ -0,0 +1,25 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +--source include/not_embedded.inc +--source include/have_perfschema.inc + +--source ../include/start_server_common.inc + +# Expecting nothing lost with default parameters + +show status like "performance_schema%"; diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt b/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt new file mode 100644 index 00000000000..5f094e68be7 --- /dev/null +++ b/mysql-test/suite/perfschema/t/tampered_perfschema_table1-master.opt @@ -0,0 +1 @@ +--loose-debug=+d,tampered_perfschema_table1 diff --git a/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test new file mode 100644 index 00000000000..be079bacfbf --- /dev/null +++ b/mysql-test/suite/perfschema/t/tampered_perfschema_table1.test @@ -0,0 +1,44 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# Tests for PERFORMANCE_SCHEMA + +# This test uses error injection, +# see PFS_engine_table_share::check_all_tables() + +# Verify that the server starts even when a performance schema table +# is corrupted, with an incompatible change. +# Verify that using that table nicely fails. +# Verify that other tables are not affected. + +--source include/have_debug.inc +--source include/not_embedded.inc +--source include/have_perfschema.inc + +# The message prints 'mysql.SETUP_INSTRUMENTS' +# instead of 'performance_schema.SETUP_INSTRUMENTS', +# due to Bug#46792 + +call mtr.add_suppression( +"Column count of mysql.SETUP_INSTRUMENTS is wrong. " +"Expected 4, found 3. The table is probably corrupted"); + +--error ER_WRONG_NATIVE_TABLE_STRUCTURE +select * from performance_schema.SETUP_INSTRUMENTS limit 1; + +--disable_result_log +select * from performance_schema.SETUP_CONSUMERS limit 1; +--enable_result_log + diff --git a/mysql-test/suite/perfschema_stress/README b/mysql-test/suite/perfschema_stress/README new file mode 100644 index 00000000000..53f6f1daf35 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/README @@ -0,0 +1,34 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +WL#4818 - Stress testing of PERFORMANCE_SCHEMA + +The performance schema storage engine is backed by data structures, we +want to be sure that these data structures are not fragile under +load. + +NFS1: 20 threads doing read of performance data (both mutex and +disk), 5 threads changing what is being instrumented, 25 threads doing +DML and DDL so that the statistics are updated. Connections should frequently +disconnect or be KILLed, and reconnect. + +The database should not crash under any circumstance. + +How to run: + +MTR_VERSION=1 ./mtr --stress \ + --stress-suite=perfschema_stress \ + --stress-threads=50 \ + --stress-test-duration=3600 diff --git a/mysql-test/suite/perfschema_stress/include/settings.inc b/mysql-test/suite/perfschema_stress/include/settings.inc new file mode 100644 index 00000000000..fb886a86df2 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/include/settings.inc @@ -0,0 +1,17 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +let $num_stress_rows= 5000; +let $default_engine_type= myisam; diff --git a/mysql-test/suite/perfschema_stress/r/modify.result b/mysql-test/suite/perfschema_stress/r/modify.result new file mode 100644 index 00000000000..e1a79c9be2a --- /dev/null +++ b/mysql-test/suite/perfschema_stress/r/modify.result @@ -0,0 +1,17 @@ +UPDATE performance_schema.SETUP_INSTRUMENTS SET TIMED = 'NO'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET ENABLED = 'NO'; +UPDATE performance_schema.SETUP_TIMERS +SET TIMER_NAME = 'NANOSECOND' WHERE NAME = 'Wait'; +UPDATE performance_schema.SETUP_TIMERS +SET TIMER_NAME = 'CYCLE' WHERE NAME = 'Wait'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET TIMED = 'YES'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET ENABLED = 'YES' +WHERE NAME IN ('wait/io/file/sql/FRM', +'thread/sql/Connection', +'wait/synch/cond/sql/COND_mdl', +'wait/synch/rwlock/sql/LOCK_sys_init_connect', +'wait/synch/mutex/sql/LOCK_mdl'); +UPDATE performance_schema.SETUP_CONSUMERS SET ENABLED = 'NO' +WHERE NAME = 'events_waits_history'; +UPDATE performance_schema.SETUP_CONSUMERS SET ENABLED = 'YES' +WHERE NAME = 'events_waits_history'; diff --git a/mysql-test/suite/perfschema_stress/r/read.result b/mysql-test/suite/perfschema_stress/r/read.result new file mode 100644 index 00000000000..eee3067ddb8 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/r/read.result @@ -0,0 +1,29 @@ +SELECT * FROM performance_schema.SETUP_INSTRUMENTS +WHERE ENABLED='NO' AND TIMED='NO'; +NAME ENABLED TIMED +SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE (TIMER_END - TIMER_START != TIMER_WAIT); +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY +WHERE SPINS != NULL; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +SELECT * FROM performance_schema.PROCESSLIST p, +performance_schema.EVENTS_WAITS_CURRENT e +WHERE p.THREAD_ID = e.THREAD_ID +AND TIMER_START = 0 +ORDER BY e.EVENT_ID; +THREAD_ID ID NAME THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE THREAD_ID IN (SELECT THREAD_ID +FROM performance_schema.PROCESSLIST +ORDER BY THREAD_ID) +AND TIMER_END = 0 +AND TIMER_WAIT != NULL +ORDER BY EVENT_ID; +THREAD_ID EVENT_ID EVENT_NAME SOURCE TIMER_START TIMER_END TIMER_WAIT SPINS OBJECT_SCHEMA OBJECT_NAME OBJECT_TYPE OBJECT_INSTANCE_BEGIN NESTING_EVENT_ID OPERATION NUMBER_OF_BYTES FLAGS +SELECT SUM(COUNT_READ) AS sum_count_read, +SUM(COUNT_WRITE) AS sum_count_write, +SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read, +SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write +FROM performance_schema.FILE_SUMMARY_BY_INSTANCE +WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL; diff --git a/mysql-test/suite/perfschema_stress/r/work.result b/mysql-test/suite/perfschema_stress/r/work.result new file mode 100644 index 00000000000..c782b45fdf9 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/r/work.result @@ -0,0 +1,16 @@ +SET @rowid = ROUND(RAND() * ); +START TRANSACTION; +UPDATE t1 SET b = 'changed' WHERE id=@rowid; +SELECT b FROM t1 WHERE id=@rowid; +b +changed +COMMIT; +START TRANSACTION; +DELETE FROM t1 WHERE id=@rowid; +INSERT INTO t1 (id, b) VALUES (@rowid, 'newly_inserted'); +SELECT b FROM t1 WHERE id=@rowid; +b +newly_inserted +COMMIT; +CREATE TABLE tw_ AS SELECT * FROM t1; +DROP TABLE tw_; diff --git a/mysql-test/suite/perfschema_stress/stress_init.txt b/mysql-test/suite/perfschema_stress/stress_init.txt new file mode 100644 index 00000000000..146f275e098 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/stress_init.txt @@ -0,0 +1 @@ +setup diff --git a/mysql-test/suite/perfschema_stress/stress_tests.txt b/mysql-test/suite/perfschema_stress/stress_tests.txt new file mode 100644 index 00000000000..a17a30cb551 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/stress_tests.txt @@ -0,0 +1,10 @@ +read +read +read +read +modify +work +work +work +work +work diff --git a/mysql-test/suite/perfschema_stress/t/modify.test b/mysql-test/suite/perfschema_stress/t/modify.test new file mode 100644 index 00000000000..08b0699ace6 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/t/modify.test @@ -0,0 +1,55 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source suite/perfschema_stress/include/settings.inc + +let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`; + +if (`SELECT ($have_table = 0)`) { + --source suite/perfschema_stress/t/setup.test +} + +UPDATE performance_schema.SETUP_INSTRUMENTS SET TIMED = 'NO'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET ENABLED = 'NO'; + +UPDATE performance_schema.SETUP_TIMERS +SET TIMER_NAME = 'NANOSECOND' WHERE NAME = 'Wait'; + +# Let it run some time with the new timer name and instruments +--sleep 1 + +UPDATE performance_schema.SETUP_TIMERS +SET TIMER_NAME = 'CYCLE' WHERE NAME = 'Wait'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET TIMED = 'YES'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET ENABLED = 'YES' +WHERE NAME IN ('wait/io/file/sql/FRM', + 'thread/sql/Connection', + 'wait/synch/cond/sql/COND_mdl', + 'wait/synch/rwlock/sql/LOCK_sys_init_connect', + 'wait/synch/mutex/sql/LOCK_mdl'); + +# Two short lived changes to see that switching does not lead +# to havoc. + +UPDATE performance_schema.SETUP_CONSUMERS SET ENABLED = 'NO' +WHERE NAME = 'events_waits_history'; + +UPDATE performance_schema.SETUP_CONSUMERS SET ENABLED = 'YES' +WHERE NAME = 'events_waits_history'; diff --git a/mysql-test/suite/perfschema_stress/t/read.test b/mysql-test/suite/perfschema_stress/t/read.test new file mode 100644 index 00000000000..28ba4d8d887 --- /dev/null +++ b/mysql-test/suite/perfschema_stress/t/read.test @@ -0,0 +1,49 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc + +SELECT * FROM performance_schema.SETUP_INSTRUMENTS +WHERE ENABLED='NO' AND TIMED='NO'; + +SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE (TIMER_END - TIMER_START != TIMER_WAIT); + +SELECT * FROM performance_schema.EVENTS_WAITS_HISTORY +WHERE SPINS != NULL; + +SELECT * FROM performance_schema.PROCESSLIST p, + performance_schema.EVENTS_WAITS_CURRENT e +WHERE p.THREAD_ID = e.THREAD_ID + AND TIMER_START = 0 +ORDER BY e.EVENT_ID; + +SELECT * FROM performance_schema.EVENTS_WAITS_CURRENT +WHERE THREAD_ID IN (SELECT THREAD_ID + FROM performance_schema.PROCESSLIST + ORDER BY THREAD_ID) + AND TIMER_END = 0 + AND TIMER_WAIT != NULL +ORDER BY EVENT_ID; + +--disable_result_log +SELECT SUM(COUNT_READ) AS sum_count_read, + SUM(COUNT_WRITE) AS sum_count_write, + SUM(SUM_NUMBER_OF_BYTES_READ) AS sum_num_bytes_read, + SUM(SUM_NUMBER_OF_BYTES_WRITE) AS sum_num_bytes_write +FROM performance_schema.FILE_SUMMARY_BY_INSTANCE +WHERE FILE_NAME LIKE CONCAT('%', @@tmpdir, '%') ORDER BY NULL; +--enable_result_log + diff --git a/mysql-test/suite/perfschema_stress/t/setup.test b/mysql-test/suite/perfschema_stress/t/setup.test new file mode 100644 index 00000000000..9f643edfebe --- /dev/null +++ b/mysql-test/suite/perfschema_stress/t/setup.test @@ -0,0 +1,64 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +if (`SELECT VERSION() LIKE '%embedded%'`) +{ + --skip This test cannot run with the embedded server. +} + +--source suite/perfschema_stress/include/settings.inc + +--disable_query_log +--disable_result_log + +if (`SELECT LENGTH('$engine_type') = 0`) { + let $engine_type= $default_engine_type; +} +if (`SELECT '$engine_type' = 'Falcon'`) { + --source include/have_falcon.inc +} + +--replace_result $engine_type +eval CREATE TABLE t1 (id INT PRIMARY KEY, b CHAR(100) DEFAULT 'initial value') + ENGINE=$engine_type; + +# Need something to start with +INSERT INTO t1(id) VALUES (1), (2), (3), (4), (5), (6), (7), (8); + +# Bulk load the correct number of rows +while (`SELECT MAX(id) < $num_stress_rows FROM t1`) +{ + SELECT MAX(id) FROM t1 INTO @max; +--replace_result $num_stress_rows + eval INSERT INTO t1(id) SELECT id + @max FROM t1 + WHERE id + @max <= $num_stress_rows; +} + +# Turn on some instruments + +UPDATE performance_schema.SETUP_INSTRUMENTS SET TIMED = 'YES'; + +UPDATE performance_schema.SETUP_INSTRUMENTS SET ENABLED = 'NO'; +UPDATE performance_schema.SETUP_INSTRUMENTS SET ENABLED = 'YES' +WHERE NAME IN ('wait/io/file/sql/FRM', + 'thread/sql/Connection', + 'wait/synch/cond/sql/COND_mdl', + 'wait/synch/rwlock/sql/LOCK_sys_init_connect', + 'wait/synch/mutex/sql/LOCK_mdl'); + +UPDATE performance_schema.SETUP_CONSUMERS SET ENABLED = 'YES'; + +--enable_result_log +--enable_query_log diff --git a/mysql-test/suite/perfschema_stress/t/work.test b/mysql-test/suite/perfschema_stress/t/work.test new file mode 100644 index 00000000000..8f1bc42c5bc --- /dev/null +++ b/mysql-test/suite/perfschema_stress/t/work.test @@ -0,0 +1,47 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +--source include/not_embedded.inc +--source suite/perfschema_stress/include/settings.inc + +let $have_table= `SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1'`; + +if (`SELECT ($have_table = 0)`) { + --source suite/perfschema_stress/t/setup.test +} + +--replace_result $num_stress_rows +eval SET @rowid = ROUND(RAND() * $num_stress_rows); + +let $conn_id= `SELECT CONNECTION_ID()`; +let $conn_nr= conn_$conn_id; + +START TRANSACTION; +UPDATE t1 SET b = 'changed' WHERE id=@rowid; +SELECT b FROM t1 WHERE id=@rowid; +COMMIT; + +START TRANSACTION; +DELETE FROM t1 WHERE id=@rowid; +INSERT INTO t1 (id, b) VALUES (@rowid, 'newly_inserted'); +SELECT b FROM t1 WHERE id=@rowid; +COMMIT; + +--replace_result $conn_nr +eval CREATE TABLE tw_$conn_nr AS SELECT * FROM t1; + +--replace_result $conn_nr +eval DROP TABLE tw_$conn_nr; diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result index a1294d515fa..4639c717cea 100644 --- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result +++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result @@ -24,6 +24,7 @@ information_schema mtr mysql mysqltest +performance_schema test USE test; SHOW TABLES; diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result index 27960be8054..13ee20cb3a0 100644 --- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result +++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result @@ -11,6 +11,7 @@ Database information_schema mtr mysql +performance_schema test test_ignore USE test; @@ -38,6 +39,7 @@ Database information_schema mtr mysql +performance_schema test USE test; SHOW TABLES; diff --git a/mysql-test/t/bug46080-master.opt b/mysql-test/t/bug46080-master.opt index edcc54fa428..71024d39356 100644 --- a/mysql-test/t/bug46080-master.opt +++ b/mysql-test/t/bug46080-master.opt @@ -1 +1 @@ ---skip-grant-tables --skip-name-resolve --loose-safemalloc-mem-limit=4000000 +--loose-performance-schema=0 --skip-grant-tables --skip-name-resolve --loose-safemalloc-mem-limit=4000000 diff --git a/mysql-test/t/mysqld--help-notwin.test b/mysql-test/t/mysqld--help-notwin.test index 6db5dd830a6..e3d1ca97128 100644 --- a/mysql-test/t/mysqld--help-notwin.test +++ b/mysql-test/t/mysqld--help-notwin.test @@ -1,8 +1,24 @@ +# Copyright (C) 2009-2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # mysqld --help # --source include/not_embedded.inc --source include/not_windows.inc +--source include/have_perfschema.inc --source include/mysqld--help.inc diff --git a/mysql-test/t/mysqld--help-win.test b/mysql-test/t/mysqld--help-win.test index 416beb1d34c..56cfec8999b 100644 --- a/mysql-test/t/mysqld--help-win.test +++ b/mysql-test/t/mysqld--help-win.test @@ -1,8 +1,24 @@ +# Copyright (C) 2009-2010 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + # # mysqld --help # --source include/not_embedded.inc --source include/windows.inc +--source include/have_perfschema.inc --source include/mysqld--help.inc diff --git a/mysys/my_rdtsc.c b/mysys/my_rdtsc.c index 4227498b92c..c2b31ee339d 100644 --- a/mysys/my_rdtsc.c +++ b/mysys/my_rdtsc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2008, 2009 Sun Microsystems, Inc +/* Copyright (C) 2008-2010 Sun Microsystems, Inc This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -256,15 +256,15 @@ ulonglong my_timer_nanoseconds(void) read_real_time(&tr, TIMEBASE_SZ); return (ulonglong) tr.tb_high * 1000000000 + (ulonglong) tr.tb_low; } +#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) + /* SunOS 5.10+, Solaris, HP-UX: hrtime_t gethrtime(void) */ + return (ulonglong) gethrtime(); #elif defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_REALTIME) { struct timespec tp; clock_gettime(CLOCK_REALTIME, &tp); return (ulonglong) tp.tv_sec * 1000000000 + (ulonglong) tp.tv_nsec; } -#elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) - /* SunOS 5.10+, Solaris, HP-UX: hrtime_t gethrtime(void) */ - return (ulonglong) gethrtime(); #elif defined(__NETWARE__) { NXTime_t tm; @@ -579,10 +579,10 @@ void my_timer_init(MY_TIMER_INFO *mti) mti->nanoseconds.frequency= 1000000000; /* initial assumption */ #if defined(HAVE_READ_REAL_TIME) mti->nanoseconds.routine= MY_TIMER_ROUTINE_READ_REAL_TIME; -#elif defined(HAVE_CLOCK_GETTIME) - mti->nanoseconds.routine= MY_TIMER_ROUTINE_CLOCK_GETTIME; #elif defined(HAVE_SYS_TIMES_H) && defined(HAVE_GETHRTIME) mti->nanoseconds.routine= MY_TIMER_ROUTINE_GETHRTIME; +#elif defined(HAVE_CLOCK_GETTIME) + mti->nanoseconds.routine= MY_TIMER_ROUTINE_CLOCK_GETTIME; #elif defined(__NETWARE__) mti->nanoseconds.routine= MY_TIMER_ROUTINE_NXGETTIME; #elif defined(__APPLE__) && defined(__MACH__) diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql index e3ddf7ffc30..bcbedae4d0f 100644 --- a/scripts/mysql_system_tables.sql +++ b/scripts/mysql_system_tables.sql @@ -1,3 +1,18 @@ +-- Copyright (C) 2008-2009 Sun Microsystems, Inc +-- +-- This program is free software; you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation; version 2 of the License. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with this program; if not, write to the Free Software +-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + -- -- The system tables of MySQL Server -- @@ -85,3 +100,347 @@ CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_b CREATE TABLE IF NOT EXISTS ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; + +-- +-- The performance schema database. +-- This database is always created, even in --without-perfschema builds, +-- so that the database name is always reserved by the MySQL implementation. +-- + +set @have_pfs= (select count(engine) from information_schema.engines where engine='PERFORMANCE_SCHEMA' and support != 'NO'); + +DROP DATABASE IF EXISTS performance_schema; + +CREATE DATABASE performance_schema character set utf8; + +-- +-- TABLE COND_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.COND_INSTANCES("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_CURRENT +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_CURRENT("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="EVENT_ID BIGINT unsigned not null,"; +SET @l4="EVENT_NAME VARCHAR(128) not null,"; +SET @l5="SOURCE VARCHAR(64),"; +SET @l6="TIMER_START BIGINT unsigned,"; +SET @l7="TIMER_END BIGINT unsigned,"; +SET @l8="TIMER_WAIT BIGINT unsigned,"; +SET @l9="SPINS INTEGER unsigned,"; +SET @l10="OBJECT_SCHEMA VARCHAR(64),"; +SET @l11="OBJECT_NAME VARCHAR(512),"; +SET @l12="OBJECT_TYPE VARCHAR(64),"; +SET @l13="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l14="NESTING_EVENT_ID BIGINT unsigned,"; +SET @l15="OPERATION VARCHAR(16) not null,"; +SET @l16="NUMBER_OF_BYTES BIGINT unsigned,"; +SET @l17="FLAGS INTEGER unsigned"; +SET @l18=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_HISTORY +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY("; +-- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_HISTORY_LONG +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_HISTORY_LONG("; +-- lines 2 to 18 are unchanged from EVENTS_WAITS_CURRENT + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9,@l10,@l11,@l12,@l13,@l14,@l15,@l16,@l17,@l18); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_SUMMARY_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="COUNT_STAR BIGINT unsigned not null,"; +SET @l4="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l5="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_SUMMARY_BY_INSTANCE +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_INSTANCE("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l4="COUNT_STAR BIGINT unsigned not null,"; +SET @l5="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l8="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l9=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="EVENT_NAME VARCHAR(128) not null,"; +SET @l4="COUNT_STAR BIGINT unsigned not null,"; +SET @l5="SUM_TIMER_WAIT BIGINT unsigned not null,"; +SET @l6="MIN_TIMER_WAIT BIGINT unsigned not null,"; +SET @l7="AVG_TIMER_WAIT BIGINT unsigned not null,"; +SET @l8="MAX_TIMER_WAIT BIGINT unsigned not null"; +SET @l9=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8,@l9); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE FILE_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.FILE_INSTANCES("; +SET @l2="FILE_NAME VARCHAR(512) not null,"; +SET @l3="EVENT_NAME VARCHAR(128) not null,"; +SET @l4="OPEN_COUNT INTEGER unsigned not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE FILE_SUMMARY_BY_EVENT_NAME +-- + +SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_EVENT_NAME("; +SET @l2="EVENT_NAME VARCHAR(128) not null,"; +SET @l3="COUNT_READ BIGINT unsigned not null,"; +SET @l4="COUNT_WRITE BIGINT unsigned not null,"; +SET @l5="SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"; +SET @l6="SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null"; +SET @l7=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE FILE_SUMMARY_BY_INSTANCE +-- + +SET @l1="CREATE TABLE performance_schema.FILE_SUMMARY_BY_INSTANCE("; +SET @l2="FILE_NAME VARCHAR(512) not null,"; +SET @l3="EVENT_NAME VARCHAR(128) not null,"; +SET @l4="COUNT_READ BIGINT unsigned not null,"; +SET @l5="COUNT_WRITE BIGINT unsigned not null,"; +SET @l6="SUM_NUMBER_OF_BYTES_READ BIGINT unsigned not null,"; +SET @l7="SUM_NUMBER_OF_BYTES_WRITE BIGINT unsigned not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE MUTEX_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.MUTEX_INSTANCES("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l4="LOCKED_BY_THREAD_ID INTEGER"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE PERFORMANCE_TIMERS +-- + +SET @l1="CREATE TABLE performance_schema.PERFORMANCE_TIMERS("; +SET @l2="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null,"; +SET @l3="TIMER_FREQUENCY BIGINT,"; +SET @l4="TIMER_RESOLUTION BIGINT,"; +SET @l5="TIMER_OVERHEAD BIGINT"; +SET @l6=") ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE PROCESSLIST +-- + +SET @l1="CREATE TABLE performance_schema.PROCESSLIST("; +SET @l2="THREAD_ID INTEGER not null,"; +SET @l3="ID INTEGER not null,"; +SET @l4="NAME VARCHAR(64) not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE RWLOCK_INSTANCES +-- + +SET @l1="CREATE TABLE performance_schema.RWLOCK_INSTANCES("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="OBJECT_INSTANCE_BEGIN BIGINT not null,"; +SET @l4="WRITE_LOCKED_BY_THREAD_ID INTEGER,"; +SET @l5="READ_LOCKED_BY_COUNT INTEGER unsigned not null"; +SET @l6=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_CONSUMERS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_CONSUMERS("; +SET @l2="NAME VARCHAR(64) not null,"; +SET @l3="ENABLED ENUM ('YES', 'NO') not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_INSTRUMENTS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_INSTRUMENTS("; +SET @l2="NAME VARCHAR(128) not null,"; +SET @l3="ENABLED ENUM ('YES', 'NO') not null,"; +SET @l4="TIMED ENUM ('YES', 'NO') not null"; +SET @l5=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_OBJECTS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_OBJECTS("; +SET @l2="OBJECT_TYPE VARCHAR(64),"; +SET @l3="OBJECT_SCHEMA VARCHAR(64),"; +SET @l4="OBJECT_NAME VARCHAR(64),"; +SET @l5="ENABLED ENUM ('YES', 'NO') not null,"; +SET @l6="TIMED ENUM ('YES', 'NO') not null,"; +SET @l7="AGGREGATED ENUM ('YES', 'NO') not null"; +SET @l8=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4,@l5,@l6,@l7,@l8); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + +-- +-- TABLE SETUP_TIMERS +-- + +SET @l1="CREATE TABLE performance_schema.SETUP_TIMERS("; +SET @l2="NAME VARCHAR(64) not null,"; +SET @l3="TIMER_NAME ENUM ('CYCLE', 'NANOSECOND', 'MICROSECOND', 'MILLISECOND', 'TICK') not null"; +SET @l4=")ENGINE=PERFORMANCE_SCHEMA;"; + +SET @cmd=concat(@l1,@l2,@l3,@l4); + +SET @str = IF(@have_pfs = 1, @cmd, 'SET @dummy = 0'); +PREPARE stmt FROM @str; +EXECUTE stmt; +DROP PREPARE stmt; + diff --git a/sql/event_queue.cc b/sql/event_queue.cc index 7d987db411a..cf63ba937e0 100644 --- a/sql/event_queue.cc +++ b/sql/event_queue.cc @@ -343,7 +343,7 @@ Event_queue::drop_matching_events(THD *thd, LEX_STRING pattern, i++; } /* - We don't call pthread_cond_broadcast(&COND_queue_state); + We don't call mysql_cond_broadcast(&COND_queue_state); If we remove the top event: 1. The queue is empty. The scheduler will wake up at some time and realize that the queue is empty. If create_event() comes inbetween @@ -706,13 +706,13 @@ Event_queue::unlock_data(const char *func, uint line) /* - Wrapper for pthread_cond_wait/timedwait + Wrapper for mysql_cond_wait/timedwait SYNOPSIS Event_queue::cond_wait() thd Thread (Could be NULL during shutdown procedure) msg Message for thd->proc_info - abstime If not null then call pthread_cond_timedwait() + abstime If not null then call mysql_cond_timedwait() func Which function is requesting cond_wait line On which line cond_wait is requested */ @@ -729,7 +729,7 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg, thd->enter_cond(&COND_queue_state, &LOCK_event_queue, msg); - DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":"")); + DBUG_PRINT("info", ("mysql_cond_%swait", abstime? "timed":"")); if (!abstime) mysql_cond_wait(&COND_queue_state, &LOCK_event_queue); else diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 486b03fc58e..5d8455fa88b 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -129,11 +129,11 @@ post_init_event_thread(THD *thd) return TRUE; } - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); threads.append(thd); thread_count++; inc_thread_running(); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); return FALSE; } @@ -153,12 +153,12 @@ deinit_event_thread(THD *thd) DBUG_ASSERT(thd->net.buff != 0); net_end(&thd->net); DBUG_PRINT("exit", ("Event thread finishing")); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thread_count--; dec_thread_running(); delete thd; - pthread_cond_broadcast(&COND_thread_count); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } @@ -190,9 +190,9 @@ pre_init_event_thread(THD* thd) thd->slave_thread= 0; thd->variables.option_bits|= OPTION_AUTO_IS_NULL; thd->client_capabilities|= CLIENT_MULTI_RESULTS; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); /* Guarantees that we will see the thread in SHOW PROCESSLIST though its @@ -421,12 +421,12 @@ Event_scheduler::start() new_thd->proc_info= "Clearing"; DBUG_ASSERT(new_thd->net.buff != 0); net_end(&new_thd->net); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thread_count--; dec_thread_running(); delete new_thd; - pthread_cond_broadcast(&COND_thread_count); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } end: UNLOCK_DATA(); @@ -555,12 +555,12 @@ error: new_thd->proc_info= "Clearing"; DBUG_ASSERT(new_thd->net.buff != 0); net_end(&new_thd->net); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thread_count--; dec_thread_running(); delete new_thd; - pthread_cond_broadcast(&COND_thread_count); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } delete event_name; DBUG_RETURN(TRUE); @@ -675,12 +675,12 @@ Event_scheduler::workers_count() uint count= 0; DBUG_ENTER("Event_scheduler::workers_count"); - pthread_mutex_lock(&LOCK_thread_count); // For unlink from list + mysql_mutex_lock(&LOCK_thread_count); // For unlink from list I_List_iterator it(threads); while ((tmp=it++)) if (tmp->system_thread == SYSTEM_THREAD_EVENT_WORKER) ++count; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_PRINT("exit", ("%d", count)); DBUG_RETURN(count); } @@ -733,12 +733,12 @@ Event_scheduler::unlock_data(const char *func, uint line) /* - Wrapper for pthread_cond_wait/timedwait + Wrapper for mysql_cond_wait/timedwait SYNOPSIS Event_scheduler::cond_wait() thd Thread (Could be NULL during shutdown procedure) - abstime If not null then call pthread_cond_timedwait() + abstime If not null then call mysql_cond_timedwait() msg Message for thd->proc_info func Which function is requesting cond_wait line On which line cond_wait is requested @@ -756,7 +756,7 @@ Event_scheduler::cond_wait(THD *thd, struct timespec *abstime, const char* msg, if (thd) thd->enter_cond(&COND_state, &LOCK_scheduler_state, msg); - DBUG_PRINT("info", ("pthread_cond_%swait", abstime? "timed":"")); + DBUG_PRINT("info", ("mysql_cond_%swait", abstime? "timed":"")); if (!abstime) mysql_cond_wait(&COND_state, &LOCK_scheduler_state); else diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index 25f8474feae..f2e2e38a167 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -3659,9 +3659,9 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) /* We need to set thd->thread_id before thd->store_globals, or it will set an invalid value for thd->variables.pseudo_thread_id. */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->thread_id= thread_id++; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mysql_thread_set_psi_id(thd->thread_id); @@ -3697,9 +3697,9 @@ pthread_handler_t ndb_binlog_thread_func(void *arg) pthread_detach_this_thread(); thd->real_id= pthread_self(); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); threads.append(thd); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); thd->lex->start_transaction_opt= 0; if (!(s_ndb= new Ndb(g_ndb_cluster_connection, "")) || diff --git a/sql/item_func.cc b/sql/item_func.cc index 557561789b2..f9d9522fbbc 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3502,7 +3502,7 @@ void debug_sync_point(const char* lock_name, uint lock_timeout) @param lock the associated mutex @param abstime the amount of time in seconds to wait - @retval return value from pthread_cond_timedwait + @retval return value from mysql_cond_timedwait */ #define INTERRUPT_INTERVAL (5 * ULL(1000000000)) @@ -3822,7 +3822,7 @@ longlong Item_func_sleep::val_int() timeout= args[0]->val_real(); /* - On 64-bit OSX pthread_cond_timedwait() waits forever + On 64-bit OSX mysql_cond_timedwait() waits forever if passed abstime time has already been exceeded by the system time. When given a very short timeout (< 10 mcs) just return diff --git a/sql/lock.cc b/sql/lock.cc index 0235c4ae881..6106e20678a 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -1607,7 +1607,7 @@ bool make_global_read_lock_block_commit(THD *thd) Due to a bug in a threading library it could happen that a signal did not reach its target. A condition for this was that the same condition variable was used with different mutexes in - pthread_cond_wait(). Some time ago we changed LOCK_open to + mysql_cond_wait(). Some time ago we changed LOCK_open to LOCK_global_read_lock in global read lock handling. So COND_refresh was used with LOCK_open and LOCK_global_read_lock. diff --git a/sql/log.cc b/sql/log.cc index 3680398f068..7776b6bfbdc 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -3075,7 +3075,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) thread. If the transaction involved MyISAM tables, it should go into binlog even on rollback. */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); /* Save variables so that we can reopen the log */ save_name=name; @@ -3168,7 +3168,7 @@ bool MYSQL_BIN_LOG::reset_logs(THD* thd) err: if (error == 1) name= const_cast(save_name); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mysql_mutex_unlock(&LOCK_index); mysql_mutex_unlock(&LOCK_log); DBUG_RETURN(error); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 33ca7eee89b..f2ad4e99671 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -2055,7 +2055,7 @@ extern mysql_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_lock_db, LOCK_slave_list, LOCK_active_mi, LOCK_manager, LOCK_global_read_lock, LOCK_global_system_variables, LOCK_user_conn, LOCK_prepared_stmt_count, LOCK_error_messages, LOCK_connection_count; -extern MYSQL_PLUGIN_IMPORT pthread_mutex_t LOCK_thread_count; +extern MYSQL_PLUGIN_IMPORT mysql_mutex_t LOCK_thread_count; #ifdef HAVE_OPENSSL extern mysql_mutex_t LOCK_des_key_file; #endif @@ -2064,7 +2064,7 @@ extern mysql_cond_t COND_server_started; extern int mysqld_server_started; extern mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; extern mysql_rwlock_t LOCK_system_variables_hash; -extern pthread_cond_t COND_thread_count; +extern mysql_cond_t COND_thread_count; extern mysql_cond_t COND_refresh, COND_manager; extern mysql_cond_t COND_global_read_lock; extern pthread_attr_t connection_attrib; @@ -2426,9 +2426,9 @@ inline const char *table_case_name(HA_CREATE_INFO *info, const char *name) inline ulong sql_rnd_with_mutex() { - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); ulong tmp=(ulong) (my_rnd(&sql_rand) * 0xffffffff); /* make all bits random */ - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); return tmp; } @@ -2675,7 +2675,8 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_master_info_data_lock, key_master_info_run_lock, key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock, key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, - key_structure_guard_mutex, key_TABLE_SHARE_mutex, key_LOCK_error_messages; + key_structure_guard_mutex, key_TABLE_SHARE_mutex, key_LOCK_error_messages, + key_LOCK_thread_count; extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, @@ -2693,7 +2694,8 @@ extern PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, key_master_info_start_cond, key_master_info_stop_cond, key_relay_log_info_data_cond, key_relay_log_info_log_space_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond, - key_TABLE_SHARE_cond, key_user_level_lock_cond; + key_TABLE_SHARE_cond, key_user_level_lock_cond, + key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; extern PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, key_thread_handle_manager, key_thread_kill_server, key_thread_main, diff --git a/sql/mysqld.cc b/sql/mysqld.cc index f07410e0d43..bc66df88ea5 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -302,6 +302,7 @@ TYPELIB log_output_typelib= {array_elements(log_output_names)-1,"", #ifdef HAVE_PSI_INTERFACE #if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) static PSI_thread_key key_thread_handle_con_namedpipes; +static PSI_cond_key key_COND_handler_count; #endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ #if defined(HAVE_SMEM) && !defined(EMBEDDED_LIBRARY) @@ -341,8 +342,7 @@ static bool binlog_format_used= false; LEX_STRING opt_init_connect, opt_init_slave; -/* Not instrumented because of LOCK_thread_count */ -static pthread_cond_t COND_thread_cache, COND_flush_thread_cache; +static mysql_cond_t COND_thread_cache, COND_flush_thread_cache; /* Global variables */ @@ -601,8 +601,7 @@ SHOW_COMP_OPTION have_profiling; pthread_key(MEM_ROOT**,THR_MALLOC); pthread_key(THD*, THR_THD); -/* Not instrumented because of Bug#47396 */ -pthread_mutex_t LOCK_thread_count; +mysql_mutex_t LOCK_thread_count; mysql_mutex_t LOCK_mysql_create_db, LOCK_open, LOCK_mapped_file, LOCK_status, LOCK_global_read_lock, LOCK_error_log, LOCK_uuid_generator, @@ -624,7 +623,7 @@ mysql_mutex_t LOCK_des_key_file; #endif mysql_rwlock_t LOCK_grant, LOCK_sys_init_connect, LOCK_sys_init_slave; mysql_rwlock_t LOCK_system_variables_hash; -pthread_cond_t COND_thread_count; +mysql_cond_t COND_thread_count; mysql_cond_t COND_refresh, COND_global_read_lock; pthread_t signal_thread; pthread_attr_t connection_attrib; @@ -839,7 +838,7 @@ static uint thr_kill_signal; #undef getpid #include -static pthread_cond_t COND_handler_count; +static mysql_cond_t COND_handler_count; static uint handler_count; static bool start_mode=0, use_opt_args; static int opt_argc; @@ -979,7 +978,7 @@ static void close_connections(void) #if !defined(__WIN__) && !defined(__NETWARE__) DBUG_PRINT("quit", ("waiting for select thread: 0x%lx", (ulong) select_thread)); - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); while (select_thread_in_use) { @@ -995,18 +994,18 @@ static void close_connections(void) set_timespec(abstime, 2); for (uint tmp=0 ; tmp < 10 && select_thread_in_use; tmp++) { - error=pthread_cond_timedwait(&COND_thread_count,&LOCK_thread_count, - &abstime); + error= mysql_cond_timedwait(&COND_thread_count, &LOCK_thread_count, + &abstime); if (error != EINTR) break; } #ifdef EXTRA_DEBUG if (error != 0 && !count++) - sql_print_error("Got error %d from pthread_cond_timedwait",error); + sql_print_error("Got error %d from mysql_cond_timedwait", error); #endif close_server_sock(); } - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); #endif /* __WIN__ */ @@ -1063,7 +1062,7 @@ static void close_connections(void) */ THD *tmp; - (void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list + mysql_mutex_lock(&LOCK_thread_count); // For unlink from list I_List_iterator it(threads); while ((tmp=it++)) @@ -1089,7 +1088,7 @@ static void close_connections(void) mysql_mutex_unlock(&tmp->mysys_var->mutex); } } - pthread_mutex_unlock(&LOCK_thread_count); // For unlink from list + mysql_mutex_unlock(&LOCK_thread_count); // For unlink from list Events::deinit(); end_slave(); @@ -1106,11 +1105,11 @@ static void close_connections(void) for (;;) { DBUG_PRINT("quit",("Locking LOCK_thread_count")); - (void) pthread_mutex_lock(&LOCK_thread_count); // For unlink from list + mysql_mutex_lock(&LOCK_thread_count); // For unlink from list if (!(tmp=threads.get())) { DBUG_PRINT("quit",("Unlocking LOCK_thread_count")); - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); break; } #ifndef __bsdi__ // Bug in BSDI kernel @@ -1125,17 +1124,17 @@ static void close_connections(void) } #endif DBUG_PRINT("quit",("Unlocking LOCK_thread_count")); - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } /* All threads has now been aborted */ DBUG_PRINT("quit",("Waiting for threads to die (count=%u)",thread_count)); - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); while (thread_count) { - (void) pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); + mysql_cond_wait(&COND_thread_count, &LOCK_thread_count); DBUG_PRINT("quit",("One thread died (count=%u)",thread_count)); } - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); close_active_mi(); DBUG_PRINT("quit",("close_connections thread")); @@ -1477,12 +1476,12 @@ void clean_up(bool print_message) logger.cleanup_end(); my_atomic_rwlock_destroy(&global_query_id_lock); my_atomic_rwlock_destroy(&thread_running_lock); - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); DBUG_PRINT("quit", ("got thread count lock")); ready_to_exit=1; /* do the broadcast inside the lock to ensure that my_end() is not called */ - (void) pthread_cond_broadcast(&COND_thread_count); - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); sys_var_end(); /* @@ -1523,7 +1522,7 @@ static void clean_up_mutexes() mysql_mutex_destroy(&LOCK_lock_db); mysql_rwlock_destroy(&LOCK_grant); mysql_mutex_destroy(&LOCK_open); - pthread_mutex_destroy(&LOCK_thread_count); + mysql_mutex_destroy(&LOCK_thread_count); mysql_mutex_destroy(&LOCK_mapped_file); mysql_mutex_destroy(&LOCK_status); mysql_mutex_destroy(&LOCK_delayed_insert); @@ -1555,11 +1554,11 @@ static void clean_up_mutexes() mysql_mutex_destroy(&LOCK_uuid_generator); mysql_mutex_destroy(&LOCK_prepared_stmt_count); mysql_mutex_destroy(&LOCK_error_messages); - pthread_cond_destroy(&COND_thread_count); + mysql_cond_destroy(&COND_thread_count); mysql_cond_destroy(&COND_refresh); mysql_cond_destroy(&COND_global_read_lock); - pthread_cond_destroy(&COND_thread_cache); - pthread_cond_destroy(&COND_flush_thread_cache); + mysql_cond_destroy(&COND_thread_cache); + mysql_cond_destroy(&COND_flush_thread_cache); mysql_cond_destroy(&COND_manager); } #endif /*EMBEDDED_LIBRARY*/ @@ -1968,7 +1967,7 @@ void close_connection(THD *thd, uint errcode, bool lock) "(not connected)", errcode ? ER_DEFAULT(errcode) : "")); if (lock) - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->killed= THD::KILL_CONNECTION; if ((vio= thd->net.vio) != 0) { @@ -1978,7 +1977,7 @@ void close_connection(THD *thd, uint errcode, bool lock) vio_close(vio); /* vio is freed in delete thd */ } if (lock) - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); MYSQL_CONNECTION_DONE((int) errcode, thd->thread_id); if (MYSQL_CONNECTION_DONE_ENABLED()) { @@ -2025,7 +2024,7 @@ void unlink_thd(THD *thd) --connection_count; mysql_mutex_unlock(&LOCK_connection_count); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thread_count--; delete thd; DBUG_VOID_RETURN; @@ -2050,7 +2049,7 @@ void unlink_thd(THD *thd) static bool cache_thread() { - safe_mutex_assert_owner(&LOCK_thread_count); + mysql_mutex_assert_owner(&LOCK_thread_count); if (cached_thread_count < thread_cache_size && ! abort_loop && !kill_cached_threads) { @@ -2058,10 +2057,10 @@ static bool cache_thread() DBUG_PRINT("info", ("Adding thread to cache")); cached_thread_count++; while (!abort_loop && ! wake_thread && ! kill_cached_threads) - (void) pthread_cond_wait(&COND_thread_cache, &LOCK_thread_count); + mysql_cond_wait(&COND_thread_cache, &LOCK_thread_count); cached_thread_count--; if (kill_cached_threads) - pthread_cond_signal(&COND_flush_thread_cache); + mysql_cond_signal(&COND_flush_thread_cache); if (wake_thread) { THD *thd; @@ -2109,14 +2108,14 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache) unlink_thd(thd); if (put_in_cache) put_in_cache= cache_thread(); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if (put_in_cache) DBUG_RETURN(0); // Thread is reused /* It's safe to broadcast outside a lock (COND... is not deleted here) */ DBUG_PRINT("signal", ("Broadcasting COND_thread_count")); my_thread_end(); - (void) pthread_cond_broadcast(&COND_thread_count); + mysql_cond_broadcast(&COND_thread_count); DBUG_LEAVE; // Must match DBUG_ENTER() pthread_exit(0); @@ -2126,15 +2125,15 @@ bool one_thread_per_connection_end(THD *thd, bool put_in_cache) void flush_thread_cache() { - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); kill_cached_threads++; while (cached_thread_count) { - pthread_cond_broadcast(&COND_thread_cache); - pthread_cond_wait(&COND_flush_thread_cache,&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_cache); + mysql_cond_wait(&COND_flush_thread_cache, &LOCK_thread_count); } kill_cached_threads--; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } @@ -2828,7 +2827,7 @@ static void start_signal_handler(void) #endif #endif - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); if ((error= mysql_thread_create(key_thread_signal_hand, &signal_thread, &thr_attr, signal_hand, 0))) { @@ -2836,8 +2835,8 @@ static void start_signal_handler(void) error,errno); exit(1); } - (void) pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_wait(&COND_thread_count, &LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); (void) pthread_attr_destroy(&thr_attr); DBUG_VOID_RETURN; @@ -2895,11 +2894,11 @@ pthread_handler_t signal_hand(void *arg __attribute__((unused))) This works by waiting for start_signal_handler to free mutex, after which we signal it that we are ready. At this pointer there is no other threads running, so there - should not be any other pthread_cond_signal() calls. + should not be any other mysql_cond_signal() calls. */ - pthread_mutex_lock(&LOCK_thread_count); - pthread_mutex_unlock(&LOCK_thread_count); - pthread_cond_broadcast(&COND_thread_count); + mysql_mutex_lock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); (void) pthread_sigmask(SIG_BLOCK,&set,NULL); for (;;) @@ -3692,7 +3691,7 @@ static int init_thread_environment() &LOCK_mysql_create_db, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_lock_db, &LOCK_lock_db, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_open, &LOCK_open, MY_MUTEX_INIT_FAST); - pthread_mutex_init(&LOCK_thread_count, MY_MUTEX_INIT_FAST); + mysql_mutex_init(key_LOCK_thread_count, &LOCK_thread_count, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_mapped_file, &LOCK_mapped_file, MY_MUTEX_INIT_SLOW); mysql_mutex_init(key_LOCK_status, &LOCK_status, MY_MUTEX_INIT_FAST); mysql_mutex_init(key_LOCK_delayed_insert, @@ -3738,11 +3737,11 @@ static int init_thread_environment() mysql_rwlock_init(key_rwlock_LOCK_sys_init_connect, &LOCK_sys_init_connect); mysql_rwlock_init(key_rwlock_LOCK_sys_init_slave, &LOCK_sys_init_slave); mysql_rwlock_init(key_rwlock_LOCK_grant, &LOCK_grant); - pthread_cond_init(&COND_thread_count, NULL); + mysql_cond_init(key_COND_thread_count, &COND_thread_count, NULL); mysql_cond_init(key_COND_refresh, &COND_refresh, NULL); mysql_cond_init(key_COND_global_read_lock, &COND_global_read_lock, NULL); - pthread_cond_init(&COND_thread_cache, NULL); - pthread_cond_init(&COND_flush_thread_cache, NULL); + mysql_cond_init(key_COND_thread_cache, &COND_thread_cache, NULL); + mysql_cond_init(key_COND_flush_thread_cache, &COND_flush_thread_cache, NULL); mysql_cond_init(key_COND_manager, &COND_manager, NULL); #ifdef HAVE_REPLICATION mysql_mutex_init(key_LOCK_rpl_status, &LOCK_rpl_status, MY_MUTEX_INIT_FAST); @@ -4337,8 +4336,8 @@ static void handle_connections_methods() unireg_abort(1); // Will not return } - pthread_mutex_lock(&LOCK_thread_count); - (void) pthread_cond_init(&COND_handler_count,NULL); + mysql_mutex_lock(&LOCK_thread_count); + mysql_cond_init(key_COND_handler_count, &COND_handler_count, NULL); handler_count=0; if (hPipe != INVALID_HANDLE_VALUE) { @@ -4377,17 +4376,17 @@ static void handle_connections_methods() #endif while (handler_count > 0) - pthread_cond_wait(&COND_handler_count,&LOCK_thread_count); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_wait(&COND_handler_count, &LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_VOID_RETURN; } void decrement_handler_count() { - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); handler_count--; - pthread_cond_signal(&COND_handler_count); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_signal(&COND_handler_count); + mysql_mutex_unlock(&LOCK_thread_count); my_thread_end(); } #else @@ -4834,21 +4833,21 @@ int main(int argc, char **argv) #ifdef EXTRA_DEBUG2 sql_print_error("Before Lock_thread_count"); #endif - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); DBUG_PRINT("quit", ("Got thread_count mutex")); select_thread_in_use=0; // For close_connections - (void) pthread_mutex_unlock(&LOCK_thread_count); - (void) pthread_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); #ifdef EXTRA_DEBUG2 sql_print_error("After lock_thread_count"); #endif #endif /* __WIN__ */ /* Wait until cleanup is done */ - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); while (!ready_to_exit) - pthread_cond_wait(&COND_thread_count,&LOCK_thread_count); - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_wait(&COND_thread_count, &LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); #if defined(__WIN__) && !defined(EMBEDDED_LIBRARY) if (Service.IsNT() && start_mode) @@ -5122,13 +5121,13 @@ static void bootstrap(MYSQL_FILE *file) DBUG_VOID_RETURN; } /* Wait for thread to die */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); while (in_bootstrap) { - pthread_cond_wait(&COND_thread_count, &LOCK_thread_count); + mysql_cond_wait(&COND_thread_count, &LOCK_thread_count); DBUG_PRINT("quit",("One thread died (count=%u)",thread_count)); } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); #else thd->mysql= 0; do_handle_bootstrap(thd); @@ -5166,10 +5165,10 @@ static bool read_init_file(char *file_name) void handle_connection_in_main_thread(THD *thd) { - safe_mutex_assert_owner(&LOCK_thread_count); + mysql_mutex_assert_owner(&LOCK_thread_count); thread_cache_size=0; // Safety threads.append(thd); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); thd->start_utime= my_micro_time(); do_handle_one_connection(thd); } @@ -5186,7 +5185,7 @@ void create_thread_to_handle_connection(THD *thd) /* Get thread from cache */ thread_cache.append(thd); wake_thread++; - pthread_cond_signal(&COND_thread_cache); + mysql_cond_signal(&COND_thread_cache); } else { @@ -5208,7 +5207,7 @@ void create_thread_to_handle_connection(THD *thd) error)); thread_count--; thd->killed= THD::KILL_CONNECTION; // Safety - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mysql_mutex_lock(&LOCK_connection_count); --connection_count; @@ -5219,15 +5218,15 @@ void create_thread_to_handle_connection(THD *thd) my_snprintf(error_message_buff, sizeof(error_message_buff), ER(ER_CANT_CREATE_THREAD), error); net_send_error(thd, ER_CANT_CREATE_THREAD, error_message_buff, NULL); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); close_connection(thd,0,0); delete thd; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); return; /* purecov: end */ } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_PRINT("info",("Thread created")); } @@ -5275,7 +5274,7 @@ static void create_new_thread(THD *thd) /* Start a new thread to handle connection. */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); /* The initialization of thread_id is done in create_embedded_thd() for @@ -7834,9 +7833,9 @@ void refresh_status(THD *thd) deadlocks. Status reset becomes not atomic, but status data is not exact anyway. */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); max_used_connections= thread_count-delayed_insert_threads; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } @@ -7882,7 +7881,7 @@ PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_prep_xids, key_mutex_slave_reporting_capability_err_lock, key_relay_log_info_data_lock, key_relay_log_info_log_space_lock, key_relay_log_info_run_lock, key_structure_guard_mutex, key_TABLE_SHARE_mutex, key_LOCK_error_messages, - key_LOG_INFO_lock; + key_LOG_INFO_lock, key_LOCK_thread_count; static PSI_mutex_info all_server_mutexes[]= { @@ -7935,7 +7934,8 @@ static PSI_mutex_info all_server_mutexes[]= { &key_structure_guard_mutex, "Query_cache::structure_guard_mutex", 0}, { &key_TABLE_SHARE_mutex, "TABLE_SHARE::mutex", 0}, { &key_LOCK_error_messages, "LOCK_error_messages", PSI_FLAG_GLOBAL}, - { &key_LOG_INFO_lock, "LOG_INFO::lock", 0} + { &key_LOG_INFO_lock, "LOG_INFO::lock", 0}, + { &key_LOCK_thread_count, "LOCK_thread_count", PSI_FLAG_GLOBAL} }; PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, @@ -7964,10 +7964,14 @@ PSI_cond_key key_BINLOG_COND_prep_xids, key_BINLOG_update_cond, key_master_info_start_cond, key_master_info_stop_cond, key_relay_log_info_data_cond, key_relay_log_info_log_space_cond, key_relay_log_info_start_cond, key_relay_log_info_stop_cond, - key_TABLE_SHARE_cond, key_user_level_lock_cond; + key_TABLE_SHARE_cond, key_user_level_lock_cond, + key_COND_thread_count, key_COND_thread_cache, key_COND_flush_thread_cache; static PSI_cond_info all_server_conds[]= { +#if (defined(_WIN32) || defined(HAVE_SMEM)) && !defined(EMBEDDED_LIBRARY) + { &key_COND_handler_count, "COND_handler_count", PSI_FLAG_GLOBAL}, +#endif /* _WIN32 || HAVE_SMEM && !EMBEDDED_LIBRARY */ #ifdef HAVE_MMAP { &key_PAGE_cond, "PAGE::cond", 0}, { &key_COND_active, "TC_LOG_MMAP::COND_active", 0}, @@ -7992,7 +7996,10 @@ static PSI_cond_info all_server_conds[]= { &key_relay_log_info_start_cond, "Relay_log_info::start_cond", 0}, { &key_relay_log_info_stop_cond, "Relay_log_info::stop_cond", 0}, { &key_TABLE_SHARE_cond, "TABLE_SHARE::cond", 0}, - { &key_user_level_lock_cond, "User_level_lock::cond", 0} + { &key_user_level_lock_cond, "User_level_lock::cond", 0}, + { &key_COND_thread_count, "COND_thread_count", PSI_FLAG_GLOBAL}, + { &key_COND_thread_cache, "COND_thread_cache", PSI_FLAG_GLOBAL}, + { &key_COND_flush_thread_cache, "COND_flush_thread_cache", PSI_FLAG_GLOBAL} }; PSI_thread_key key_thread_bootstrap, key_thread_delayed_insert, diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 5f206f194e4..e10288552a5 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -83,9 +83,9 @@ static int init_failsafe_rpl_thread(THD* thd) my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; thd->max_client_packet_length=thd->net.max_packet; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if (init_thr_lock() || thd->store_globals()) { @@ -413,9 +413,9 @@ mi_inited: err: mysql_mutex_unlock(log_lock); end_io_cache(&log); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->current_linfo = 0; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if (file >= 0) mysql_file_close(file, MYF(MY_WME)); if (last_file >= 0 && last_file != file) diff --git a/sql/scheduler.cc b/sql/scheduler.cc index b05bdf4756f..b308b84eb19 100644 --- a/sql/scheduler.cc +++ b/sql/scheduler.cc @@ -1,4 +1,4 @@ -/* Copyright (C) 2007 MySQL AB +/* Copyright (C) 2007 MySQL AB, 2008-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -54,7 +54,7 @@ scheduler_functions::scheduler_functions() static bool no_threads_end(THD *thd, bool put_in_cache) { unlink_thd(thd); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); return 1; // Abort handle_one_connection } diff --git a/sql/slave.cc b/sql/slave.cc index 654ccfe72b5..97f394bf19c 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -1969,9 +1969,9 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) thd->enable_slow_log= opt_log_slow_slave_statements; set_slave_thread_options(thd); thd->client_capabilities = CLIENT_LOCAL_FILES; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_EXECUTE_IF("simulate_io_slave_error_on_init", simulate_error|= (1 << SLAVE_THD_IO);); @@ -2669,9 +2669,9 @@ pthread_handler_t handle_slave_io(void *arg) sql_print_error("Failed during slave I/O thread initialization"); goto err; } - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); threads.append(thd); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mi->slave_running = 1; mi->abort_slave = 0; mysql_mutex_unlock(&mi->run_lock); @@ -2968,10 +2968,10 @@ err: DBUG_ASSERT(thd->net.buff != 0); net_end(&thd->net); // destructor will not free it, because net.vio is 0 close_thread_tables(thd); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); THD_CHECK_SENTRY(thd); delete thd; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mi->abort_slave= 0; mi->slave_running= 0; mi->io_thd= 0; @@ -3086,9 +3086,9 @@ pthread_handler_t handle_slave_sql(void *arg) thd->init_for_queries(); thd->temporary_tables = rli->save_temporary_tables; // restore temp tables set_thd_in_use_temporary_tables(rli); // (re)set sql_thd in use for saved temp tables - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); threads.append(thd); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); /* We are going to set slave_running to 1. Assuming slave I/O thread is alive and connected, this is going to make Seconds_Behind_Master be 0 @@ -3332,10 +3332,10 @@ the slave SQL thread with \"SLAVE START\". We stopped at log \ THD_CHECK_SENTRY(thd); rli->sql_thd= 0; set_thd_in_use_temporary_tables(rli); // (re)set sql_thd in use for saved temp tables - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); THD_CHECK_SENTRY(thd); delete thd; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); /* Note: the order of the broadcast and unlock calls below (first broadcast, then unlock) is important. Otherwise a killer_thread can execute between the calls and diff --git a/sql/slave.h b/sql/slave.h index 421f838f188..f01eccf09f4 100644 --- a/sql/slave.h +++ b/sql/slave.h @@ -158,7 +158,7 @@ int start_slave_threads(bool need_slave_mutex, bool wait_for_start, cond_lock is usually same as start_lock. It is needed for the case when start_lock is 0 which happens if start_slave_thread() is called already inside the start_lock section, but at the same time we want a - pthread_cond_wait() on start_cond,start_lock + mysql_cond_wait() on start_cond, start_lock */ int start_slave_thread( #ifdef HAVE_PSI_INTERFACE diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 6e69b2e39a4..dd761490753 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1,4 +1,4 @@ -/* Copyright 2002-2008 MySQL AB, 2008 Sun Microsystems, Inc. +/* Copyright 2002-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1767,9 +1767,9 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, as one select and not resetting THD::user_var_events before each invocation. */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); q= global_query_id; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mysql_bin_log.start_union_events(thd, q + 1); binlog_save_options= thd->variables.option_bits; thd->variables.option_bits&= ~OPTION_BIN_LOG; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index c774cb4f3ad..748052b2985 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1808,11 +1808,11 @@ public: mysql_mutex_init(key_delayed_insert_mutex, &mutex, MY_MUTEX_INIT_FAST); mysql_cond_init(key_delayed_insert_cond, &cond, NULL); mysql_cond_init(key_delayed_insert_cond_client, &cond_client, NULL); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); delayed_insert_threads++; delayed_lock= global_system_variables.low_priority_updates ? TL_WRITE_LOW_PRIORITY : TL_WRITE; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } ~Delayed_insert() { @@ -1822,7 +1822,7 @@ public: delete row; if (table) close_thread_tables(&thd); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); mysql_mutex_destroy(&mutex); mysql_cond_destroy(&cond); mysql_cond_destroy(&cond_client); @@ -1831,8 +1831,8 @@ public: thd.security_ctx->user= thd.security_ctx->host=0; thread_count--; delayed_insert_threads--; - pthread_mutex_unlock(&LOCK_thread_count); - pthread_cond_broadcast(&COND_thread_count); /* Tell main we are ready */ + mysql_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); /* Tell main we are ready */ } /* The following is for checking when we can delete ourselves */ @@ -1965,9 +1965,9 @@ bool delayed_get_table(THD *thd, TABLE_LIST *table_list) { if (!(di= new Delayed_insert())) goto end_create; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thread_count++; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); di->thd.set_db(table_list->db, (uint) strlen(table_list->db)); di->thd.set_query(my_strdup(table_list->table_name, MYF(MY_WME | ME_FATALERROR)), 0); @@ -2345,12 +2345,12 @@ pthread_handler_t handle_delayed_insert(void *arg) pthread_detach_this_thread(); /* Add thread to THD list so that's it's visible in 'show processlist' */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->thread_id= thd->variables.pseudo_thread_id= thread_id++; thd->set_current_time(); threads.append(thd); thd->killed=abort_loop ? THD::KILL_CONNECTION : THD::NOT_KILLED; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); mysql_thread_set_psi_id(thd->thread_id); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 49d18cbe5d7..d8e82c3e0d1 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -556,11 +556,11 @@ end: delete thd; #ifndef EMBEDDED_LIBRARY - (void) pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thread_count--; in_bootstrap= FALSE; - (void) pthread_cond_broadcast(&COND_thread_count); - (void) pthread_mutex_unlock(&LOCK_thread_count); + mysql_cond_broadcast(&COND_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); my_thread_end(); pthread_exit(0); #endif @@ -7003,7 +7003,7 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query) uint error=ER_NO_SUCH_THREAD; DBUG_ENTER("kill_one_thread"); DBUG_PRINT("enter", ("id=%lu only_kill=%d", id, only_kill_query)); - pthread_mutex_lock(&LOCK_thread_count); // For unlink from list + mysql_mutex_lock(&LOCK_thread_count); // For unlink from list I_List_iterator it(threads); while ((tmp=it++)) { @@ -7015,7 +7015,7 @@ uint kill_one_thread(THD *thd, ulong id, bool only_kill_query) break; } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if (tmp) { diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 960a0adab2e..51a8ba12358 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -214,7 +214,7 @@ void adjust_linfo_offsets(my_off_t purge_offset) { THD *tmp; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); I_List_iterator it(threads); while ((tmp=it++)) @@ -235,7 +235,7 @@ void adjust_linfo_offsets(my_off_t purge_offset) mysql_mutex_unlock(&linfo->lock); } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); } @@ -245,7 +245,7 @@ bool log_in_use(const char* log_name) THD *tmp; bool result = 0; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); I_List_iterator it(threads); while ((tmp=it++)) @@ -262,7 +262,7 @@ bool log_in_use(const char* log_name) } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); return result; } @@ -516,9 +516,9 @@ void mysql_binlog_send(THD* thd, char* log_ident, my_off_t pos, goto err; } - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->current_linfo = &linfo; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if ((file=open_binlog(&log, log_file_name, &errmsg)) < 0) { @@ -967,9 +967,9 @@ end: RUN_HOOK(binlog_transmit, transmit_stop, (thd, flags)); my_eof(thd); thd_proc_info(thd, "Waiting to finalize termination"); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->current_linfo = 0; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_VOID_RETURN; err: @@ -983,9 +983,9 @@ err: this mutex will make sure that it never tried to update our linfo after we return from this stack frame */ - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->current_linfo = 0; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if (file >= 0) mysql_file_close(file, MYF(MY_WME)); @@ -1296,7 +1296,7 @@ err: void kill_zombie_dump_threads(uint32 slave_server_id) { - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); I_List_iterator it(threads); THD *tmp; @@ -1309,7 +1309,7 @@ void kill_zombie_dump_threads(uint32 slave_server_id) break; } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if (tmp) { /* @@ -1724,9 +1724,9 @@ bool mysql_show_binlog_events(THD* thd) goto err; } - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->current_linfo = &linfo; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); if ((file=open_binlog(&log, linfo.log_file_name, &errmsg)) < 0) goto err; @@ -1812,9 +1812,9 @@ err: else my_eof(thd); - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); thd->current_linfo = 0; - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_RETURN(ret); } diff --git a/sql/sql_show.cc b/sql/sql_show.cc index d562739f913..9e34c1f2d17 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1727,7 +1727,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF)) DBUG_VOID_RETURN; - pthread_mutex_lock(&LOCK_thread_count); // For unlink from list + mysql_mutex_lock(&LOCK_thread_count); // For unlink from list if (!thd->killed) { I_List_iterator it(threads); @@ -1780,7 +1780,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose) } } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); thread_info *thd_info; time_t now= my_time(0); @@ -1819,7 +1819,7 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) user= thd->security_ctx->master_access & PROCESS_ACL ? NullS : thd->security_ctx->priv_user; - pthread_mutex_lock(&LOCK_thread_count); + mysql_mutex_lock(&LOCK_thread_count); if (!thd->killed) { @@ -1894,13 +1894,13 @@ int fill_schema_processlist(THD* thd, TABLE_LIST* tables, COND* cond) if (schema_table_store_record(thd, table)) { - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_RETURN(1); } } } - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_RETURN(0); } @@ -2267,7 +2267,7 @@ void calc_sum_of_all_status(STATUS_VAR *to) DBUG_ENTER("calc_sum_of_all_status"); /* Ensure that thread id not killed during loop */ - pthread_mutex_lock(&LOCK_thread_count); // For unlink from list + mysql_mutex_lock(&LOCK_thread_count); // For unlink from list I_List_iterator it(threads); THD *tmp; @@ -2279,7 +2279,7 @@ void calc_sum_of_all_status(STATUS_VAR *to) while ((tmp= it++)) add_to_status(to, &tmp->status_var); - pthread_mutex_unlock(&LOCK_thread_count); + mysql_mutex_unlock(&LOCK_thread_count); DBUG_VOID_RETURN; } diff --git a/storage/perfschema/CMakeLists.txt b/storage/perfschema/CMakeLists.txt new file mode 100644 index 00000000000..dbfab3b6749 --- /dev/null +++ b/storage/perfschema/CMakeLists.txt @@ -0,0 +1,79 @@ +# Copyright (C) 2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +INCLUDE("${PROJECT_SOURCE_DIR}/storage/mysql_storage_engine.cmake") +INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/sql + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/extra/yassl/include) + +ADD_DEFINITIONS(-DMYSQL_SERVER) + +SET(PERFSCHEMA_SOURCES ha_perfschema.h + pfs_column_types.h + pfs_column_values.h + pfs_events_waits.h + pfs_global.h + pfs.h + pfs_instr.h + pfs_instr_class.h + pfs_lock.h + pfs_atomic.h + pfs_server.h + pfs_stat.h + pfs_engine_table.h + pfs_timer.h + table_all_instr.h + table_events_waits.h + table_events_waits_summary.h + table_file_instances.h + table_file_summary.h + table_performance_timers.h + table_processlist.h + table_setup_consumers.h + table_setup_instruments.h + table_setup_objects.h + table_setup_timers.h + table_sync_instances.h + ha_perfschema.cc + pfs.cc + pfs_column_values.cc + pfs_events_waits.cc + pfs_global.cc + pfs_instr.cc + pfs_instr_class.cc + pfs_server.cc + pfs_engine_table.cc + pfs_timer.cc + table_all_instr.cc + table_events_waits.cc + table_events_waits_summary.cc + table_file_instances.cc + table_file_summary.cc + table_performance_timers.cc + table_processlist.cc + table_setup_consumers.cc + table_setup_instruments.cc + table_setup_objects.cc + table_setup_timers.cc + table_sync_instances.cc + pfs_atomic.cc + pfs_check.cc +) + +MYSQL_STORAGE_ENGINE(PERFSCHEMA) diff --git a/storage/perfschema/Makefile.am b/storage/perfschema/Makefile.am new file mode 100644 index 00000000000..8c30c812bc6 --- /dev/null +++ b/storage/perfschema/Makefile.am @@ -0,0 +1,76 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +#called from the top level Makefile + +SUBDIRS = . unittest + +MYSQLDATAdir = $(localstatedir) +MYSQLSHAREdir = $(pkgdatadir) +MYSQLBASEdir= $(prefix) +MYSQLLIBdir= $(pkglibdir) +pkgplugindir = $(pkglibdir)/plugin +INCLUDES = -I$(top_srcdir)/include -I$(top_builddir)/include \ + -I$(top_srcdir)/regex \ + -I$(top_srcdir)/sql \ + -I$(srcdir) +WRAPLIBS= + +LDADD = + +DEFS = -DMYSQL_SERVER @DEFS@ + + +noinst_HEADERS = ha_perfschema.h pfs_engine_table.h pfs.h pfs_server.h \ + pfs_global.h pfs_instr_class.h pfs_instr.h \ + pfs_column_types.h pfs_column_values.h \ + table_setup_instruments.h table_performance_timers.h \ + table_setup_timers.h \ + table_setup_consumers.h table_events_waits.h \ + pfs_events_waits.h pfs_timer.h table_processlist.h \ + table_sync_instances.h \ + table_events_waits_summary.h pfs_stat.h \ + table_all_instr.h \ + table_file_instances.h table_file_summary.h \ + table_setup_objects.h pfs_lock.h pfs_atomic.h + +PSE_SOURCES = ha_perfschema.cc pfs_engine_table.cc pfs.cc pfs_server.cc \ + pfs_global.cc pfs_instr_class.cc pfs_instr.cc \ + pfs_column_values.cc \ + table_setup_instruments.cc table_performance_timers.cc \ + table_setup_timers.cc \ + table_setup_consumers.cc table_events_waits.cc \ + pfs_events_waits.cc pfs_timer.cc table_processlist.cc \ + table_sync_instances.cc \ + table_events_waits_summary.cc \ + table_all_instr.cc \ + table_file_instances.cc table_file_summary.cc \ + table_setup_objects.cc pfs_atomic.cc pfs_check.cc + +EXTRA_LIBRARIES = libperfschema.a +noinst_LIBRARIES = @plugin_perfschema_static_target@ + +libperfschema_a_SOURCES= $(PSE_SOURCES) + +EXTRA_DIST = plug.in CMakeLists.txt + +unittests = unittest + +test: + perl $(top_srcdir)/unittest/unit.pl run $(unittests) + +test-verbose: + HARNESS_VERBOSE=1 perl $(top_srcdir)/unittest/unit.pl run $(unittests) + diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc new file mode 100644 index 00000000000..68e1f3f3a11 --- /dev/null +++ b/storage/perfschema/ha_perfschema.cc @@ -0,0 +1,382 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/ha_perfschema.cc + Performance schema storage engine (implementation). +*/ + +#include "mysql_priv.h" +#include "ha_perfschema.h" +#include "mysql/plugin.h" +#include "pfs_engine_table.h" +#include "pfs_column_values.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" + +handlerton *pfs_hton= NULL; + +static handler* pfs_create_handler(handlerton *hton, + TABLE_SHARE *table, + MEM_ROOT *mem_root) +{ + return new (mem_root) ha_perfschema(hton, table); +} + +static int compare_database_names(const char *name1, const char *name2) +{ + if (lower_case_table_names) + return strcasecmp(name1, name2); + return strcmp(name1, name2); +} + +static const PFS_engine_table_share* +find_table_share(const char *db, const char *name) +{ + DBUG_ENTER("find_table_share"); + + if (compare_database_names(db, PERFORMANCE_SCHEMA_str.str) != 0) + DBUG_RETURN(NULL); + + const PFS_engine_table_share* result; + result= PFS_engine_table::find_engine_table_share(name); + DBUG_RETURN(result); +} + +static int pfs_init_func(void *p) +{ + DBUG_ENTER("pfs_init_func"); + + pfs_hton= reinterpret_cast (p); + + pfs_hton->state= SHOW_OPTION_YES; + pfs_hton->create= pfs_create_handler; + pfs_hton->show_status= pfs_show_status; + pfs_hton->flags= HTON_ALTER_NOT_SUPPORTED | + HTON_TEMPORARY_NOT_SUPPORTED | + HTON_NO_PARTITION; + + /* + As long as the server implementation keeps using legacy_db_type, + as for example in mysql_truncate(), + we can not rely on the fact that different mysqld process will assign + consistently the same legacy_db_type for a given storage engine name. + In particular, using different --loose-skip-xxx options between + ./mysqld --bootstrap + ./mysqld + creates bogus .frm forms when bootstrapping the performance schema, + if we rely on ha_initialize_handlerton to assign a really dynamic value. + To fix this, a dedicated DB_TYPE is officially assigned to + the performance schema. See Bug#43039. + */ + pfs_hton->db_type= DB_TYPE_PERFORMANCE_SCHEMA; + + PFS_engine_table_share::init_all_locks(); + + DBUG_RETURN(0); +} + +static int pfs_done_func(void *p) +{ + DBUG_ENTER("pfs_done_func"); + + pfs_hton= NULL; + + PFS_engine_table_share::delete_all_locks(); + + DBUG_RETURN(0); +} + +static struct st_mysql_show_var pfs_status_vars[]= +{ + {"Performance_schema_mutex_classes_lost", + (char*) &mutex_class_lost, SHOW_LONG_NOFLUSH}, + {"Performance_schema_rwlock_classes_lost", + (char*) &rwlock_class_lost, SHOW_LONG_NOFLUSH}, + {"Performance_schema_cond_classes_lost", + (char*) &cond_class_lost, SHOW_LONG_NOFLUSH}, + {"Performance_schema_thread_classes_lost", + (char*) &thread_class_lost, SHOW_LONG_NOFLUSH}, + {"Performance_schema_file_classes_lost", + (char*) &file_class_lost, SHOW_LONG_NOFLUSH}, + {"Performance_schema_mutex_instances_lost", + (char*) &mutex_lost, SHOW_LONG}, + {"Performance_schema_rwlock_instances_lost", + (char*) &rwlock_lost, SHOW_LONG}, + {"Performance_schema_cond_instances_lost", + (char*) &cond_lost, SHOW_LONG}, + {"Performance_schema_thread_instances_lost", + (char*) &thread_lost, SHOW_LONG}, + {"Performance_schema_file_instances_lost", + (char*) &file_lost, SHOW_LONG}, + {"Performance_schema_file_handles_lost", + (char*) &file_handle_lost, SHOW_LONG}, + {"Performance_schema_locker_lost", + (char*) &locker_lost, SHOW_LONG}, + /* table shares, can be flushed */ + {"Performance_schema_table_instances_lost", + (char*) &table_share_lost, SHOW_LONG}, + /* table handles, can be flushed */ + {"Performance_schema_table_handles_lost", + (char*) &table_lost, SHOW_LONG}, + {NullS, NullS, SHOW_LONG} +}; + +struct st_mysql_storage_engine pfs_storage_engine= +{ MYSQL_HANDLERTON_INTERFACE_VERSION }; + +const char* pfs_engine_name= "PERFORMANCE_SCHEMA"; + +mysql_declare_plugin(perfschema) +{ + MYSQL_STORAGE_ENGINE_PLUGIN, + &pfs_storage_engine, + pfs_engine_name, + "Marc Alff, Sun Microsystems", + "Performance Schema", + PLUGIN_LICENSE_GPL, + pfs_init_func, /* Plugin Init */ + pfs_done_func, /* Plugin Deinit */ + 0x0001 /* 0.1 */, + pfs_status_vars, /* status variables */ + NULL, /* system variables */ + NULL /* config options */ +} +mysql_declare_plugin_end; + +ha_perfschema::ha_perfschema(handlerton *hton, TABLE_SHARE *share) + : handler(hton, share), m_table_share(NULL), m_table(NULL) +{} + +ha_perfschema::~ha_perfschema() +{} + +static const char *ha_pfs_exts[]= { + NullS +}; + +const char **ha_perfschema::bas_ext() const +{ + return ha_pfs_exts; +} + +int ha_perfschema::open(const char *name, int mode, uint test_if_locked) +{ + DBUG_ENTER("ha_perfschema::open"); + + m_table_share= find_table_share(table_share->db.str, + table_share->table_name.str); + if (! m_table_share) + DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); + + thr_lock_data_init(m_table_share->m_thr_lock_ptr, &m_thr_lock, NULL); + ref_length= m_table_share->m_ref_length; + + psi_open(); + + DBUG_RETURN(0); +} + +int ha_perfschema::close(void) +{ + DBUG_ENTER("ha_perfschema::close"); + m_table_share= NULL; + delete m_table; + m_table= NULL; + + psi_close(); + + DBUG_RETURN(0); +} + +int ha_perfschema::write_row(uchar *buf) +{ + int result; + + DBUG_ENTER("ha_perfschema::write_row"); + + ha_statistic_increment(&SSV::ha_write_count); + DBUG_ASSERT(m_table_share); + + if (m_table_share->m_write_row) + result= m_table_share->m_write_row(table, buf, table->field); + else + { + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + result= HA_ERR_WRONG_COMMAND; + } + + DBUG_RETURN(result); +} + +void ha_perfschema::use_hidden_primary_key(void) +{ + /* + This is also called in case of row based replication, + see TABLE::mark_columns_needed_for_update(). + Add all columns to the read set, but do not touch the write set, + as some columns in the SETUP_ tables are not writable. + */ + table->column_bitmaps_set_no_signal(&table->s->all_set, table->write_set); +} + +int ha_perfschema::update_row(const uchar *old_data, uchar *new_data) +{ + DBUG_ENTER("ha_perfschema::update_row"); + + DBUG_ASSERT(m_table); + int result= m_table->update_row(table, old_data, new_data, table->field); + DBUG_RETURN(result); +} + +int ha_perfschema::rnd_init(bool scan) +{ + int result; + DBUG_ENTER("ha_perfschema::rnd_init"); + + DBUG_ASSERT(m_table_share); + DBUG_ASSERT(m_table_share->m_open_table != NULL); + + stats.records= 0; + if (m_table == NULL) + m_table= m_table_share->m_open_table(); + else + m_table->reset_position(); + + result= m_table ? 0 : HA_ERR_OUT_OF_MEM; + DBUG_RETURN(result); +} + +int ha_perfschema::rnd_end(void) +{ + DBUG_ENTER("ha_perfschema::rnd_end"); + DBUG_ASSERT(m_table); + delete m_table; + m_table= NULL; + DBUG_RETURN(0); +} + +int ha_perfschema::rnd_next(uchar *buf) +{ + DBUG_ENTER("ha_perfschema::rnd_next"); + + DBUG_ASSERT(m_table); + int result= m_table->rnd_next(); + if (result == 0) + { + result= m_table->read_row(table, buf, table->field); + if (result == 0) + stats.records++; + } + DBUG_RETURN(result); +} + +void ha_perfschema::position(const uchar *record) +{ + DBUG_ENTER("ha_perfschema::position"); + + DBUG_ASSERT(m_table); + m_table->get_position(ref); + DBUG_VOID_RETURN; +} + +int ha_perfschema::rnd_pos(uchar *buf, uchar *pos) +{ + DBUG_ENTER("ha_perfschema::rnd_pos"); + + DBUG_ASSERT(m_table); + int result= m_table->rnd_pos(pos); + if (result == 0) + result= m_table->read_row(table, buf, table->field); + DBUG_RETURN(result); +} + +int ha_perfschema::info(uint flag) +{ + DBUG_ENTER("ha_perfschema::info"); + DBUG_ASSERT(m_table_share); + if (flag & HA_STATUS_VARIABLE) + stats.records= m_table_share->m_records; + if (flag & HA_STATUS_CONST) + ref_length= m_table_share->m_ref_length; + DBUG_RETURN(0); +} + +int ha_perfschema::delete_all_rows(void) +{ + int result; + + DBUG_ENTER("ha_perfschema::delete_all_rows"); + + DBUG_ASSERT(m_table_share); + if (m_table_share->m_delete_all_rows) + result= m_table_share->m_delete_all_rows(); + else + { + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + result= HA_ERR_WRONG_COMMAND; + } + DBUG_RETURN(result); +} + +THR_LOCK_DATA **ha_perfschema::store_lock(THD *thd, + THR_LOCK_DATA **to, + enum thr_lock_type lock_type) +{ + if (lock_type != TL_IGNORE && m_thr_lock.type == TL_UNLOCK) + m_thr_lock.type= lock_type; + *to++= &m_thr_lock; + m_thr_lock.m_psi= m_psi; + return to; +} + +int ha_perfschema::delete_table(const char *name) +{ + DBUG_ENTER("ha_perfschema::delete_table"); + DBUG_RETURN(0); +} + +int ha_perfschema::rename_table(const char * from, const char * to) +{ + DBUG_ENTER("ha_perfschema::rename_table "); + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); +} + +int ha_perfschema::create(const char *name, TABLE *table_arg, + HA_CREATE_INFO *create_info) +{ + DBUG_ENTER("ha_perfschema::create"); + DBUG_ASSERT(table_arg); + DBUG_ASSERT(table_arg->s); + if (find_table_share(table_arg->s->db.str, + table_arg->s->table_name.str)) + { + /* + Attempting to create a known performance schema table. + Allowing the create, to create .FRM files, + for the initial database install, and mysql_upgrade. + This should fail once .FRM are removed. + */ + DBUG_RETURN(0); + } + /* + This is not a general purpose engine. + Failure to CREATE TABLE is the expected result. + */ + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + DBUG_RETURN(HA_ERR_WRONG_COMMAND); +} + diff --git a/storage/perfschema/ha_perfschema.h b/storage/perfschema/ha_perfschema.h new file mode 100644 index 00000000000..146b258ff47 --- /dev/null +++ b/storage/perfschema/ha_perfschema.h @@ -0,0 +1,159 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef HA_PERFSCHEMA_H +#define HA_PERFSCHEMA_H + +#ifdef USE_PRAGMA_INTERFACE +#pragma interface /* gcc class implementation */ +#endif + +/** + @file storage/perfschema/ha_perfschema.h + Performance schema storage engine (declarations). + + @defgroup Performance_schema_engine Performance Schema Engine + @ingroup Performance_schema_implementation + @{ +*/ +struct PFS_engine_table_share; +class PFS_engine_table; +extern const char *pfs_engine_name; + +/** A handler for a PERFORMANCE_SCHEMA table. */ +class ha_perfschema : public handler +{ +public: + ha_perfschema(handlerton *hton, TABLE_SHARE *share); + + ~ha_perfschema(); + + const char *table_type(void) const { return pfs_engine_name; } + + const char *index_type(uint) { return ""; } + + const char **bas_ext(void) const; + + /** Capabilities of the performance schema tables. */ + ulonglong table_flags(void) const + { + /* + About HA_FAST_KEY_READ: + + The storage engine ::rnd_pos() method is fast to locate records by key, + so HA_FAST_KEY_READ is technically true, but the record content can be + overwritten between ::rnd_next() and ::rnd_pos(), because all the P_S + data is volatile. + The HA_FAST_KEY_READ flag is not advertised, to force the optimizer + to cache records instead, to provide more consistent records. + For example, consider the following statement: + - select * from P_S.EVENTS_WAITS_HISTORY_LONG where THREAD_ID= + order by ... + With HA_FAST_KEY_READ, it can return records where "THREAD_ID=" + is false, because the where clause was evaluated to true after + ::rnd_pos(), then the content changed, then the record was fetched by + key using ::rnd_pos(). + Without HA_FAST_KEY_READ, the optimizer reads all columns and never + calls ::rnd_pos(), so it is guaranteed to return only thread + records. + */ + return HA_NO_TRANSACTIONS | HA_REC_NOT_IN_SEQ | HA_NO_AUTO_INCREMENT | + HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NO_BLOBS; + } + + /** + Operations supported by indexes. + None, there are no indexes. + */ + ulong index_flags(uint , uint , bool ) const + { return 0; } + + uint max_supported_record_length(void) const + { return HA_MAX_REC_LENGTH; } + + uint max_supported_keys(void) const + { return 0; } + + uint max_supported_key_parts(void) const + { return 0; } + + uint max_supported_key_length(void) const + { return 0; } + + ha_rows estimate_rows_upper_bound(void) + { return HA_POS_ERROR; } + + double scan_time(void) + { return 1.0; } + + double read_time(ha_rows) + { return 1.0; } + + int open(const char *name, int mode, uint test_if_locked); + + int close(void); + + int write_row(uchar *buf); + + void use_hidden_primary_key(); + + int update_row(const uchar *old_data, uchar *new_data); + + int rnd_init(bool scan); + + int rnd_end(void); + + int rnd_next(uchar *buf); + + int rnd_pos(uchar *buf, uchar *pos); + + void position(const uchar *record); + + int info(uint); + + int delete_all_rows(void); + + int delete_table(const char *from); + + int rename_table(const char * from, const char * to); + + int create(const char *name, TABLE *form, + HA_CREATE_INFO *create_info); + + THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, + enum thr_lock_type lock_type); + + virtual uint8 table_cache_type(void) + { return HA_CACHE_TBL_NOCACHE; } + + virtual my_bool register_query_cache_table + (THD *, char *, uint , qc_engine_callback *engine_callback, ulonglong *) + { + *engine_callback= 0; + return FALSE; + } + +private: + /** MySQL lock */ + THR_LOCK_DATA m_thr_lock; + /** Performance schema table share for this table handler. */ + const PFS_engine_table_share *m_table_share; + /** Performance schema table cursor. */ + PFS_engine_table *m_table; +}; + +/** @} */ +#endif + diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc new file mode 100644 index 00000000000..01b4b3711c1 --- /dev/null +++ b/storage/perfschema/pfs.cc @@ -0,0 +1,2053 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs.cc + The performance schema implementation of all instruments. +*/ + +#include "my_global.h" +#include "pfs.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" +#include "pfs_global.h" +#include "pfs_column_values.h" +#include "pfs_timer.h" +#include "pfs_events_waits.h" + +/* Pending WL#4895 PERFORMANCE_SCHEMA Instrumenting Table IO */ +#undef HAVE_TABLE_WAIT + +/** + @page PAGE_PERFORMANCE_SCHEMA The Performance Schema main page + MySQL PERFORMANCE_SCHEMA implementation. + + @section INTRO Introduction + The PERFORMANCE_SCHEMA is a way to introspect the internal execution of + the server at runtime. + The performance schema focuses primarily on performance data, + as opposed to the INFORMATION_SCHEMA whose purpose is to inspect metadata. + + From a user point of view, the performance schema consists of: + - a dedicated database schema, named PERFORMANCE_SCHEMA, + - SQL tables, used to query the server internal state or change + configuration settings. + + From an implementation point of view, the performance schema is a dedicated + Storage Engine which exposes data collected by 'Instrumentation Points' + placed in the server code. + + @section INTERFACES Multiple interfaces + + The performance schema exposes many different interfaces, + for different components, and for different purposes. + + @subsection INT_INSTRUMENTING Instrumenting interface + + All the data representing the server internal state exposed + in the performance schema must be first collected: + this is the role of the instrumenting interface. + The instrumenting interface is a coding interface provided + by implementors (of the performance schema) to implementors + (of the server or server components). + + This interface is available to: + - C implementations + - C++ implementations + - the core SQL layer (/sql) + - the mysys library (/mysys) + - MySQL plugins, including storage engines, + - third party plugins, including third party storage engines. + + For details, see the @ref PAGE_INSTRUMENTATION_INTERFACE + "instrumentation interface page". + + @subsection INT_COMPILING Compiling interface + + The implementation of the performance schema can be enabled or disabled at + build time, when building MySQL from the source code. + + When building with the performance schema code, some compilation flags + are available to change the default values used in the code, if required. + + For more details, see: + @verbatim ./configure --help @endverbatim + + To compile with the performance schema: + @verbatim ./configure --with-perfschema @endverbatim + + The implementation of all the compiling options is located in + @verbatim ./storage/perfschema/plug.in @endverbatim + + @subsection INT_STARTUP Server startup interface + + The server startup interface consists of the "./mysqld ..." + command line used to start the server. + When the performance schema is compiled in the server binary, + extra command line options are available. + + These extra start options allow the DBA to: + - enable or disable the performance schema + - specify some sizing parameters. + + To see help for the performance schema startup options, see: + @verbatim ./sql/mysqld --verbose --help @endverbatim + + The implementation of all the startup options is located in + @verbatim ./sql/mysqld.cc, my_long_options[] @endverbatim + + @subsection INT_BOOTSTRAP Server bootstrap interface + + The bootstrap interface is a private interface exposed by + the performance schema, and used by the SQL layer. + Its role is to advertise all the SQL tables natively + supported by the performance schema to the SQL server. + The code consists of creating MySQL tables for the + performance schema itself, and is used in './mysql --bootstrap' + mode when a server is installed. + + The implementation of the database creation script is located in + @verbatim ./scripts/mysql_system_tables.sql @endverbatim + + @subsection INT_CONFIG Runtime configuration interface + + When the performance schema is used at runtime, various configuration + parameters can be used to specify what kind of data is collected, + what kind of aggregations are computed, what kind of timers are used, + what events are timed, etc. + + For all these capabilities, not a single statement or special syntax + was introduced in the parser. + Instead of new SQL statements, the interface consists of DML + (SELECT, INSERT, UPDATE, DELETE) against special "SETUP" tables. + + For example: + @verbatim mysql> update performance_schema.SETUP_INSTRUMENTS + set ENABLED='YES', TIMED='YES'; + Query OK, 234 rows affected (0.00 sec) + Rows matched: 234 Changed: 234 Warnings: 0 @endverbatim + + @subsection INT_STATUS Internal audit interface + + The internal audit interface is provided to the DBA to inspect if the + performance schema code itself is functioning properly. + This interface is necessary because a failure caused while + instrumenting code in the server should not cause failures in the + MySQL server itself, so that the performance schema implementation + never raises errors during runtime execution. + + This auditing interface consists of: + @verbatim SHOW ENGINE PERFORMANCE_SCHEMA STATUS; @endverbatim + It displays data related to the memory usage of the performance schema, + as well as statistics about lost events, if any. + + The SHOW STATUS command is implemented in + @verbatim ./storage/perfschema/pfs_engine_table.cc @endverbatim + + @subsection INT_QUERY Query interface + + The query interface is used to query the internal state of a running server. + It is provided as SQL tables. + + For example: + @verbatim mysql> select * from performance_schema.EVENTS_WAITS_CURRENT; + @endverbatim + + @section DESIGN_PRINCIPLES Design principles + + @subsection PRINCIPLE_BEHAVIOR No behavior changes + + The primary goal of the performance schema is to measure (instrument) the + execution of the server. A good measure should not cause any change + in behavior. + + To achieve this, the overall design of the performance schema complies + with the following very severe design constraints: + + The parser is unchanged. There are no new keywords, no new statements. + This guarantees that existing applications will run the same way with or + without the performance schema. + + All the instrumentation points return "void", there are no error codes. + Even if the performance schema internally fails, execution of the server + code will proceed. + + None of the instrumentation points allocate memory. + All the memory used by the performance schema is pre-allocated at startup, + and is considered "static" during the server life time. + + None of the instrumentation points use any pthread_mutex, pthread_rwlock, + or pthread_cond (or platform equivalents). + Executing the instrumentation point should not cause thread scheduling to + change in the server. + + In other words, the implementation of the instrumentation points, + including all the code called by the instrumentation points, is: + - malloc free + - mutex free + - rwlock free + + TODO: All the code located in storage/perfschema is malloc free, + but unfortunately the usage of LF_HASH introduces some memory allocation. + This should be revised if possible, to use a lock-free, + malloc-free hash code table. + + @subsection PRINCIPLE_PERFORMANCE No performance hit + + The instrumentation of the server should be as fast as possible. + In cases when there are choices between: + - doing some processing when recording the performance data + in the instrumentation, + - doing some processing when retrieving the performance data, + + priority is given in the design to make the instrumentation faster, + pushing some complexity to data retrieval. + + As a result, some parts of the design, related to: + - the setup code path, + - the query code path, + + might appear to be sub-optimal. + + The criterion used here is to optimize primarily the critical path (data + collection), possibly at the expense of non-critical code paths. + + @subsection PRINCIPLE_NOT_INTRUSIVE Unintrusive instrumentation + + For the performance schema in general to be successful, the barrier + of entry for a developer should be low, so it's easy to instrument code. + + In particular, the instrumentation interface: + - is available for C and C++ code (so it's a C interface), + - does not require parameters that the calling code can't easily provide, + - supports partial instrumentation (for example, instrumenting mutexes does + not require that every mutex is instrumented) + + @subsection PRINCIPLE_EXTENDABLE Extendable instrumentation + + As the content of the performance schema improves, + with more tables exposed and more data collected, + the instrumentation interface will also be augmented + to support instrumenting new concepts. + Existing instrumentations should not be affected when additional + instrumentation is made available, and making a new instrumentation + available should not require existing instrumented code to support it. + + @subsection PRINCIPLE_VERSIONED Versioned instrumentation + + Given that the instrumentation offered by the performance schema will + be augmented with time, when more features are implemented, + the interface itself should be versioned, to keep compatibility + with previous instrumented code. + + For example, after both plugin-A and plugin-B have been instrumented for + mutexes, read write locks and conditions, using the instrumentation + interface, we can anticipate that the instrumentation interface + is expanded to support file based operations. + + Plugin-A, a file based storage engine, will most likely use the expanded + interface and instrument its file usage, using the version 2 + interface, while Plugin-B, a network based storage engine, will not change + its code and not release a new binary. + + When later the instrumentation interface is expanded to support network + based operations (which will define interface version 3), the Plugin-B code + can then be changed to make use of it. + + Note, this is just an example to illustrate the design concept here. + Both mutexes and file instrumentation are already available + since version 1 of the instrumentation interface. + + @subsection PRINCIPLE_DEPLOYMENT Easy deployment + + Internally, we might want every plugin implementation to upgrade the + instrumented code to the latest available, but this will cause additional + work and this is not practical if the code change is monolithic. + + Externally, for third party plugin implementors, asking implementors to + always stay aligned to the latest instrumentation and make new releases, + even when the change does not provide new functionality for them, + is a bad idea. + + For example, requiring a network based engine to re-release because the + instrumentation interface changed for file based operations, will create + too many deployment issues. + + So, the performance schema implementation must support concurrently, + in the same deployment, multiple versions of the instrumentation + interface, and ensure binary compatibility with each version. + + In addition to this, the performance schema can be included or excluded + from the server binary, using build time configuration options. + + Regardless, the following types of deployment are valid: + - a server supporting the performance schema + a storage engine + that is not instrumented + - a server not supporting the performance schema + a storage engine + that is instrumented +*/ + +/** + @page PAGE_INSTRUMENTATION_INTERFACE + Performance schema: instrumentation interface page. + MySQL performance schema instrumentation interface. + + @section INTRO Introduction + + The instrumentation interface consist of two layers: + - a raw ABI (Application Binary Interface) layer, that exposes the primitive + instrumentation functions exported by the performance schema instrumentation + - an API (Application Programing Interface) layer, + that provides many helpers for a developer instrumenting some code, + to make the instrumentation as easy as possible. + + The ABI layer consists of: +@code +#include "mysql/psi/psi.h" +@endcode + + The API layer consists of: +@code +#include "mysql/psi/mutex_mutex.h" +#include "mysql/psi/mutex_file.h" +@endcode + + The first helper is for mutexes, rwlocks and conditions, + the second for file io. + + The API layer exposes C macros and typedefs which will expand: + - either to non-instrumented code, when compiled without the performance + schema instrumentation + - or to instrumented code, that will issue the raw calls to the ABI layer + so that the implementation can collect data. + + Note that all the names introduced (for example, @c mysql_mutex_lock) do not + collide with any other namespace. + In particular, the macro @c mysql_mutex_lock is on purpose not named + @c pthread_mutex_lock. + This is to: + - avoid overloading @c pthread_mutex_lock with yet another macro, + which is dangerous as it can affect user code and pollute + the end-user namespace. + - allow the developer instrumenting code to selectively instrument + some code but not all. + + @section PRINCIPLES Design principles + + The ABI part is designed as a facade, that exposes basic primitives. + The expectation is that each primitive will be very stable over time, + but the list will constantly grow when more instruments are supported. + To support binary compatibility with plugins compiled with a different + version of the instrumentation, the ABI itself is versioned + (see @c PSI_v1, @c PSI_v2). + + For a given instrumentation point in the API, the basic coding pattern + used is: + - (a) If the performance schema is not initialized, do nothing + - (b) If the object acted upon is not instrumented, do nothing + - (c) otherwise, notify the performance schema of the operation + about to be performed. + + The implementation of the instrumentation interface can: + - decide that it is not interested by the event, and return NULL. + In this context, 'interested' means whether the instrumentation for + this object + event is turned on in the performance schema configuration + (the SETUP_ tables). + - decide that this event is to be instrumented. + In this case, the instrumentation returns an opaque pointer, + that acts as a listener. + + If a listener is returned, the instrumentation point then: + - (d) invokes the "start" event method + - (e) executes the instrumented code. + - (f) invokes the "end" event method. + + If no listener is returned, only the instrumented code (e) is invoked. + + The following code fragment is annotated to show how in detail this pattern + in implemented, when the instrumentation is compiled in: + +@verbatim +static inline int mysql_mutex_lock( + mysql_mutex_t *that, myf flags, const char *src_file, uint src_line) +{ + int result; + struct PSI_mutex_locker *locker= NULL; + + ...... (a) .......... (b) + if (PSI_server && that->m_psi) + + .......................... (c) + if ((locker= PSI_server->get_thread_mutex_locker(that->m_psi, + PSI_MUTEX_LOCK))) + + ............... (d) + PSI_server->start_mutex_wait(locker, src_file, src_line); + + ........ (e) + result= pthread_mutex_lock(&that->m_mutex); + + if (locker) + + ............. (f) + PSI_server->end_mutex_wait(locker, result); + + return result; +} +@endverbatim + + When the performance schema instrumentation is not compiled in, + the code becomes simply a wrapper, expanded in line by the compiler: + +@verbatim +static inline int mysql_mutex_lock(...) +{ + int result; + + ........ (e) + result= pthread_mutex_lock(&that->m_mutex); + + return result; +} +@endverbatim +*/ + +/** + @page PAGE_AGGREGATES Performance schema: the aggregates page. + Performance schema aggregates. + + @section INTRO Introduction + + Aggregates tables are tables that can be formally defined as + SELECT ... from EVENTS_WAITS_HISTORY_INFINITE ... group by 'group clause'. + + Each group clause defines a different kind of aggregate, and corresponds to + a different table exposed by the performance schema. + + Aggregates can be either: + - computed on the fly, + - computed on demand, based on other available data. + + 'EVENTS_WAITS_HISTORY_INFINITE' is a table that does not exist, + the best approximation is EVENTS_WAITS_HISTORY_LONG. + Aggregates computed on the fly in fact are based on EVENTS_WAITS_CURRENT, + while aggregates computed on demand are based on other + EVENTS_WAITS_SUMMARY_BY_xxx tables. + + To better understand the implementation itself, a bit of math is + required first, to understand the model behind the code: + the code is deceptively simple, the real complexity resides + in the flyweight of pointers between various performance schema buffers. + + @section DIMENSION Concept of dimension + + An event measured by the instrumentation has many attributes. + An event is represented as a data point P(x1, x2, ..., xN), + where each x_i coordinate represents a given attribute value. + + Examples of attributes are: + - the time waited + - the object waited on + - the instrument waited on + - the thread that waited + - the operation performed + - per object or per operation additional attributes, such as spins, + number of bytes, etc. + + Computing an aggregate per thread is fundamentally different from + computing an aggregate by instrument, so the "_BY_THREAD" and + "_BY_EVENT_NAME" aggregates are different dimensions, + operating on different x_i and x_j coordinates. + These aggregates are "orthogonal". + + @section PROJECTION Concept of projection + + A given x_i attribute value can convey either just one basic information, + such as a number of bytes, or can convey implied information, + such as an object fully qualified name. + + For example, from the value "test.t1", the name of the object schema + "test" can be separated from the object name "t1", so that now aggregates + by object schema can be implemented. + + In math terms, that corresponds to defining a function: + F_i (x): x --> y + Applying this function to our point P gives another point P': + + F_i (P): + P(x1, x2, ..., x{i-1}, x_i, x{i+1}, ..., x_N + --> P' (x1, x2, ..., x{i-1}, f_i(x_i), x{i+1}, ..., x_N) + + That function defines in fact an aggregate ! + In SQL terms, this aggregate would look like the following table: + +@verbatim + CREATE VIEW EVENTS_WAITS_SUMMARY_BY_Func_i AS + SELECT col_1, col_2, ..., col_{i-1}, + Func_i(col_i), + COUNT(col_i), + MIN(col_i), AVG(col_i), MAX(col_i), -- if col_i is a numeric value + col_{i+1}, ..., col_N + FROM EVENTS_WAITS_HISTORY_INFINITE + group by col_1, col_2, ..., col_{i-1}, col{i+1}, ..., col_N. +@endverbatim + + Note that not all columns have to be included, + in particular some columns that are dependent on the x_i column should + be removed, so that in practice, MySQL's aggregation method tends to + remove many attributes at each aggregation steps. + + For example, when aggregating wait events by object instances, + - the wait_time and number_of_bytes can be summed, + and sum(wait_time) now becomes an object instance attribute. + - the source, timer_start, timer_end columns are not in the + _BY_INSTANCE table, because these attributes are only + meaningful for a wait. + + @section COMPOSITION Concept of composition + + Now, the "test.t1" --> "test" example was purely theory, + just to explain the concept, and does not lead very far. + Let's look at a more interesting example of data that can be derived + from the row event. + + An event creates a transient object, PFS_wait_locker, per operation. + This object's life cycle is extremely short: it's created just + before the start_wait() instrumentation call, and is destroyed in + the end_wait() call. + + The wait locker itself contains a pointer to the object instance + waited on. + That allows to implement a wait_locker --> object instance projection, + with m_target. + The object instance life cycle depends on _init and _destroy calls + from the code, such as mysql_mutex_init() + and mysql_mutex_destroy() for a mutex. + + The object instance waited on contains a pointer to the object class, + which is represented by the instrument name. + That allows to implement an object instance --> object class projection. + The object class life cycle is permanent, as instruments are loaded in + the server and never removed. + + The object class is named in such a way + (for example, "wait/sync/mutex/sql/LOCK_open", + "wait/io/file/maria/data_file) that the component ("sql", "maria") + that it belongs to can be inferred. + That allows to implement an object class --> server component projection. + + Back to math again, we have, for example for mutexes: + + F1 (l) : PFS_wait_locker l --> PFS_mutex m = l->m_target.m_mutex + + F1_to_2 (m) : PFS_mutex m --> PFS_mutex_class i = m->m_class + + F2_to_3 (i) : PFS_mutex_class i --> const char *component = + substring(i->m_name, ...) + + Per components aggregates are not implemented, this is just an illustration. + + F1 alone defines this aggregate: + + EVENTS_WAITS_HISTORY_INFINITE --> EVENTS_WAITS_SUMMARY_BY_INSTANCE + (or MUTEX_INSTANCE) + + F1_to_2 alone could define this aggregate: + + EVENTS_WAITS_SUMMARY_BY_INSTANCE --> EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + + Alternatively, using function composition, with + F2 = F1_to_2 o F1, F2 defines: + + EVENTS_WAITS_HISTORY_INFINITE --> EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + + Likewise, F_2_to_3 defines: + + EVENTS_WAITS_SUMMARY_BY_EVENT_NAME --> EVENTS_WAITS_SUMMARY_BY_COMPONENT + + and F3 = F_2_to_3 o F_1_to_2 o F1 defines: + + EVENTS_WAITS_HISTORY_INFINITE --> EVENTS_WAITS_SUMMARY_BY_COMPONENT + + What has all this to do with the code ? + + Function composition such as F_2_to_3 o F_1_to_2 o F1 is implemented + as PFS_single_stat_chain, where each link in the chain represents + an individual F_{i}_to_{i+1} aggregation step. + + A single call to aggregate_single_stat_chain() updates all the tables + described in the statistics chain. + + @section STAT_CHAIN Statistics chains + + Statistics chains are only used for on the fly aggregates, + and are therefore all based initially on the '_CURRENT' base table that + contains the data recorded. + The following table aggregates are implemented with a statistics chain: + + EVENTS_WAITS_CURRENT --> EVENTS_WAITS_SUMMARY_BY_INSTANCE + --> EVENTS_WAITS_SUMMARY_BY_EVENT_NAME + + This relationship is between classes. + + In terms of object instances, or records, this chain is implemented + as a flyweight. + + For example, assuming the following scenario: + - A mutex class "M" is instrumented, the instrument name + is "wait/sync/mutex/sql/M" + - This mutex instrument has been instantiated twice, + mutex instances are noted M-1 and M-2 + - Threads T-A and T-B are locking mutex instance M-1 + - Threads T-C and T-D are locking mutex instance M-2 + + The performance schema will record the following data: + - EVENTS_WAITS_CURRENT has 4 rows, one for each mutex locker + - EVENTS_WAITS_SUMMARY_BY_INSTANCE shows 2 rows, for M-1 and M-2 + - EVENTS_WAITS_SUMMARY_BY_EVENT_NAME shows 1 row, for M + + The graph of structures will look like: + +@verbatim + PFS_wait_locker (T-A, M-1) ---------- + | + v + PFS_mutex (M-1) + - m_wait_stat ------------ + ^ | + | | + PFS_wait_locker (T-B, M-1) ---------- | + v + PFS_mutex_class (M) + - m_wait_stat + PFS_wait_locker (T-C, M-2) ---------- ^ + | | + v | + PFS_mutex (M-2) | + - m_wait_stat ------------ + ^ + | + PFS_wait_locker (T-D, M-2) ---------- + + || || || + || || || + vv vv vv + + EVENTS_WAITS_CURRENT ..._SUMMARY_BY_INSTANCE ..._SUMMARY_BY_EVENT_NAME +@endverbatim + + @section ON_THE_FLY On the fly aggregates + + 'On the fly' aggregates are computed during the code execution. + This is necessary because the data the aggregate is based on is volatile, + and can not be kept indefinitely. + + @section HIGHER_LEVEL Higher level aggregates + + Note: no higher level aggregate is implemented yet, + this section is a place holder. +*/ + +/** + @defgroup Performance_schema Performance Schema + The performance schema component. + For details, see the + @ref PAGE_PERFORMANCE_SCHEMA "performance schema main page". + + @defgroup Performance_schema_implementation Performance Schema Implementation + @ingroup Performance_schema + + @defgroup Performance_schema_tables Performance Schema Tables + @ingroup Performance_schema_implementation +*/ + +pthread_key(PFS_thread*, THR_PFS); +bool THR_PFS_initialized= false; + +static enum_operation_type mutex_operation_map[]= +{ + OPERATION_TYPE_LOCK, + OPERATION_TYPE_TRYLOCK +}; + +static enum_operation_type rwlock_operation_map[]= +{ + OPERATION_TYPE_READLOCK, + OPERATION_TYPE_WRITELOCK, + OPERATION_TYPE_TRYREADLOCK, + OPERATION_TYPE_TRYWRITELOCK +}; + +static enum_operation_type cond_operation_map[]= +{ + OPERATION_TYPE_WAIT, + OPERATION_TYPE_TIMEDWAIT +}; + +/** + Conversion map from PSI_file_operation to enum_operation_type. + Indexed by enum PSI_file_operation. +*/ +static enum_operation_type file_operation_map[]= +{ + OPERATION_TYPE_FILECREATE, + OPERATION_TYPE_FILECREATETMP, + OPERATION_TYPE_FILEOPEN, + OPERATION_TYPE_FILESTREAMOPEN, + OPERATION_TYPE_FILECLOSE, + OPERATION_TYPE_FILESTREAMCLOSE, + OPERATION_TYPE_FILEREAD, + OPERATION_TYPE_FILEWRITE, + OPERATION_TYPE_FILESEEK, + OPERATION_TYPE_FILETELL, + OPERATION_TYPE_FILEFLUSH, + OPERATION_TYPE_FILESTAT, + OPERATION_TYPE_FILEFSTAT, + OPERATION_TYPE_FILECHSIZE, + OPERATION_TYPE_FILEDELETE, + OPERATION_TYPE_FILERENAME, + OPERATION_TYPE_FILESYNC +}; + +/** + Build the prefix name of a class of instruments in a category. + For example, this function builds the string 'wait/sync/mutex/sql/' from + a prefix 'wait/sync/mutex' and a category 'sql'. + This prefix is used later to build each instrument name, such as + 'wait/sync/mutex/sql/LOCK_open'. + @param prefix Prefix for this class of instruments + @param category Category name + @param [out] output Buffer of length PFS_MAX_INFO_NAME_LENGTH. + @param [out] output_length Length of the resulting output string. + @return 0 for success, non zero for errors +*/ +static int build_prefix(const LEX_STRING *prefix, const char *category, + char *output, int *output_length) +{ + int len= strlen(category); + char *out_ptr= output; + int prefix_length= prefix->length; + + if (unlikely((prefix_length + len + 1) >= + PFS_MAX_FULL_PREFIX_NAME_LENGTH)) + { + pfs_print_error("build_prefix: prefix+category is too long <%s> <%s>\n", + prefix->str, category); + return 1; + } + + if (unlikely(strchr(category, '/') != NULL)) + { + pfs_print_error("build_prefix: invalid category <%s>\n", + category); + return 1; + } + + /* output = prefix + category + '/' */ + memcpy(out_ptr, prefix->str, prefix_length); + out_ptr+= prefix_length; + memcpy(out_ptr, category, len); + out_ptr+= len; + *out_ptr= '/'; + out_ptr++; + *output_length= out_ptr - output; + + return 0; +} + +#define REGISTER_BODY_V1(KEY_T, PREFIX, REGISTER_FUNC) \ + KEY_T key; \ + char formatted_name[PFS_MAX_INFO_NAME_LENGTH]; \ + int prefix_length; \ + int len; \ + int full_length; \ + \ + DBUG_ASSERT(category != NULL); \ + DBUG_ASSERT(info != NULL); \ + if (unlikely(build_prefix(&PREFIX, category, \ + formatted_name, &prefix_length))) \ + { \ + for (; count>0; count--, info++) \ + *(info->m_key)= 0; \ + return ; \ + } \ + \ + for (; count>0; count--, info++) \ + { \ + DBUG_ASSERT(info->m_key != NULL); \ + DBUG_ASSERT(info->m_name != NULL); \ + len= strlen(info->m_name); \ + full_length= prefix_length + len; \ + if (likely(full_length <= PFS_MAX_INFO_NAME_LENGTH)) \ + { \ + memcpy(formatted_name + prefix_length, info->m_name, len); \ + key= REGISTER_FUNC(formatted_name, full_length, info->m_flags); \ + } \ + else \ + { \ + pfs_print_error("REGISTER_BODY_V1: name too long <%s> <%s>\n", \ + category, info->m_name); \ + key= 0; \ + } \ + \ + *(info->m_key)= key; \ + } \ + return; + +static void register_mutex_v1(const char *category, + PSI_mutex_info_v1 *info, + int count) +{ + REGISTER_BODY_V1(PSI_mutex_key, + mutex_instrument_prefix, + register_mutex_class) +} + +static void register_rwlock_v1(const char *category, + PSI_rwlock_info_v1 *info, + int count) +{ + REGISTER_BODY_V1(PSI_rwlock_key, + rwlock_instrument_prefix, + register_rwlock_class) +} + +static void register_cond_v1(const char *category, + PSI_cond_info_v1 *info, + int count) +{ + REGISTER_BODY_V1(PSI_cond_key, + cond_instrument_prefix, + register_cond_class) +} + +static void register_thread_v1(const char *category, + PSI_thread_info_v1 *info, + int count) +{ + REGISTER_BODY_V1(PSI_thread_key, + thread_instrument_prefix, + register_thread_class) +} + +static void register_file_v1(const char *category, + PSI_file_info_v1 *info, + int count) +{ + REGISTER_BODY_V1(PSI_file_key, + file_instrument_prefix, + register_file_class) +} + +#define INIT_BODY_V1(T, KEY, ID) \ + PFS_##T##_class *klass; \ + PFS_##T *pfs; \ + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); \ + if (unlikely(pfs_thread == NULL)) \ + return NULL; \ + if (! pfs_thread->m_enabled) \ + return NULL; \ + klass= find_##T##_class(KEY); \ + if (unlikely(klass == NULL)) \ + return NULL; \ + if (! klass->m_enabled) \ + return NULL; \ + pfs= create_##T(klass, ID); \ + return reinterpret_cast (pfs) + +static PSI_mutex* +init_mutex_v1(PSI_mutex_key key, const void *identity) +{ + INIT_BODY_V1(mutex, key, identity); +} + +static void destroy_mutex_v1(PSI_mutex* mutex) +{ + PFS_mutex *pfs= reinterpret_cast (mutex); + destroy_mutex(pfs); +} + +static PSI_rwlock* +init_rwlock_v1(PSI_rwlock_key key, const void *identity) +{ + INIT_BODY_V1(rwlock, key, identity); +} + +static void destroy_rwlock_v1(PSI_rwlock* rwlock) +{ + PFS_rwlock *pfs= reinterpret_cast (rwlock); + destroy_rwlock(pfs); +} + +static PSI_cond* +init_cond_v1(PSI_cond_key key, const void *identity) +{ + INIT_BODY_V1(cond, key, identity); +} + +static void destroy_cond_v1(PSI_cond* cond) +{ + PFS_cond *pfs= reinterpret_cast (cond); + destroy_cond(pfs); +} + +static PSI_table_share* +get_table_share_v1(const char *schema_name, int schema_name_length, + const char *table_name, int table_name_length, + const void *identity) +{ +#ifdef HAVE_TABLE_WAIT + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + PFS_table_share* share; + share= find_or_create_table_share(pfs_thread, + schema_name, schema_name_length, + table_name, table_name_length); + return reinterpret_cast (share); +#else + return NULL; +#endif +} + +static void release_table_share_v1(PSI_table_share* share) +{ + /* + To be implemented by WL#4895 PERFORMANCE_SCHEMA Instrumenting Table IO. + */ +} + +static PSI_table* +open_table_v1(PSI_table_share *share, const void *identity) +{ + PFS_table_share *pfs_table_share= + reinterpret_cast (share); + PFS_table *pfs_table; + DBUG_ASSERT(pfs_table_share); + pfs_table= create_table(pfs_table_share, identity); + return reinterpret_cast (pfs_table); +} + +static void close_table_v1(PSI_table *table) +{ + PFS_table *pfs= reinterpret_cast (table); + DBUG_ASSERT(pfs); + destroy_table(pfs); +} + +static void create_file_v1(PSI_file_key key, const char *name, File file) +{ + int index= (int) file; + if (unlikely(index < 0)) + return; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return; + if (! pfs_thread->m_enabled) + return; + PFS_file_class *klass= find_file_class(key); + if (unlikely(klass == NULL)) + return; + if (! klass->m_enabled) + return; + if (likely(index < file_handle_max)) + { + uint len= strlen(name); + PFS_file *pfs= find_or_create_file(pfs_thread, klass, name, len); + file_handle_array[index]= pfs; + } + else + file_handle_lost++; +} + +struct PFS_spawn_thread_arg +{ + PFS_thread *m_parent_thread; + PSI_thread_key m_child_key; + const void *m_child_identity; + void *(*m_user_start_routine)(void*); + void *m_user_arg; +}; + +void* pfs_spawn_thread(void *arg) +{ + PFS_spawn_thread_arg *typed_arg= (PFS_spawn_thread_arg*) arg; + void *user_arg; + void *(*user_start_routine)(void*); + + PFS_thread *pfs; + + /* First, attach instrumentation to this newly created pthread. */ + PFS_thread_class *klass= find_thread_class(typed_arg->m_child_key); + if (likely(klass != NULL)) + pfs= create_thread(klass, typed_arg->m_child_identity, 0); + else + pfs= NULL; + my_pthread_setspecific_ptr(THR_PFS, pfs); + + /* + Secondly, free the memory allocated in spawn_thread_v1(). + It is preferable to do this before invoking the user + routine, to avoid memory leaks at shutdown, in case + the server exits without waiting for this thread. + */ + user_start_routine= typed_arg->m_user_start_routine; + user_arg= typed_arg->m_user_arg; + my_free(typed_arg, MYF(0)); + + /* Then, execute the user code for this thread. */ + (*user_start_routine)(user_arg); + + return NULL; +} + +static int spawn_thread_v1(PSI_thread_key key, + pthread_t *thread, const pthread_attr_t *attr, + void *(*start_routine)(void*), void *arg) +{ + PFS_spawn_thread_arg *psi_arg; + + /* psi_arg can not be global, and can not be a local variable. */ + psi_arg= (PFS_spawn_thread_arg*) my_malloc(sizeof(PFS_spawn_thread_arg), + MYF(MY_WME)); + if (unlikely(psi_arg == NULL)) + return EAGAIN; + + psi_arg->m_parent_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + psi_arg->m_child_key= key; + psi_arg->m_child_identity= (arg ? arg : thread); + psi_arg->m_user_start_routine= start_routine; + psi_arg->m_user_arg= arg; + + int result= pthread_create(thread, attr, pfs_spawn_thread, psi_arg); + if (unlikely(result != 0)) + my_free(psi_arg, MYF(0)); + return result; +} + +static PSI_thread* +new_thread_v1(PSI_thread_key key, const void *identity, ulong thread_id) +{ + PFS_thread *pfs; + + PFS_thread_class *klass= find_thread_class(key); + if (likely(klass != NULL)) + pfs= create_thread(klass, identity, thread_id); + else + pfs= NULL; + + return reinterpret_cast (pfs); +} + +static void set_thread_id_v1(PSI_thread *thread, unsigned long id) +{ + DBUG_ASSERT(thread); + PFS_thread *pfs= reinterpret_cast (thread); + pfs->m_thread_id= id; +} + +static PSI_thread* +get_thread_v1(void) +{ + PFS_thread *pfs= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + return reinterpret_cast (pfs); +} + +static void set_thread_v1(PSI_thread* thread) +{ + PFS_thread *pfs= reinterpret_cast (thread); + my_pthread_setspecific_ptr(THR_PFS, pfs); +} + +static void delete_current_thread_v1(void) +{ + PFS_thread *thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (thread != NULL) + { + my_pthread_setspecific_ptr(THR_PFS, NULL); + destroy_thread(thread); + } +} + +static PSI_mutex_locker* +get_thread_mutex_locker_v1(PSI_mutex *mutex, PSI_mutex_operation op) +{ + PFS_mutex *pfs_mutex= reinterpret_cast (mutex); + DBUG_ASSERT((int) op >= 0); + DBUG_ASSERT((uint) op < array_elements(mutex_operation_map)); + DBUG_ASSERT(pfs_mutex != NULL); + DBUG_ASSERT(pfs_mutex->m_class != NULL); + if (! flag_events_waits_current) + return NULL; + if (! pfs_mutex->m_class->m_enabled) + return NULL; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_mutex= pfs_mutex; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= pfs_mutex->m_class; + if (pfs_mutex->m_class->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_mutex->m_identity; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_operation= mutex_operation_map[(int) op]; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_MUTEX; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); +} + +static PSI_rwlock_locker* +get_thread_rwlock_locker_v1(PSI_rwlock *rwlock, PSI_rwlock_operation op) +{ + PFS_rwlock *pfs_rwlock= reinterpret_cast (rwlock); + DBUG_ASSERT(static_cast (op) >= 0); + DBUG_ASSERT(static_cast (op) < array_elements(rwlock_operation_map)); + DBUG_ASSERT(pfs_rwlock != NULL); + DBUG_ASSERT(pfs_rwlock->m_class != NULL); + if (! flag_events_waits_current) + return NULL; + if (! pfs_rwlock->m_class->m_enabled) + return NULL; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_rwlock= pfs_rwlock; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= pfs_rwlock->m_class; + if (pfs_rwlock->m_class->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_rwlock->m_identity; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_operation= + rwlock_operation_map[static_cast (op)]; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_RWLOCK; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); +} + +static PSI_cond_locker* +get_thread_cond_locker_v1(PSI_cond *cond, PSI_mutex * /* unused: mutex */, + PSI_cond_operation op) +{ + /* + Note about the unused PSI_mutex *mutex parameter: + In the pthread library, a call to pthread_cond_wait() + causes an unlock() + lock() on the mutex associated with the condition. + This mutex operation is not instrumented, so the mutex will still + appear as locked when a thread is waiting on a condition. + This has no impact now, as unlock_mutex() is not recording events. + When unlock_mutex() is implemented by later work logs, + this parameter here will be used to adjust the mutex state, + in start_cond_wait_v1() and end_cond_wait_v1(). + */ + PFS_cond *pfs_cond= reinterpret_cast (cond); + DBUG_ASSERT(static_cast (op) >= 0); + DBUG_ASSERT(static_cast (op) < array_elements(cond_operation_map)); + DBUG_ASSERT(pfs_cond != NULL); + DBUG_ASSERT(pfs_cond->m_class != NULL); + if (! flag_events_waits_current) + return NULL; + if (! pfs_cond->m_class->m_enabled) + return NULL; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_cond= pfs_cond; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= pfs_cond->m_class; + if (pfs_cond->m_class->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_cond->m_identity; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_operation= + cond_operation_map[static_cast (op)]; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_COND; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); +} + +static PSI_table_locker* +get_thread_table_locker_v1(PSI_table *table) +{ + PFS_table *pfs_table= reinterpret_cast (table); + DBUG_ASSERT(pfs_table != NULL); + DBUG_ASSERT(pfs_table->m_share != NULL); + if (! flag_events_waits_current) + return NULL; + if (! pfs_table->m_share->m_enabled) + return NULL; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_table= pfs_table; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= &global_table_class; + if (pfs_table->m_share->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_table->m_identity; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_TABLE; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); +} + +static PSI_file_locker* +get_thread_file_name_locker_v1(PSI_file_key key, + PSI_file_operation op, + const char *name, const void *identity) +{ + DBUG_ASSERT(static_cast (op) >= 0); + DBUG_ASSERT(static_cast (op) < array_elements(file_operation_map)); + + if (! flag_events_waits_current) + return NULL; + PFS_file_class *klass= find_file_class(key); + if (unlikely(klass == NULL)) + return NULL; + if (! klass->m_enabled) + return NULL; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + uint len= strlen(name); + PFS_file *pfs_file= find_or_create_file(pfs_thread, klass, name, len); + if (unlikely(pfs_file == NULL)) + return NULL; + + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_file= pfs_file; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= pfs_file->m_class; + if (pfs_file->m_class->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_file; + pfs_locker->m_waits_current.m_object_name= pfs_file->m_filename; + pfs_locker->m_waits_current.m_object_name_length= + pfs_file->m_filename_length; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_operation= + file_operation_map[static_cast (op)]; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_FILE; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); +} + +static PSI_file_locker* +get_thread_file_stream_locker_v1(PSI_file *file, PSI_file_operation op) +{ + PFS_file *pfs_file= reinterpret_cast (file); + + DBUG_ASSERT(static_cast (op) >= 0); + DBUG_ASSERT(static_cast (op) < array_elements(file_operation_map)); + DBUG_ASSERT(pfs_file != NULL); + DBUG_ASSERT(pfs_file->m_class != NULL); + + if (! flag_events_waits_current) + return NULL; + if (! pfs_file->m_class->m_enabled) + return NULL; + PFS_thread *pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_file= pfs_file; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= pfs_file->m_class; + if (pfs_file->m_class->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_file; + pfs_locker->m_waits_current.m_object_name= pfs_file->m_filename; + pfs_locker->m_waits_current.m_object_name_length= + pfs_file->m_filename_length; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_operation= + file_operation_map[static_cast (op)]; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_FILE; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); +} + +static PSI_file_locker* +get_thread_file_descriptor_locker_v1(File file, PSI_file_operation op) +{ + int index= static_cast (file); + + DBUG_ASSERT(static_cast (op) >= 0); + DBUG_ASSERT(static_cast (op) < array_elements(file_operation_map)); + + if (! flag_events_waits_current) + return NULL; + if (likely((index >= 0) && (index < file_handle_max))) + { + PFS_file *pfs_file= file_handle_array[index]; + if (likely(pfs_file != NULL)) + { + PFS_thread *pfs_thread; + + /* + We are about to close a file by descriptor number, + and the calling code still holds the descriptor. + Cleanup the file descriptor <--> file instrument association. + Remove the instrumentation *before* the close to avoid race + conditions with another thread opening a file + (that could be given the same descriptor). + */ + if (op == PSI_FILE_CLOSE) + file_handle_array[index]= NULL; + + DBUG_ASSERT(pfs_file->m_class != NULL); + if (! pfs_file->m_class->m_enabled) + return NULL; + pfs_thread= my_pthread_getspecific_ptr(PFS_thread*, THR_PFS); + if (unlikely(pfs_thread == NULL)) + return NULL; + if (! pfs_thread->m_enabled) + return NULL; + if (unlikely(pfs_thread->m_wait_locker_count >= LOCKER_STACK_SIZE)) + { + locker_lost++; + return NULL; + } + PFS_wait_locker *pfs_locker= &pfs_thread->m_wait_locker_stack + [pfs_thread->m_wait_locker_count]; + pfs_locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + + pfs_locker->m_target.m_file= pfs_file; + pfs_locker->m_waits_current.m_thread= pfs_thread; + pfs_locker->m_waits_current.m_class= pfs_file->m_class; + if (pfs_file->m_class->m_timed) + { + pfs_locker->m_timer_name= wait_timer; + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_STARTING; + } + else + pfs_locker->m_waits_current.m_timer_state= TIMER_STATE_UNTIMED; + pfs_locker->m_waits_current.m_object_instance_addr= pfs_file; + pfs_locker->m_waits_current.m_object_name= pfs_file->m_filename; + pfs_locker->m_waits_current.m_object_name_length= + pfs_file->m_filename_length; + pfs_locker->m_waits_current.m_event_id= pfs_thread->m_event_id++; + pfs_locker->m_waits_current.m_operation= + file_operation_map[static_cast (op)]; + pfs_locker->m_waits_current.m_wait_class= WAIT_CLASS_FILE; + + pfs_thread->m_wait_locker_count++; + return reinterpret_cast (pfs_locker); + } + } + return NULL; +} + +static void unlock_mutex_v1(PSI_thread * thread, PSI_mutex *mutex) +{ + PFS_mutex *pfs_mutex= reinterpret_cast (mutex); + DBUG_ASSERT(pfs_mutex != NULL); + + /* + Note that this code is still protected by the instrumented mutex, + and therefore is thread safe. See inline_mysql_mutex_unlock(). + */ + + /* Always update the instrumented state */ + pfs_mutex->m_owner= NULL; + pfs_mutex->m_last_locked= 0; + +#ifdef LATER_WL2333 + /* + See WL#2333: SHOW ENGINE ... LOCK STATUS. + PFS_mutex::m_lock_stat is not exposed in user visible tables + currently, so there is no point spending time computing it. + */ + PFS_thread *pfs_thread= reinterpret_cast (thread); + DBUG_ASSERT(pfs_thread != NULL); + + if (unlikely(! flag_events_waits_current)) + return; + if (! pfs_mutex->m_class->m_enabled) + return; + if (! pfs_thread->m_enabled) + return; + + if (pfs_mutex->m_class->m_timed) + { + ulonglong locked_time; + locked_time= get_timer_value(wait_timer) - pfs_mutex->m_last_locked; + aggregate_single_stat_chain(&pfs_mutex->m_lock_stat, locked_time); + } +#endif +} + +static void unlock_rwlock_v1(PSI_thread *thread, PSI_rwlock *rwlock) +{ + PFS_rwlock *pfs_rwlock= reinterpret_cast (rwlock); + DBUG_ASSERT(pfs_rwlock != NULL); + bool last_writer= false; + bool last_reader= false; + + /* + Note that this code is still protected by the instrumented rwlock, + and therefore is: + - thread safe for write locks + - almost thread safe for read locks (pfs_rwlock->m_readers is unsafe). + See inline_mysql_rwlock_unlock() + */ + + /* Always update the instrumented state */ + if (pfs_rwlock->m_writer) + { + /* Nominal case, a writer is unlocking. */ + last_writer= true; + pfs_rwlock->m_writer= NULL; + /* Reset the readers stats, they could be off */ + pfs_rwlock->m_readers= 0; + } + else if (likely(pfs_rwlock->m_readers > 0)) + { + /* Nominal case, a reader is unlocking. */ + if (--(pfs_rwlock->m_readers) == 0) + last_reader= true; + } + else + { + /* + Edge case, we have no writer and no readers, + on an unlock event. + This is possible for: + - partial instrumentation + - instrumentation disabled at runtime, + see when get_thread_rwlock_locker_v1() returns NULL + No further action is taken here, the next + write lock will put the statistics is a valid state. + */ + } + +#ifdef LATER_WL2333 + /* See WL#2333: SHOW ENGINE ... LOCK STATUS. */ + PFS_thread *pfs_thread= reinterpret_cast (thread); + DBUG_ASSERT(pfs_thread != NULL); + + if (unlikely(! flag_events_waits_current)) + return; + if (! pfs_rwlock->m_class->m_enabled) + return; + if (! pfs_thread->m_enabled) + return; + + ulonglong locked_time; + if (last_writer) + { + if (pfs_rwlock->m_class->m_timed) + { + locked_time= get_timer_value(wait_timer) - pfs_rwlock->m_last_written; + aggregate_single_stat_chain(&pfs_rwlock->m_write_lock_stat, locked_time); + } + } + else if (last_reader) + { + if (pfs_rwlock->m_class->m_timed) + { + locked_time= get_timer_value(wait_timer) - pfs_rwlock->m_last_read; + aggregate_single_stat_chain(&pfs_rwlock->m_read_lock_stat, locked_time); + } + } +#endif +} + +static void signal_cond_v1(PSI_thread *thread, PSI_cond* cond) +{ + PFS_cond *pfs_cond= reinterpret_cast (cond); + DBUG_ASSERT(pfs_cond != NULL); + + pfs_cond->m_cond_stat.m_signal_count++; +} + +static void broadcast_cond_v1(PSI_thread *thread, PSI_cond* cond) +{ + PFS_cond *pfs_cond= reinterpret_cast (cond); + DBUG_ASSERT(pfs_cond != NULL); + + pfs_cond->m_cond_stat.m_broadcast_count++; +} + +static void start_mutex_wait_v1(PSI_mutex_locker* locker, + const char *src_file, uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + PFS_events_waits *wait= &pfs_locker->m_waits_current; + if (wait->m_timer_state == TIMER_STATE_STARTING) + { + wait->m_timer_start= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_STARTED; + } + wait->m_source_file= src_file; + wait->m_source_line= src_line; +} + +static void end_mutex_wait_v1(PSI_mutex_locker* locker, int rc) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + PFS_events_waits *wait= &pfs_locker->m_waits_current; + + if (wait->m_timer_state == TIMER_STATE_STARTED) + { + wait->m_timer_end= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_TIMED; + } + if (flag_events_waits_history) + insert_events_waits_history(wait->m_thread, wait); + if (flag_events_waits_history_long) + insert_events_waits_history_long(wait); + + if (rc == 0) + { + /* Thread safe: we are protected by the instrumented mutex */ + PFS_single_stat_chain *stat; + PFS_mutex *mutex= pfs_locker->m_target.m_mutex; + mutex->m_owner= wait->m_thread; + mutex->m_last_locked= wait->m_timer_end; + + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&mutex->m_wait_stat, wait_time); + stat= find_per_thread_mutex_class_wait_stat(wait->m_thread, + mutex->m_class); + aggregate_single_stat_chain(stat, wait_time); + } + wait->m_thread->m_wait_locker_count--; +} + +static void start_rwlock_rdwait_v1(PSI_rwlock_locker* locker, + const char *src_file, uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + PFS_events_waits *wait= &pfs_locker->m_waits_current; + if (wait->m_timer_state == TIMER_STATE_STARTING) + { + wait->m_timer_start= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_STARTED; + } + wait->m_source_file= src_file; + wait->m_source_line= src_line; +} + +static void end_rwlock_rdwait_v1(PSI_rwlock_locker* locker, int rc) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + PFS_events_waits *wait= &pfs_locker->m_waits_current; + + if (wait->m_timer_state == TIMER_STATE_STARTED) + { + wait->m_timer_end= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_TIMED; + } + if (flag_events_waits_history) + insert_events_waits_history(wait->m_thread, wait); + if (flag_events_waits_history_long) + insert_events_waits_history_long(wait); + + if (rc == 0) + { + /* + Warning: + Multiple threads can execute this section concurrently + (since multiple readers can execute in parallel). + The statistics generated are not safe, which is why they are + just statistics, not facts. + */ + PFS_single_stat_chain *stat; + PFS_rwlock *rwlock= pfs_locker->m_target.m_rwlock; + if (rwlock->m_readers == 0) + rwlock->m_last_read= wait->m_timer_end; + rwlock->m_writer= NULL; + rwlock->m_readers++; + + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time); + stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, + rwlock->m_class); + aggregate_single_stat_chain(stat, wait_time); + } + wait->m_thread->m_wait_locker_count--; +} + +static void start_rwlock_wrwait_v1(PSI_rwlock_locker* locker, + const char *src_file, uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + PFS_events_waits *wait= &pfs_locker->m_waits_current; + if (wait->m_timer_state == TIMER_STATE_STARTING) + { + wait->m_timer_start= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_STARTED; + } + wait->m_source_file= src_file; + wait->m_source_line= src_line; +} + +static void end_rwlock_wrwait_v1(PSI_rwlock_locker* locker, int rc) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + PFS_events_waits *wait= &pfs_locker->m_waits_current; + + if (wait->m_timer_state == TIMER_STATE_STARTED) + { + wait->m_timer_end= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_TIMED; + } + if (flag_events_waits_history) + insert_events_waits_history(wait->m_thread, wait); + if (flag_events_waits_history_long) + insert_events_waits_history_long(wait); + + if (rc == 0) + { + /* Thread safe : we are protected by the instrumented rwlock */ + PFS_single_stat_chain *stat; + PFS_rwlock *rwlock= pfs_locker->m_target.m_rwlock; + rwlock->m_writer= wait->m_thread; + rwlock->m_last_written= wait->m_timer_end; + /* Reset the readers stats, they could be off */ + rwlock->m_readers= 0; + rwlock->m_last_read= 0; + + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&rwlock->m_wait_stat, wait_time); + stat= find_per_thread_rwlock_class_wait_stat(wait->m_thread, + rwlock->m_class); + aggregate_single_stat_chain(stat, wait_time); + } + wait->m_thread->m_wait_locker_count--; +} + +static void start_cond_wait_v1(PSI_cond_locker* locker, + const char *src_file, uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + PFS_events_waits *wait= &pfs_locker->m_waits_current; + if (wait->m_timer_state == TIMER_STATE_STARTING) + { + wait->m_timer_start= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_STARTED; + } + wait->m_source_file= src_file; + wait->m_source_line= src_line; +} + +static void end_cond_wait_v1(PSI_cond_locker* locker, int rc) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + PFS_events_waits *wait= &pfs_locker->m_waits_current; + + if (wait->m_timer_state == TIMER_STATE_STARTED) + { + wait->m_timer_end= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_TIMED; + } + if (flag_events_waits_history) + insert_events_waits_history(wait->m_thread, wait); + if (flag_events_waits_history_long) + insert_events_waits_history_long(wait); + + if (rc == 0) + { + /* + Not thread safe, race conditions will occur. + A first race condition is: + - thread 1 waits on cond A + - thread 2 waits on cond B + threads 1 and 2 compete when updating the same cond A + statistics, possibly missing a min / max / sum / count. + A second race condition is: + - thread 1 waits on cond A + - thread 2 destroys cond A + - thread 2 or 3 creates cond B in the same condition slot + thread 1 will then aggregate statistics about defunct A + in condition B. + This is accepted, the data will be slightly inaccurate. + */ + PFS_single_stat_chain *stat; + PFS_cond *cond= pfs_locker->m_target.m_cond; + + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&cond->m_wait_stat, wait_time); + stat= find_per_thread_cond_class_wait_stat(wait->m_thread, + cond->m_class); + aggregate_single_stat_chain(stat, wait_time); + } + wait->m_thread->m_wait_locker_count--; +} + +static void start_table_wait_v1(PSI_table_locker* locker, + const char *src_file, uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + PFS_events_waits *wait= &pfs_locker->m_waits_current; + if (wait->m_timer_state == TIMER_STATE_STARTING) + { + wait->m_timer_start= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_STARTED; + } + wait->m_source_file= src_file; + wait->m_source_line= src_line; + wait->m_operation= OPERATION_TYPE_LOCK; + PFS_table_share *share= pfs_locker->m_target.m_table->m_share; + wait->m_schema_name= share->m_schema_name; + wait->m_schema_name_length= share->m_schema_name_length; + wait->m_object_name= share->m_table_name; + wait->m_object_name_length= share->m_table_name_length; +} + +static void end_table_wait_v1(PSI_table_locker* locker) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + PFS_events_waits *wait= &pfs_locker->m_waits_current; + + if (wait->m_timer_state == TIMER_STATE_STARTED) + { + wait->m_timer_end= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_TIMED; + } + if (flag_events_waits_history) + insert_events_waits_history(wait->m_thread, wait); + if (flag_events_waits_history_long) + insert_events_waits_history_long(wait); + + PFS_table *table= pfs_locker->m_target.m_table; + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&table->m_wait_stat, wait_time); + + /* + There is currently no per table and per thread aggregation. + The number of tables in the application is arbitrary, and may be high. + The number of slots per thread to hold aggregates is fixed, + and is constrained by memory. + Implementing a per thread and per table aggregate has not been + decided yet. + If it's implemented, it's likely that the user will have to specify, + per table name, if the aggregate per thread is to be computed or not. + This will mean a SETUP_ table. + */ + wait->m_thread->m_wait_locker_count--; +} + +static void start_file_wait_v1(PSI_file_locker *locker, + size_t count, + const char *src_file, + uint src_line); + +static void end_file_wait_v1(PSI_file_locker *locker, + size_t count); + +static PSI_file* start_file_open_wait_v1(PSI_file_locker *locker, + const char *src_file, + uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + start_file_wait_v1(locker, 0, src_file, src_line); + + PFS_file *pfs_file= pfs_locker->m_target.m_file; + return reinterpret_cast (pfs_file); +} + +static void end_file_open_wait_v1(PSI_file_locker *locker) +{ + end_file_wait_v1(locker, 0); +} + +static void end_file_open_wait_and_bind_to_descriptor_v1 + (PSI_file_locker *locker, File file) +{ + int index= (int) file; + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + end_file_wait_v1(locker, 0); + + PFS_file *pfs_file= pfs_locker->m_target.m_file; + DBUG_ASSERT(pfs_file != NULL); + + if (likely(index >= 0)) + { + if (likely(index < file_handle_max)) + file_handle_array[index]= pfs_file; + else + file_handle_lost++; + } + else + release_file(pfs_file); +} + +static void start_file_wait_v1(PSI_file_locker *locker, + size_t count, + const char *src_file, + uint src_line) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + + PFS_events_waits *wait= &pfs_locker->m_waits_current; + if (wait->m_timer_state == TIMER_STATE_STARTING) + { + wait->m_timer_start= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_STARTED; + } + wait->m_source_file= src_file; + wait->m_source_line= src_line; + wait->m_number_of_bytes= count; +} + +static void end_file_wait_v1(PSI_file_locker *locker, + size_t count) +{ + PFS_wait_locker *pfs_locker= reinterpret_cast (locker); + DBUG_ASSERT(pfs_locker != NULL); + PFS_events_waits *wait= &pfs_locker->m_waits_current; + + wait->m_number_of_bytes= count; + if (wait->m_timer_state == TIMER_STATE_STARTED) + { + wait->m_timer_end= get_timer_value(pfs_locker->m_timer_name); + wait->m_timer_state= TIMER_STATE_TIMED; + } + if (flag_events_waits_history) + insert_events_waits_history(wait->m_thread, wait); + if (flag_events_waits_history_long) + insert_events_waits_history_long(wait); + + PFS_single_stat_chain *stat; + PFS_file *file= pfs_locker->m_target.m_file; + + ulonglong wait_time= wait->m_timer_end - wait->m_timer_start; + aggregate_single_stat_chain(&file->m_wait_stat, wait_time); + stat= find_per_thread_file_class_wait_stat(wait->m_thread, + file->m_class); + aggregate_single_stat_chain(stat, wait_time); + + PFS_file_class *klass= file->m_class; + + switch(wait->m_operation) + { + case OPERATION_TYPE_FILEREAD: + file->m_file_stat.m_count_read++; + file->m_file_stat.m_read_bytes+= count; + klass->m_file_stat.m_count_read++; + klass->m_file_stat.m_read_bytes+= count; + break; + case OPERATION_TYPE_FILEWRITE: + file->m_file_stat.m_count_write++; + file->m_file_stat.m_write_bytes+= count; + klass->m_file_stat.m_count_write++; + klass->m_file_stat.m_write_bytes+= count; + break; + case OPERATION_TYPE_FILECLOSE: + case OPERATION_TYPE_FILESTREAMCLOSE: + case OPERATION_TYPE_FILESTAT: + release_file(pfs_locker->m_target.m_file); + break; + case OPERATION_TYPE_FILEDELETE: + destroy_file(wait->m_thread, pfs_locker->m_target.m_file); + break; + default: + break; + } + + wait->m_thread->m_wait_locker_count--; +} + +PSI_v1 PFS_v1= +{ + register_mutex_v1, + register_rwlock_v1, + register_cond_v1, + register_thread_v1, + register_file_v1, + init_mutex_v1, + destroy_mutex_v1, + init_rwlock_v1, + destroy_rwlock_v1, + init_cond_v1, + destroy_cond_v1, + get_table_share_v1, + release_table_share_v1, + open_table_v1, + close_table_v1, + create_file_v1, + spawn_thread_v1, + new_thread_v1, + set_thread_id_v1, + get_thread_v1, + set_thread_v1, + delete_current_thread_v1, + get_thread_mutex_locker_v1, + get_thread_rwlock_locker_v1, + get_thread_cond_locker_v1, + get_thread_table_locker_v1, + get_thread_file_name_locker_v1, + get_thread_file_stream_locker_v1, + get_thread_file_descriptor_locker_v1, + unlock_mutex_v1, + unlock_rwlock_v1, + signal_cond_v1, + broadcast_cond_v1, + start_mutex_wait_v1, + end_mutex_wait_v1, + start_rwlock_rdwait_v1, + end_rwlock_rdwait_v1, + start_rwlock_wrwait_v1, + end_rwlock_wrwait_v1, + start_cond_wait_v1, + end_cond_wait_v1, + start_table_wait_v1, + end_table_wait_v1, + start_file_open_wait_v1, + end_file_open_wait_v1, + end_file_open_wait_and_bind_to_descriptor_v1, + start_file_wait_v1, + end_file_wait_v1 +}; + +static void* get_interface(int version) +{ + switch (version) + { + case PSI_VERSION_1: + return &PFS_v1; + default: + return NULL; + } +} + +struct PSI_bootstrap PFS_bootstrap= +{ + get_interface +}; + diff --git a/storage/perfschema/pfs.h b/storage/perfschema/pfs.h new file mode 100644 index 00000000000..7af59ffce57 --- /dev/null +++ b/storage/perfschema/pfs.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_H +#define PFS_H + +/** + @file storage/perfschema/pfs.h + Performance schema instrumentation (declarations). +*/ + +#define HAVE_PSI_1 + +#include +#include + +extern struct PSI_bootstrap PFS_bootstrap; +extern pthread_key(PFS_thread*, THR_PFS); +extern bool THR_PFS_initialized; + +#endif + diff --git a/storage/perfschema/pfs_atomic.cc b/storage/perfschema/pfs_atomic.cc new file mode 100644 index 00000000000..c33bb251767 --- /dev/null +++ b/storage/perfschema/pfs_atomic.cc @@ -0,0 +1,78 @@ +/* Copyright (C) 2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_atomic.cc + Atomic operations (implementation). +*/ + +#include +#include +#include "pfs_atomic.h" + +/* + Using SAFE_MUTEX is impossible, because of recursion. + - code locks mutex X + - P_S records the event + - P_S needs an atomic counter A + - safe mutex called for m_mutex[hash(A)] + - safe mutex allocates/free memory + - safe mutex locks THR_LOCK_malloc + - P_S records the event + - P_S needs an atomic counter B + - safe mutex called for m_mutex[hash(B)] + + When hash(A) == hash(B), safe_mutex complains rightly that + the mutex is already locked. + In some cases, A == B, in particular for events_waits_history_long_index. + + In short, the implementation of PFS_atomic should not cause events + to be recorded in the performance schema. + + Also, because SAFE_MUTEX redefines pthread_mutex_t, etc, + this code is not inlined in pfs_atomic.h, but located here in pfs_atomic.cc. + + What is needed is a plain, unmodified, pthread_mutex_t. + This is provided by my_atomic_rwlock_t. +*/ + +/** + Internal rwlock array. + Using a single rwlock for all atomic operations would be a bottleneck. + Using a rwlock per performance schema structure would be too costly in + memory, and use too many rwlock. + The PFS_atomic implementation computes a hash value from the + atomic variable, to spread the bottleneck across 256 buckets, + while still providing --transparently for the caller-- an atomic + operation. +*/ +my_atomic_rwlock_t PFS_atomic::m_rwlock_array[256]; + +void PFS_atomic::init(void) +{ + uint i; + + for (i=0; i< array_elements(m_rwlock_array); i++) + my_atomic_rwlock_init(&m_rwlock_array[i]); +} + +void PFS_atomic::cleanup(void) +{ + uint i; + + for (i=0; i< array_elements(m_rwlock_array); i++) + my_atomic_rwlock_destroy(&m_rwlock_array[i]); +} + diff --git a/storage/perfschema/pfs_atomic.h b/storage/perfschema/pfs_atomic.h new file mode 100644 index 00000000000..7833c5f1c7a --- /dev/null +++ b/storage/perfschema/pfs_atomic.h @@ -0,0 +1,148 @@ +/* Copyright (C) 2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_ATOMIC_H +#define PFS_ATOMIC_H + +/** + @file storage/perfschema/pfs_atomic.h + Atomic operations (declarations). +*/ + +#include + +/** Helper for atomic operations. */ +class PFS_atomic +{ +public: + static void init(); + static void cleanup(); + + /** Atomic load. */ + static inline int32 load_32(volatile int32 *ptr) + { + int32 result; + rdlock(ptr); + result= my_atomic_load32(ptr); + rdunlock(ptr); + return result; + } + + /** Atomic load. */ + static inline uint32 load_u32(volatile uint32 *ptr) + { + uint32 result; + rdlock(ptr); + result= (uint32) my_atomic_load32((int32*) ptr); + rdunlock(ptr); + return result; + } + + /** Atomic store. */ + static inline void store_32(volatile int32 *ptr, int32 value) + { + wrlock(ptr); + my_atomic_store32(ptr, value); + wrunlock(ptr); + } + + /** Atomic store. */ + static inline void store_u32(volatile uint32 *ptr, uint32 value) + { + wrlock(ptr); + my_atomic_store32((int32*) ptr, (int32) value); + wrunlock(ptr); + } + + /** Atomic add. */ + static inline int32 add_32(volatile int32 *ptr, int32 value) + { + int32 result; + wrlock(ptr); + result= my_atomic_add32(ptr, value); + wrunlock(ptr); + return result; + } + + /** Atomic add. */ + static inline uint32 add_u32(volatile uint32 *ptr, uint32 value) + { + uint32 result; + wrlock(ptr); + result= (uint32) my_atomic_add32((int32*) ptr, (int32) value); + wrunlock(ptr); + return result; + } + + /** Atomic compare and swap. */ + static inline bool cas_32(volatile int32 *ptr, int32 *old_value, + int32 new_value) + { + bool result; + wrlock(ptr); + result= my_atomic_cas32(ptr, old_value, new_value); + wrunlock(ptr); + return result; + } + + /** Atomic compare and swap. */ + static inline bool cas_u32(volatile uint32 *ptr, uint32 *old_value, + uint32 new_value) + { + bool result; + wrlock(ptr); + result= my_atomic_cas32((int32*) ptr, (int32*) old_value, + (uint32) new_value); + wrunlock(ptr); + return result; + } + +private: + static my_atomic_rwlock_t m_rwlock_array[256]; + + static inline my_atomic_rwlock_t *get_rwlock(volatile void *ptr) + { + /* + Divide an address by 8 to remove alignment, + modulo 256 to fall in the array. + */ + uint index= (((intptr) ptr) >> 3) & 0xFF; + my_atomic_rwlock_t *result= &m_rwlock_array[index]; + return result; + } + + static inline void rdlock(volatile void *ptr) + { + my_atomic_rwlock_rdlock(get_rwlock(ptr)); + } + + static inline void wrlock(volatile void *ptr) + { + my_atomic_rwlock_wrlock(get_rwlock(ptr)); + } + + static inline void rdunlock(volatile void *ptr) + { + my_atomic_rwlock_rdunlock(get_rwlock(ptr)); + } + + static inline void wrunlock(volatile void *ptr) + { + my_atomic_rwlock_wrunlock(get_rwlock(ptr)); + } +}; + +#endif + diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc new file mode 100644 index 00000000000..5d3746d371c --- /dev/null +++ b/storage/perfschema/pfs_check.cc @@ -0,0 +1,62 @@ +/* Copyright (C) 2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_check.cc + Check the performance schema table structure. + The code in this file is implemented in pfs_check.cc + instead of pfs_server.cc, to separate dependencies to server + structures (THD, ...) in a dedicated file. + This code organization helps a lot maintenance of the unit tests. +*/ + +#include "my_global.h" +#include "mysql_priv.h" +#include "pfs_server.h" +#include "pfs_engine_table.h" + +/* +*/ + +/** + Check that the performance schema tables + have the expected structure. + Discrepancies are written in the server log, + but are not considered fatal, so this function does not + return an error code: + - some differences are compatible, and should not cause a failure + - some differences are not compatible, but then the DBA needs an operational + server to be able to DROP+CREATE the tables with the proper structure, + as part of the initial server installation or during an upgrade. + In case of discrepancies, later attempt to perform DML against + the performance schema will be rejected with an error. +*/ +void check_performance_schema() +{ + DBUG_ENTER("check_performance_schema"); + + THD *thd= new THD(); + if (thd == NULL) + DBUG_VOID_RETURN; + + thd->thread_stack= (char*) &thd; + thd->store_globals(); + + PFS_engine_table_share::check_all_tables(thd); + + delete thd; + DBUG_VOID_RETURN; +} + diff --git a/storage/perfschema/pfs_column_types.h b/storage/perfschema/pfs_column_types.h new file mode 100644 index 00000000000..c6f652d57a0 --- /dev/null +++ b/storage/perfschema/pfs_column_types.h @@ -0,0 +1,119 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_COLUMN_TYPES_H +#define PFS_COLUMN_TYPES_H + +/** + @file storage/perfschema/pfs_column_types.h + Data types for columns used in the performance schema tables (declarations) +*/ + +/** Size of the OBJECT_SCHEMA columns. */ +#define COL_OBJECT_SCHEMA_SIZE 64 + +/** + Size of the extended OBJECT_NAME columns. + 'Extended' columns are used when the object name also represents + the name of a non SQL object, such as a file name. + Size in bytes of: + - performance_schema.events_waits_current (OBJECT_NAME) + - performance_schema.events_waits_history (OBJECT_NAME) + - performance_schema.events_waits_history_long (OBJECT_NAME) +*/ +#define COL_OBJECT_NAME_EXTENDED_SIZE 512 + +/** Size of the OBJECT_NAME columns. */ +#define COL_OBJECT_NAME_SIZE 64 + +/** Size of the SOURCE columns. */ +#define COL_SOURCE_SIZE 64 + +/** + Enum values for the TIMER_NAME columns. + This enum is found in the following tables: + - performance_schema.setup_timer (TIMER_NAME) + - performance_schema.performance_timer (TIMER_NAME) +*/ +enum enum_timer_name +{ + TIMER_NAME_CYCLE= 1, + TIMER_NAME_NANOSEC= 2, + TIMER_NAME_MICROSEC= 3, + TIMER_NAME_MILLISEC= 4, + TIMER_NAME_TICK= 5 +}; + +#define FIRST_TIMER_NAME (static_cast (TIMER_NAME_CYCLE)) +#define LAST_TIMER_NAME (static_cast (TIMER_NAME_TICK)) +#define COUNT_TIMER_NAME (LAST_TIMER_NAME - FIRST_TIMER_NAME + 1) + +/** + Enum values for the various YES/NO columns. + This enum is found in the following tables: + - performance_schema.setup_instruments (ENABLED) + - performance_schema.setup_instruments (TIMED) + - performance_schema.setup_consumers (ENABLED) +*/ +enum enum_yes_no +{ + ENUM_YES= 1, + ENUM_NO= 2 +}; + +/** + Enum values for the various OPERATION columns. + This enum is found in the following tables: + - performance_schema.events_waits_current (OPERATION) + - performance_schema.events_waits_history (OPERATION) + - performance_schema.events_waits_history_long (OPERATION) +*/ +enum enum_operation_type +{ + OPERATION_TYPE_LOCK= 1, + OPERATION_TYPE_TRYLOCK= 2, + + OPERATION_TYPE_READLOCK= 3, + OPERATION_TYPE_WRITELOCK= 4, + OPERATION_TYPE_TRYREADLOCK= 5, + OPERATION_TYPE_TRYWRITELOCK= 6, + + OPERATION_TYPE_WAIT= 7, + OPERATION_TYPE_TIMEDWAIT= 8, + + OPERATION_TYPE_FILECREATE= 9, + OPERATION_TYPE_FILECREATETMP= 10, + OPERATION_TYPE_FILEOPEN= 11, + OPERATION_TYPE_FILESTREAMOPEN= 12, + OPERATION_TYPE_FILECLOSE= 13, + OPERATION_TYPE_FILESTREAMCLOSE= 14, + OPERATION_TYPE_FILEREAD= 15, + OPERATION_TYPE_FILEWRITE= 16, + OPERATION_TYPE_FILESEEK= 17, + OPERATION_TYPE_FILETELL= 18, + OPERATION_TYPE_FILEFLUSH= 19, + OPERATION_TYPE_FILESTAT= 20, + OPERATION_TYPE_FILEFSTAT= 21, + OPERATION_TYPE_FILECHSIZE= 22, + OPERATION_TYPE_FILEDELETE= 23, + OPERATION_TYPE_FILERENAME= 24, + OPERATION_TYPE_FILESYNC= 25 +}; +#define FIRST_OPERATION_TYPE (static_cast (OPERATION_TYPE_LOCK)) +#define LAST_OPERATION_TYPE (static_cast (OPERATION_TYPE_FILESYNC)) +#define COUNT_OPERATION_TYPE (LAST_OPERATION_TYPE - FIRST_OPERATION_TYPE + 1) + +#endif + diff --git a/storage/perfschema/pfs_column_values.cc b/storage/perfschema/pfs_column_values.cc new file mode 100644 index 00000000000..3143cd97e5d --- /dev/null +++ b/storage/perfschema/pfs_column_values.cc @@ -0,0 +1,42 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_column_values.cc + Literal values for columns used in the performance + schema tables (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_column_values.h" + +LEX_STRING PERFORMANCE_SCHEMA_str= +{ C_STRING_WITH_LEN("performance_schema") }; + +LEX_STRING mutex_instrument_prefix= +{ C_STRING_WITH_LEN("wait/synch/mutex/") }; + +LEX_STRING rwlock_instrument_prefix= +{ C_STRING_WITH_LEN("wait/synch/rwlock/") }; + +LEX_STRING cond_instrument_prefix= +{ C_STRING_WITH_LEN("wait/synch/cond/") }; + +LEX_STRING thread_instrument_prefix= +{ C_STRING_WITH_LEN("thread/") }; + +LEX_STRING file_instrument_prefix= +{ C_STRING_WITH_LEN("wait/io/file/") }; + diff --git a/storage/perfschema/pfs_column_values.h b/storage/perfschema/pfs_column_values.h new file mode 100644 index 00000000000..6cd2e8687d1 --- /dev/null +++ b/storage/perfschema/pfs_column_values.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_COLUMN_VALUES_H +#define PFS_COLUMN_VALUES_H + +/** + @file storage/perfschema/pfs_column_values.h + Literal values for columns used in the + performance schema tables (declarations). +*/ + +extern LEX_STRING PERFORMANCE_SCHEMA_str; + +extern LEX_STRING mutex_instrument_prefix; +extern LEX_STRING rwlock_instrument_prefix; +extern LEX_STRING cond_instrument_prefix; +extern LEX_STRING thread_instrument_prefix; +extern LEX_STRING file_instrument_prefix; + +#endif + diff --git a/storage/perfschema/pfs_engine_table.cc b/storage/perfschema/pfs_engine_table.cc new file mode 100644 index 00000000000..4190094b52b --- /dev/null +++ b/storage/perfschema/pfs_engine_table.cc @@ -0,0 +1,717 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_engine_table.cc + Performance schema tables (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_engine_table.h" + +#include "table_events_waits.h" +#include "table_setup_consumers.h" +#include "table_setup_instruments.h" +#include "table_setup_objects.h" +#include "table_setup_timers.h" +#include "table_performance_timers.h" +#include "table_processlist.h" +#include "table_events_waits_summary.h" +#include "table_sync_instances.h" +#include "table_file_instances.h" +#include "table_file_summary.h" + +/* For show status */ +#include "pfs_column_values.h" +#include "pfs_instr.h" + +/** + @addtogroup Performance_schema_engine + @{ +*/ + +static PFS_engine_table_share *all_shares[]= +{ + &table_events_waits_current::m_share, + &table_events_waits_history::m_share, + &table_events_waits_history_long::m_share, + &table_setup_consumers::m_share, + &table_setup_instruments::m_share, + &table_setup_objects::m_share, + &table_setup_timers::m_share, + &table_performance_timers::m_share, + &table_processlist::m_share, + &table_events_waits_summary_by_thread_by_event_name::m_share, + &table_events_waits_summary_by_event_name::m_share, + &table_events_waits_summary_by_instance::m_share, + &table_file_summary_by_event_name::m_share, + &table_file_summary_by_instance::m_share, + &table_mutex_instances::m_share, + &table_rwlock_instances::m_share, + &table_cond_instances::m_share, + &table_file_instances::m_share, + NULL +}; + +/** + Check all the tables structure. + @param thd current thread +*/ +void PFS_engine_table_share::check_all_tables(THD *thd) +{ + PFS_engine_table_share **current; + + DBUG_EXECUTE_IF("tampered_perfschema_table1", + { + /* Hack SETUP_INSTRUMENT, incompatible change. */ + all_shares[4]->m_field_def->count++; + }); + + for (current= &all_shares[0]; (*current) != NULL; current++) + (*current)->check_one_table(thd); +} + +class PFS_check_intact : public Table_check_intact +{ +protected: + virtual void report_error(uint code, const char *fmt, ...); + +public: + PFS_check_intact() + {} + + ~PFS_check_intact() + {} +}; + +void PFS_check_intact::report_error(uint code, const char *fmt, ...) +{ + va_list args; + char buff[MYSQL_ERRMSG_SIZE]; + + va_start(args, fmt); + my_vsnprintf(buff, sizeof(buff), fmt, args); + va_end(args); + + my_message(code, buff, MYF(0)); +} + +/** + Check integrity of the actual table schema. + The actual table schema (.frm) is compared to the expected schema. + @param thd current thread +*/ +void PFS_engine_table_share::check_one_table(THD *thd) +{ + TABLE_LIST tables; + + tables.init_one_table(PERFORMANCE_SCHEMA_str.str, + m_name.str, TL_READ); + + /* Work around until Bug#32115 is backported. */ + LEX dummy_lex; + LEX *old_lex= thd->lex; + thd->lex= &dummy_lex; + lex_start(thd); + + if (! simple_open_n_lock_tables(thd, &tables)) + { + PFS_check_intact checker; + + if (!checker.check(tables.table, m_field_def)) + m_checked= true; + close_thread_tables(thd); + } + + lex_end(&dummy_lex); + thd->lex= old_lex; +} + +/** Initialize all the table share locks. */ +void PFS_engine_table_share::init_all_locks(void) +{ + PFS_engine_table_share **current; + + for (current= &all_shares[0]; (*current) != NULL; current++) + thr_lock_init((*current)->m_thr_lock_ptr); +} + +/** Delete all the table share locks. */ +void PFS_engine_table_share::delete_all_locks(void) +{ + PFS_engine_table_share **current; + + for (current= &all_shares[0]; (*current) != NULL; current++) + thr_lock_delete((*current)->m_thr_lock_ptr); +} + +static int compare_table_names(const char *name1, const char *name2) +{ + /* + The performance schema is implemented as a storage engine, in memory. + The current storage engine interface exposed by the server, + and in particular handlerton::discover, uses 'FRM' files to describe a + table structure, which are later stored on disk, by the server, + in ha_create_table_from_engine(). + Because the table metadata is stored on disk, the table naming rules + used by the performance schema then have to comply with the constraints + imposed by the disk storage, and in particular with lower_case_table_names. + Once the server is changed to be able to discover a table in a storage engine + and then open the table without storing a FRM file on disk, this constraint + on the performance schema will be lifted, and the naming logic can be relaxed + to be simply my_strcasecmp(system_charset_info, name1, name2). + */ + if (lower_case_table_names) + return strcasecmp(name1, name2); + return strcmp(name1, name2); +} + +/** + Find a table share by name. + @param name The table name + @return table share +*/ +const PFS_engine_table_share* +PFS_engine_table::find_engine_table_share(const char *name) +{ + DBUG_ENTER("PFS_engine_table::find_table_share"); + + PFS_engine_table_share **current; + + for (current= &all_shares[0]; (*current) != NULL; current++) + { + if (compare_table_names(name, (*current)->m_name.str) == 0) + DBUG_RETURN(*current); + } + + DBUG_RETURN(NULL); +} + +/** + Read a table row. + @param table Table handle + @param buf Row buffer + @param fields Table fields + @return 0 on success +*/ +int PFS_engine_table::read_row(TABLE *table, + unsigned char *buf, + Field **fields) +{ + my_bitmap_map *org_bitmap; + + /* + Make sure the table structure is as expected before mapping + hard wired columns in read_row_values. + */ + if (! m_share_ptr->m_checked) + { + my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0), + PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name); + return HA_ERR_TABLE_NEEDS_UPGRADE; + } + + /* We must read all columns in case a table is opened for update */ + bool read_all= !bitmap_is_clear_all(table->write_set); + + /* We internally write to Fields to support the read interface */ + org_bitmap= dbug_tmp_use_all_columns(table, table->write_set); + int result= read_row_values(table, buf, fields, read_all); + dbug_tmp_restore_column_map(table->write_set, org_bitmap); + + return result; +} + +/** + Update a table row. + @param table Table handle + @param old_buf old row buffer + @param new_buf new row buffer + @param fields Table fields + @return 0 on success +*/ +int PFS_engine_table::update_row(TABLE *table, + const unsigned char *old_buf, + unsigned char *new_buf, + Field **fields) +{ + my_bitmap_map *org_bitmap; + + /* + Make sure the table structure is as expected before mapping + hard wired columns in update_row_values. + */ + if (! m_share_ptr->m_checked) + { + my_error(ER_WRONG_NATIVE_TABLE_STRUCTURE, MYF(0), + PERFORMANCE_SCHEMA_str.str, m_share_ptr->m_name); + return HA_ERR_TABLE_NEEDS_UPGRADE; + } + + /* We internally read from Fields to support the write interface */ + org_bitmap= dbug_tmp_use_all_columns(table, table->read_set); + int result= update_row_values(table, old_buf, new_buf, fields); + dbug_tmp_restore_column_map(table->read_set, org_bitmap); + + return result; +} + +/** + Get the position of the current row. + @param [out] ref position +*/ +void PFS_engine_table::get_position(void *ref) +{ + memcpy(ref, m_pos_ptr, m_share_ptr->m_ref_length); +} + +/** + Set the table cursor at a given position. + @param [in] ref position +*/ +void PFS_engine_table::set_position(const void *ref) +{ + memcpy(m_pos_ptr, ref, m_share_ptr->m_ref_length); +} + +void PFS_engine_table::set_field_ulong(Field *f, ulong value) +{ + DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONG); + Field_long *f2= (Field_long*) f; + f2->store(value, true); +} + +void PFS_engine_table::set_field_ulonglong(Field *f, ulonglong value) +{ + DBUG_ASSERT(f->real_type() == MYSQL_TYPE_LONGLONG); + Field_longlong *f2= (Field_longlong*) f; + f2->store(value, true); +} + +void PFS_engine_table::set_field_varchar_utf8(Field *f, const char* str, + uint len) +{ + DBUG_ASSERT(f->real_type() == MYSQL_TYPE_VARCHAR); + Field_varstring *f2= (Field_varstring*) f; + f2->store(str, len, &my_charset_utf8_bin); +} + +void PFS_engine_table::set_field_enum(Field *f, ulonglong value) +{ + DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM); + Field_enum *f2= (Field_enum*) f; + f2->store_type(value); +} + +ulonglong PFS_engine_table::get_field_enum(Field *f) +{ + DBUG_ASSERT(f->real_type() == MYSQL_TYPE_ENUM); + Field_enum *f2= (Field_enum*) f; + return f2->val_int(); +} + +int PFS_readonly_table::update_row_values(TABLE *, + const unsigned char *, + unsigned char *, + Field **) +{ + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + return HA_ERR_WRONG_COMMAND; +} + +class PFS_internal_schema_access : public ACL_internal_schema_access +{ +public: + PFS_internal_schema_access() + {} + + ~PFS_internal_schema_access() + {} + + ACL_internal_access_result check(ulong want_access, + ulong *save_priv) const; + + const ACL_internal_table_access *lookup(const char *name) const; +}; + +ACL_internal_access_result +PFS_internal_schema_access::check(ulong want_access, + ulong *save_priv) const +{ + const ulong always_forbidden= /* CREATE_ACL | */ REFERENCES_ACL + | INDEX_ACL | ALTER_ACL | CREATE_TMP_ACL | EXECUTE_ACL + | CREATE_VIEW_ACL | SHOW_VIEW_ACL | CREATE_PROC_ACL | ALTER_PROC_ACL + | EVENT_ACL | TRIGGER_ACL ; + + if (unlikely(want_access & always_forbidden)) + return ACL_INTERNAL_ACCESS_DENIED; + + /* + Proceed with regular grant tables, + to give administrative control to the DBA. + */ + return ACL_INTERNAL_ACCESS_CHECK_GRANT; +} + +const ACL_internal_table_access * +PFS_internal_schema_access::lookup(const char *name) const +{ + const PFS_engine_table_share* share; + share= PFS_engine_table::find_engine_table_share(name); + if (share) + return share->m_acl; + /* + Do not return NULL, it would mean we are not interested + in privilege checks for unknown tables. + Instead, return an object that denies every actions, + to prevent users for creating their own tables in the + performance_schema database schema. + */ + return &pfs_unknown_acl; +} + +PFS_internal_schema_access pfs_internal_access; + +void initialize_performance_schema_acl(bool bootstrap) +{ + /* + ACL is always enforced, even if the performance schema + is not enabled (the tables are still visible). + */ + if (! bootstrap) + { + ACL_internal_schema_registry::register_schema(&PERFORMANCE_SCHEMA_str, + &pfs_internal_access); + } +} + +PFS_readonly_acl pfs_readonly_acl; + +ACL_internal_access_result +PFS_readonly_acl::check(ulong want_access, ulong *save_priv) const +{ + const ulong always_forbidden= INSERT_ACL | UPDATE_ACL | DELETE_ACL + | /* CREATE_ACL | */ REFERENCES_ACL | INDEX_ACL | ALTER_ACL + | CREATE_VIEW_ACL | SHOW_VIEW_ACL | TRIGGER_ACL | LOCK_TABLES_ACL; + + if (unlikely(want_access & always_forbidden)) + return ACL_INTERNAL_ACCESS_DENIED; + + return ACL_INTERNAL_ACCESS_CHECK_GRANT; +} + +PFS_truncatable_acl pfs_truncatable_acl; + +ACL_internal_access_result +PFS_truncatable_acl::check(ulong want_access, ulong *save_priv) const +{ + const ulong always_forbidden= INSERT_ACL | UPDATE_ACL | DELETE_ACL + | /* CREATE_ACL | */ REFERENCES_ACL | INDEX_ACL | ALTER_ACL + | CREATE_VIEW_ACL | SHOW_VIEW_ACL | TRIGGER_ACL | LOCK_TABLES_ACL; + + if (unlikely(want_access & always_forbidden)) + return ACL_INTERNAL_ACCESS_DENIED; + + return ACL_INTERNAL_ACCESS_CHECK_GRANT; +} + +PFS_updatable_acl pfs_updatable_acl; + +ACL_internal_access_result +PFS_updatable_acl::check(ulong want_access, ulong *save_priv) const +{ + const ulong always_forbidden= INSERT_ACL | DELETE_ACL + | /* CREATE_ACL | */ REFERENCES_ACL | INDEX_ACL | ALTER_ACL + | CREATE_VIEW_ACL | SHOW_VIEW_ACL | TRIGGER_ACL; + + if (unlikely(want_access & always_forbidden)) + return ACL_INTERNAL_ACCESS_DENIED; + + return ACL_INTERNAL_ACCESS_CHECK_GRANT; +} + +PFS_editable_acl pfs_editable_acl; + +ACL_internal_access_result +PFS_editable_acl::check(ulong want_access, ulong *save_priv) const +{ + const ulong always_forbidden= /* CREATE_ACL | */ REFERENCES_ACL + | INDEX_ACL | ALTER_ACL | CREATE_VIEW_ACL | SHOW_VIEW_ACL | TRIGGER_ACL; + + if (unlikely(want_access & always_forbidden)) + return ACL_INTERNAL_ACCESS_DENIED; + + return ACL_INTERNAL_ACCESS_CHECK_GRANT; +} + +PFS_unknown_acl pfs_unknown_acl; + +ACL_internal_access_result +PFS_unknown_acl::check(ulong want_access, ulong *save_priv) const +{ + return ACL_INTERNAL_ACCESS_DENIED; +} + +/** + SHOW ENGINE PERFORMANCE_SCHEMA STATUS. + @param hton Storage engine handler + @param thd Current thread + @param print Print function + @param stat status to show +*/ +bool pfs_show_status(handlerton *hton, THD *thd, + stat_print_fn *print, enum ha_stat_type stat) +{ + char buf[1024]; + uint buflen; + const char *name; + int i; + uint size; + + DBUG_ENTER("pfs_show_status"); + + /* + Note about naming conventions: + - Internal buffers exposed as a table in the performance schema are named + after the table, as in 'EVENTS_WAITS_CURRENT' + - Internal buffers not exposed by a table are named with parenthesis, + as in '(PFS_MUTEX_CLASS)'. + */ + if (stat != HA_ENGINE_STATUS) + DBUG_RETURN(false); + + uint total_memory= 0; + + for (i=0; /* empty */; i++) + { + switch (i){ + case 0: + name= "EVENTS_WAITS_CURRENT.ROW_SIZE"; + size= sizeof(PFS_wait_locker); + break; + case 1: + name= "EVENTS_WAITS_CURRENT.ROW_COUNT"; + size= LOCKER_STACK_SIZE * thread_max; + break; + case 2: + name= "EVENTS_WAITS_HISTORY.ROW_SIZE"; + size= sizeof(PFS_events_waits); + break; + case 3: + name= "EVENTS_WAITS_HISTORY.ROW_COUNT"; + size= events_waits_history_per_thread * thread_max; + break; + case 4: + name= "EVENTS_WAITS_HISTORY.MEMORY"; + size= events_waits_history_per_thread * thread_max + * sizeof(PFS_events_waits); + total_memory+= size; + break; + case 5: + name= "EVENTS_WAITS_HISTORY_LONG.ROW_SIZE"; + size= sizeof(PFS_events_waits); + break; + case 6: + name= "EVENTS_WAITS_HISTORY_LONG.ROW_COUNT"; + size= events_waits_history_long_size; + break; + case 7: + name= "EVENTS_WAITS_HISTORY_LONG.MEMORY"; + size= events_waits_history_long_size * sizeof(PFS_events_waits); + total_memory+= size; + break; + case 8: + name= "(PFS_MUTEX_CLASS).ROW_SIZE"; + size= sizeof(PFS_mutex_class); + break; + case 9: + name= "(PFS_MUTEX_CLASS).ROW_COUNT"; + size= mutex_class_max; + break; + case 10: + name= "(PFS_MUTEX_CLASS).MEMORY"; + size= mutex_class_max * sizeof(PFS_mutex_class); + total_memory+= size; + break; + case 11: + name= "(PFS_RWLOCK_CLASS).ROW_SIZE"; + size= sizeof(PFS_rwlock_class); + break; + case 12: + name= "(PFS_RWLOCK_CLASS).ROW_COUNT"; + size= rwlock_class_max; + break; + case 13: + name= "(PFS_RWLOCK_CLASS).MEMORY"; + size= rwlock_class_max * sizeof(PFS_rwlock_class); + total_memory+= size; + break; + case 14: + name= "(PFS_COND_CLASS).ROW_SIZE"; + size= sizeof(PFS_cond_class); + break; + case 15: + name= "(PFS_COND_CLASS).ROW_COUNT"; + size= cond_class_max; + break; + case 16: + name= "(PFS_COND_CLASS).MEMORY"; + size= cond_class_max * sizeof(PFS_cond_class); + total_memory+= size; + break; + case 17: + name= "(PFS_THREAD_CLASS).ROW_SIZE"; + size= sizeof(PFS_thread_class); + break; + case 18: + name= "(PFS_THREAD_CLASS).ROW_COUNT"; + size= thread_class_max; + break; + case 19: + name= "(PFS_THREAD_CLASS).MEMORY"; + size= thread_class_max * sizeof(PFS_thread_class); + total_memory+= size; + break; + case 20: + name= "(PFS_FILE_CLASS).ROW_SIZE"; + size= sizeof(PFS_file_class); + break; + case 21: + name= "(PFS_FILE_CLASS).ROW_COUNT"; + size= file_class_max; + break; + case 22: + name= "(PFS_FILE_CLASS).MEMORY"; + size= file_class_max * sizeof(PFS_file_class); + total_memory+= size; + break; + case 23: + name= "MUTEX_INSTANCES.ROW_SIZE"; + size= sizeof(PFS_mutex); + break; + case 24: + name= "MUTEX_INSTANCES.ROW_COUNT"; + size= mutex_max; + break; + case 25: + name= "MUTEX_INSTANCES.MEMORY"; + size= mutex_max * sizeof(PFS_mutex); + total_memory+= size; + break; + case 26: + name= "RWLOCK_INSTANCES.ROW_SIZE"; + size= sizeof(PFS_rwlock); + break; + case 27: + name= "RWLOCK_INSTANCES.ROW_COUNT"; + size= rwlock_max; + break; + case 28: + name= "RWLOCK_INSTANCES.MEMORY"; + size= rwlock_max * sizeof(PFS_rwlock); + total_memory+= size; + break; + case 29: + name= "COND_INSTANCES.ROW_SIZE"; + size= sizeof(PFS_cond); + break; + case 30: + name= "COND_INSTANCES.ROW_COUNT"; + size= cond_max; + break; + case 31: + name= "COND_INSTANCES.MEMORY"; + size= cond_max * sizeof(PFS_cond); + total_memory+= size; + break; + case 32: + name= "PROCESSLIST.ROW_SIZE"; + size= sizeof(PFS_thread); + break; + case 33: + name= "PROCESSLIST.ROW_COUNT"; + size= thread_max; + break; + case 34: + name= "PROCESSLIST.MEMORY"; + size= thread_max * sizeof(PFS_thread); + total_memory+= size; + break; + case 35: + name= "FILE_INSTANCES.ROW_SIZE"; + size= sizeof(PFS_file); + break; + case 36: + name= "FILE_INSTANCES.ROW_COUNT"; + size= file_max; + break; + case 37: + name= "FILE_INSTANCES.MEMORY"; + size= file_max * sizeof(PFS_file); + total_memory+= size; + break; + case 38: + name= "(PFS_FILE_HANDLE).ROW_SIZE"; + size= sizeof(PFS_file*); + break; + case 39: + name= "(PFS_FILE_HANDLE).ROW_COUNT"; + size= file_handle_max; + break; + case 40: + name= "(PFS_FILE_HANDLE).MEMORY"; + size= file_handle_max * sizeof(PFS_file*); + break; + case 41: + name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.ROW_SIZE"; + size= sizeof(PFS_single_stat_chain); + break; + case 42: + name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.ROW_COUNT"; + size= thread_max * instr_class_per_thread; + break; + case 43: + name= "EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME.MEMORY"; + size= thread_max * instr_class_per_thread * sizeof(PFS_single_stat_chain); + total_memory+= size; + break; + /* + This case must be last, + for aggregation in total_memory. + */ + case 44: + name= "PERFORMANCE_SCHEMA.MEMORY"; + size= total_memory; + break; + default: + goto end; + break; + } + + buflen= int10_to_str(size, buf, 10) - buf; + if (print(thd, + PERFORMANCE_SCHEMA_str.str, PERFORMANCE_SCHEMA_str.length, + name, strlen(name), + buf, buflen)) + DBUG_RETURN(true); + } + +end: + DBUG_RETURN(false); +} + +/** @} */ + + diff --git a/storage/perfschema/pfs_engine_table.h b/storage/perfschema/pfs_engine_table.h new file mode 100644 index 00000000000..6a826c9da7d --- /dev/null +++ b/storage/perfschema/pfs_engine_table.h @@ -0,0 +1,336 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_ENGINE_TABLE_H +#define PFS_ENGINE_TABLE_H + +/** + @file storage/perfschema/pfs_engine_table.h + Performance schema tables (declarations). +*/ + +class Field; +struct PFS_engine_table_share; + +/** + @addtogroup Performance_schema_engine + @{ +*/ + +/** + An abstract PERFORMANCE_SCHEMA table. + Every table implemented in the performance schema schema and storage engine + derives from this class. +*/ +class PFS_engine_table +{ +public: + static const PFS_engine_table_share* + find_engine_table_share(const char *name); + + int read_row(TABLE *table, unsigned char *buf, Field **fields); + + int update_row(TABLE *table, const unsigned char *old_buf, + unsigned char *new_buf, Field **fields); + + /** Fetch the next row in this cursor. */ + virtual int rnd_next(void)= 0; + /** + Fetch a row by position. + @param pos position to fetch + */ + virtual int rnd_pos(const void *pos)= 0; + + void get_position(void *ref); + void set_position(const void *ref); + virtual void reset_position(void)= 0; + + /** Destructor. */ + virtual ~PFS_engine_table() + {} + +protected: + /** + Read the current row values. + @param table Table handle + @param buf row buffer + @param fields Table fields + @param read_all true if all columns are read. + */ + virtual int read_row_values(TABLE *table, unsigned char *buf, + Field **fields, bool read_all)= 0; + + /** + Update the current row values. + @param table Table handle + @param old_buf old row buffer + @param new_buf new row buffer + @param fields Table fields + */ + virtual int update_row_values(TABLE *table, const unsigned char *old_buf, + unsigned char *new_buf, Field **fields)= 0; + + /** + Constructor. + @param share table share + @param pos address of the m_pos position member + */ + PFS_engine_table(const PFS_engine_table_share *share, void *pos) + : m_share_ptr(share), m_pos_ptr(pos) + {} + + void set_field_ulong(Field *f, ulong value); + void set_field_ulonglong(Field *f, ulonglong value); + void set_field_varchar_utf8(Field *f, const char* str, uint len); + void set_field_enum(Field *f, ulonglong value); + + ulonglong get_field_enum(Field *f); + + /** Table share. */ + const PFS_engine_table_share *m_share_ptr; + /** Opaque pointer to the m_pos position of this cursor. */ + void *m_pos_ptr; +}; + +/** Callback to open a table. */ +typedef PFS_engine_table* (*pfs_open_table_t)(void); +/** Callback to write a row. */ +typedef int (*pfs_write_row_t)(TABLE *table, + unsigned char *buf, Field **fields); +/** Callback to delete all rows. */ +typedef int (*pfs_delete_all_rows_t)(void); + +/** + A PERFORMANCE_SCHEMA table share. + This data is shared by all the table handles opened on the same table. +*/ +struct PFS_engine_table_share +{ + static void check_all_tables(THD *thd); + void check_one_table(THD *thd); + static void init_all_locks(void); + static void delete_all_locks(void); + + /** Table name. */ + LEX_STRING m_name; + /** Table ACL. */ + const ACL_internal_table_access *m_acl; + /** Open table function. */ + pfs_open_table_t m_open_table; + /** Write row function. */ + pfs_write_row_t m_write_row; + /** Delete all rows function. */ + pfs_delete_all_rows_t m_delete_all_rows; + /** + Number or records. + This number does not need to be precise, + it is used by the optimizer to decide if the table + has 0, 1, or many records. + */ + ha_rows m_records; + /** Length of the m_pos position structure. */ + uint m_ref_length; + /** The lock, stored on behalf of the SQL layer. */ + THR_LOCK *m_thr_lock_ptr; + /** Table fields definition. */ + TABLE_FIELD_DEF *m_field_def; + /** Schema integrity flag. */ + bool m_checked; +}; + +/** Adapter for read only PERFORMANCE_SCHEMA tables. */ +class PFS_readonly_table : public PFS_engine_table +{ +protected: + /** + Constructor. + @param share table share + @param pos address of the m_pos position member + */ + PFS_readonly_table(const PFS_engine_table_share *share, void *pos) + : PFS_engine_table(share, pos) + {} + + ~PFS_readonly_table() + {} + + virtual int update_row_values(TABLE *table, const unsigned char *old_buf, + unsigned char *new_buf, Field **fields); + +}; + +class PFS_readonly_acl : public ACL_internal_table_access +{ +public: + PFS_readonly_acl() + {} + + ~PFS_readonly_acl() + {} + + ACL_internal_access_result check(ulong want_access, ulong *save_priv) const; +}; + +extern PFS_readonly_acl pfs_readonly_acl; + +class PFS_truncatable_acl : public ACL_internal_table_access +{ +public: + PFS_truncatable_acl() + {} + + ~PFS_truncatable_acl() + {} + + ACL_internal_access_result check(ulong want_access, ulong *save_priv) const; +}; + +extern PFS_truncatable_acl pfs_truncatable_acl; + +class PFS_updatable_acl : public ACL_internal_table_access +{ +public: + PFS_updatable_acl() + {} + + ~PFS_updatable_acl() + {} + + ACL_internal_access_result check(ulong want_access, ulong *save_priv) const; +}; + +extern PFS_updatable_acl pfs_updatable_acl; + +class PFS_editable_acl : public ACL_internal_table_access +{ +public: + PFS_editable_acl() + {} + + ~PFS_editable_acl() + {} + + ACL_internal_access_result check(ulong want_access, ulong *save_priv) const; +}; + +extern PFS_editable_acl pfs_editable_acl; + +class PFS_unknown_acl : public ACL_internal_table_access +{ +public: + PFS_unknown_acl() + {} + + ~PFS_unknown_acl() + {} + + ACL_internal_access_result check(ulong want_access, ulong *save_priv) const; +}; + +extern PFS_unknown_acl pfs_unknown_acl; + +/** Position of a cursor, for simple iterations. */ +struct PFS_simple_index +{ + /** Current row index. */ + uint m_index; + + PFS_simple_index(uint index) + : m_index(index) + {} + + void set_at(const struct PFS_simple_index *other) + { m_index= other->m_index; } + + void set_after(const struct PFS_simple_index *other) + { m_index= other->m_index + 1; } + + void next(void) + { m_index++; } +}; + +struct PFS_double_index +{ + /** Outer index. */ + uint m_index_1; + /** Current index within index_1. */ + uint m_index_2; + + PFS_double_index(uint index_1, uint index_2) + : m_index_1(index_1), m_index_2(index_2) + {} + + void set_at(const struct PFS_double_index *other) + { + m_index_1= other->m_index_1; + m_index_2= other->m_index_2; + } + + void set_after(const struct PFS_double_index *other) + { + m_index_1= other->m_index_1; + m_index_2= other->m_index_2 + 1; + } +}; + +struct PFS_triple_index +{ + /** Outer index. */ + uint m_index_1; + /** Current index within index_1. */ + uint m_index_2; + /** Current index within index_2. */ + uint m_index_3; + + PFS_triple_index(uint index_1, uint index_2, uint index_3) + : m_index_1(index_1), m_index_2(index_2), m_index_3(index_3) + {} + + void set_at(const struct PFS_triple_index *other) + { + m_index_1= other->m_index_1; + m_index_2= other->m_index_2; + m_index_3= other->m_index_3; + } + + void set_after(const struct PFS_triple_index *other) + { + m_index_1= other->m_index_1; + m_index_2= other->m_index_2; + m_index_3= other->m_index_3 + 1; + } +}; + +struct PFS_instrument_view_constants +{ + static const uint VIEW_MUTEX= 1; + static const uint VIEW_RWLOCK= 2; + static const uint VIEW_COND= 3; + static const uint VIEW_FILE= 4; +}; + +struct PFS_object_view_constants +{ + static const uint VIEW_TABLE= 1; + static const uint VIEW_EVENT= 2; + static const uint VIEW_PROCEDURE= 3; + static const uint VIEW_FUNCTION= 4; +}; + +bool pfs_show_status(handlerton *hton, THD *thd, + stat_print_fn *print, enum ha_stat_type stat); + +/** @} */ +#endif diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc new file mode 100644 index 00000000000..22448af7c5f --- /dev/null +++ b/storage/perfschema/pfs_events_waits.cc @@ -0,0 +1,197 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_events_waits.cc + Events waits data structures (implementation). +*/ + +#include "my_global.h" +#include "my_sys.h" +#include "pfs_global.h" +#include "pfs_instr.h" +#include "pfs_events_waits.h" +#include "pfs_atomic.h" +#include "m_string.h" + +ulong events_waits_history_long_size= 0; +/** Consumer flag for table EVENTS_WAITS_CURRENT. */ +bool flag_events_waits_current= true; +/** Consumer flag for table EVENTS_WAITS_HISTORY. */ +bool flag_events_waits_history= true; +/** Consumer flag for table EVENTS_WAITS_HISTORY_LONG. */ +bool flag_events_waits_history_long= true; +/** Consumer flag for table EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. */ +bool flag_events_waits_summary_by_thread_by_event_name= true; +/** Consumer flag for table EVENTS_WAITS_SUMMARY_BY_EVENT_NAME. */ +bool flag_events_waits_summary_by_event_name= true; +/** Consumer flag for table EVENTS_WAITS_SUMMARY_BY_INSTANCE. */ +bool flag_events_waits_summary_by_instance= true; +bool flag_events_locks_summary_by_thread_by_event_name= true; +bool flag_events_locks_summary_by_event_name= true; +bool flag_events_locks_summary_by_instance= true; +/** Consumer flag for table FILE_SUMMARY_BY_EVENT_NAME. */ +bool flag_file_summary_by_event_name= true; +/** Consumer flag for table FILE_SUMMARY_BY_INSTANCE. */ +bool flag_file_summary_by_instance= true; + +/** True if EVENTS_WAITS_HISTORY_LONG circular buffer is full. */ +bool events_waits_history_long_full= false; +/** Index in EVENTS_WAITS_HISTORY_LONG circular buffer. */ +volatile uint32 events_waits_history_long_index= 0; +/** EVENTS_WAITS_HISTORY_LONG circular buffer. */ +PFS_events_waits *events_waits_history_long_array= NULL; + +/** + Initialize table EVENTS_WAITS_HISTORY_LONG. + @param events_waits_history_long_sizing table sizing +*/ +int init_events_waits_history_long(uint events_waits_history_long_sizing) +{ + events_waits_history_long_size= events_waits_history_long_sizing; + events_waits_history_long_full= false; + PFS_atomic::store_u32(&events_waits_history_long_index, 0); + + if (events_waits_history_long_size == 0) + return 0; + + events_waits_history_long_array= + PFS_MALLOC_ARRAY(events_waits_history_long_size, PFS_events_waits, + MYF(MY_ZEROFILL)); + + return (events_waits_history_long_array ? 0 : 1); +} + +/** Cleanup table EVENTS_WAITS_HISTORY_LONG. */ +void cleanup_events_waits_history_long(void) +{ + pfs_free(events_waits_history_long_array); + events_waits_history_long_array= NULL; +} + +static void copy_events_waits(PFS_events_waits *dest, + const PFS_events_waits *source) +{ + /* m_wait_class must be the first member of PFS_events_waits. */ + compile_time_assert(offsetof(PFS_events_waits, m_wait_class) == 0); + + char* dest_body= (reinterpret_cast (dest)) + sizeof(events_waits_class); + const char* source_body= (reinterpret_cast (source)) + + sizeof(events_waits_class); + + /* See comments in table_events_waits_common::make_row(). */ + + /* Signal readers they are about to read garbage ... */ + dest->m_wait_class= NO_WAIT_CLASS; + /* ... that this can generate. */ + memcpy_fixed(dest_body, + source_body, + sizeof(PFS_events_waits) - sizeof(events_waits_class)); + /* Signal readers the record is now clean again. */ + dest->m_wait_class= source->m_wait_class; +} + +/** + Insert a wait record in table EVENTS_WAITS_HISTORY. + @param thread thread that executed the wait + @param wait record to insert +*/ +void insert_events_waits_history(PFS_thread *thread, PFS_events_waits *wait) +{ + uint index= thread->m_waits_history_index; + + /* + A concurrent thread executing TRUNCATE TABLE EVENTS_WAITS_CURRENT + could alter the data that this thread is inserting, + causing a potential race condition. + We are not testing for this and insert a possibly empty record, + to make this thread (the writer) faster. + This is ok, the truncated data will have + wait->m_wait_class == NO_WAIT_CLASS, + which readers of m_waits_history will filter out. + */ + copy_events_waits(&thread->m_waits_history[index], wait); + + index++; + if (index >= events_waits_history_per_thread) + { + index= 0; + thread->m_waits_history_full= true; + } + thread->m_waits_history_index= index; +} + +/** + Insert a wait record in table EVENTS_WAITS_HISTORY_LONG. + @param wait record to insert +*/ +void insert_events_waits_history_long(PFS_events_waits *wait) +{ + uint index= PFS_atomic::add_u32(&events_waits_history_long_index, 1); + + index= index % events_waits_history_long_size; + if (index == 0) + events_waits_history_long_full= true; + + /* See related comment in insert_events_waits_history. */ + copy_events_waits(&events_waits_history_long_array[index], wait); +} + +/** Reset table EVENTS_WAITS_CURRENT data. */ +void reset_events_waits_current(void) +{ + PFS_thread *pfs_thread= thread_array; + PFS_thread *pfs_thread_last= thread_array + thread_max; + + for ( ; pfs_thread < pfs_thread_last; pfs_thread++) + { + PFS_wait_locker *locker= pfs_thread->m_wait_locker_stack; + PFS_wait_locker *locker_last= locker + LOCKER_STACK_SIZE; + + for ( ; locker < locker_last; locker++) + locker->m_waits_current.m_wait_class= NO_WAIT_CLASS; + } +} + +/** Reset table EVENTS_WAITS_HISTORY data. */ +void reset_events_waits_history(void) +{ + PFS_thread *pfs_thread= thread_array; + PFS_thread *pfs_thread_last= thread_array + thread_max; + + for ( ; pfs_thread < pfs_thread_last; pfs_thread++) + { + PFS_events_waits *wait= pfs_thread->m_waits_history; + PFS_events_waits *wait_last= wait + events_waits_history_per_thread; + + pfs_thread->m_waits_history_index= 0; + pfs_thread->m_waits_history_full= false; + for ( ; wait < wait_last; wait++) + wait->m_wait_class= NO_WAIT_CLASS; + } +} + +/** Reset table EVENTS_WAITS_HISTORY_LONG data. */ +void reset_events_waits_history_long(void) +{ + PFS_atomic::store_u32(&events_waits_history_long_index, 0); + events_waits_history_long_full= false; + + PFS_events_waits *wait= events_waits_history_long_array; + PFS_events_waits *wait_last= wait + events_waits_history_long_size; + for ( ; wait < wait_last; wait++) + wait->m_wait_class= NO_WAIT_CLASS; +} + diff --git a/storage/perfschema/pfs_events_waits.h b/storage/perfschema/pfs_events_waits.h new file mode 100644 index 00000000000..c677e83ad34 --- /dev/null +++ b/storage/perfschema/pfs_events_waits.h @@ -0,0 +1,185 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_EVENTS_WAITS_H +#define PFS_EVENTS_WAITS_H + +/** + @file storage/perfschema/pfs_events_waits.h + Events waits data structures (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_lock.h" + +struct PFS_mutex; +struct PFS_rwlock; +struct PFS_cond; +struct PFS_table; +struct PFS_file; +struct PFS_thread; +struct PFS_instr_class; + +/** Class of a wait event. */ +enum events_waits_class +{ + NO_WAIT_CLASS= 0, + WAIT_CLASS_MUTEX, + WAIT_CLASS_RWLOCK, + WAIT_CLASS_COND, + WAIT_CLASS_TABLE, + WAIT_CLASS_FILE +}; + +/** State of a timer. */ +enum timer_state +{ + /** + Not timed. + In this state, TIMER_START, TIMER_END and TIMER_WAIT are NULL. + */ + TIMER_STATE_UNTIMED, + /** + About to start. + In this state, TIMER_START, TIMER_END and TIMER_WAIT are NULL. + */ + TIMER_STATE_STARTING, + /** + Started, but not yet ended. + In this state, TIMER_START has a value, TIMER_END and TIMER_WAIT are NULL. + */ + TIMER_STATE_STARTED, + /** + Ended. + In this state, TIMER_START, TIMER_END and TIMER_WAIT have a value. + */ + TIMER_STATE_TIMED +}; + +/** Target object a wait event is waiting on. */ +union events_waits_target +{ + /** Mutex waited on. */ + PFS_mutex *m_mutex; + /** RWLock waited on. */ + PFS_rwlock *m_rwlock; + /** Condition waited on. */ + PFS_cond *m_cond; + /** Table waited on. */ + PFS_table *m_table; + /** File waited on. */ + PFS_file *m_file; +}; + +/** A wait event record. */ +struct PFS_events_waits +{ + /** + The type of wait. + Readers: + - the consumer threads. + Writers: + - the producer threads, in the instrumentation. + Out of bound Writers: + - TRUNCATE EVENTS_WAITS_CURRENT + - TRUNCATE EVENTS_WAITS_HISTORY + - TRUNCATE EVENTS_WAITS_HISTORY_LONG + */ + volatile events_waits_class m_wait_class; + /** Executing thread. */ + PFS_thread *m_thread; + /** Instrument metadata. */ + PFS_instr_class *m_class; + /** Timer state. */ + enum timer_state m_timer_state; + /** Event id. */ + ulonglong m_event_id; + /** + Timer start. + This member is populated only if m_timed is true. + */ + ulonglong m_timer_start; + /** + Timer end. + This member is populated only if m_timed is true. + */ + ulonglong m_timer_end; + /** Schema name. */ + const char *m_schema_name; + /** Length in bytes of @c m_schema_name. */ + uint m_schema_name_length; + /** Object name. */ + const char *m_object_name; + /** Length in bytes of @c m_object_name. */ + uint m_object_name_length; + /** Address in memory of the object instance waited on. */ + const void *m_object_instance_addr; + /** Location of the instrumentation in the source code (file name). */ + const char *m_source_file; + /** Location of the instrumentation in the source code (line number). */ + uint m_source_line; + /** Operation performed. */ + enum_operation_type m_operation; + /** + Number of bytes read/written. + This member is populated for file READ/WRITE operations only. + */ + size_t m_number_of_bytes; +}; + +/** + A wait locker. + A locker is a transient helper structure used by the instrumentation + during the recording of a wait. +*/ +struct PFS_wait_locker +{ + /** The timer used to measure the wait. */ + enum_timer_name m_timer_name; + /** The object waited on. */ + events_waits_target m_target; + /** The wait data recorded. */ + PFS_events_waits m_waits_current; +}; + +void insert_events_waits_history(PFS_thread *thread, PFS_events_waits *wait); + +void insert_events_waits_history_long(PFS_events_waits *wait); + +extern bool flag_events_waits_current; +extern bool flag_events_waits_history; +extern bool flag_events_waits_history_long; +extern bool flag_events_waits_summary_by_thread_by_event_name; +extern bool flag_events_waits_summary_by_event_name; +extern bool flag_events_waits_summary_by_instance; +extern bool flag_events_locks_summary_by_thread_by_name; +extern bool flag_events_locks_summary_by_event_name; +extern bool flag_events_locks_summary_by_instance; +extern bool flag_file_summary_by_event_name; +extern bool flag_file_summary_by_instance; +extern bool events_waits_history_long_full; +extern volatile uint32 events_waits_history_long_index; +extern PFS_events_waits *events_waits_history_long_array; +extern ulong events_waits_history_long_size; + +int init_events_waits_history_long(uint events_waits_history_long_sizing); +void cleanup_events_waits_history_long(); + +void reset_events_waits_current(); +void reset_events_waits_history(); +void reset_events_waits_history_long(); + +#endif + diff --git a/storage/perfschema/pfs_global.cc b/storage/perfschema/pfs_global.cc new file mode 100644 index 00000000000..cac7d0b06e7 --- /dev/null +++ b/storage/perfschema/pfs_global.cc @@ -0,0 +1,66 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_global.cc + Miscellaneous global dependencies (implementation). +*/ + +#include "my_global.h" +#include "my_sys.h" +#include "pfs_global.h" + +#include +#include + +bool pfs_initialized= false; + +/** + Memory allocation for the performance schema. + The memory used internally in the performance schema implementation + is allocated once during startup, and considered static thereafter. +*/ +void *pfs_malloc(size_t size, myf flags) +{ + DBUG_ASSERT(! pfs_initialized); + DBUG_ASSERT(size > 0); + + void *ptr= malloc(size); + if (ptr && (flags & MY_ZEROFILL)) + memset(ptr, 0, size); + return ptr; +} + +void pfs_free(void *ptr) +{ + if (ptr != NULL) + free(ptr); +} + +void pfs_print_error(const char *format, ...) +{ + va_list args; + va_start(args, format); + /* + Printing to anything else, like the error log, would generate even more + recursive calls to the performance schema implementation + (file io is instrumented), so that could lead to catastrophic results. + Printing to something safe, and low level: stderr only. + */ + vfprintf(stderr, format, args); + va_end(args); + fflush(stderr); +} + diff --git a/storage/perfschema/pfs_global.h b/storage/perfschema/pfs_global.h new file mode 100644 index 00000000000..37809f8cc2e --- /dev/null +++ b/storage/perfschema/pfs_global.h @@ -0,0 +1,59 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_GLOBAL_H +#define PFS_GLOBAL_H + +/** + @file storage/perfschema/pfs_global.h + Miscellaneous global dependencies (declarations). +*/ + +extern bool pfs_initialized; + +void *pfs_malloc(size_t size, myf flags); +#define PFS_MALLOC_ARRAY(n, T, f) \ + reinterpret_cast (pfs_malloc((n) * sizeof(T), (f))) +void pfs_free(void *ptr); + +inline uint randomized_index(const void *ptr, uint max_size) +{ + if (unlikely(max_size == 0)) + return 0; + + /* + ptr is typically an aligned structure, + so the last bits are not really random, but this has no effect. + Apply a factor A*x to spread + close values of ptr further apart (which helps with arrays), + and to spread values way beyond a typical max_size. + Then, apply a modulo to end within [0, max_size - 1]. + A is big prime numbers, to avoid resonating with max_size, + to have a uniform distribution in [0, max_size - 1]. + The value of A is chosen so that index(ptr) and index(ptr + N) (for arrays) + are likely to be not similar for typical values of max_size + (50, 100, 1000, etc). + In other words, (sizeof(T)*A % max_size) should not be a small number, + to avoid that with 'T array[max_size]', index(array[i]) + and index(array[i + 1]) end up pointing in the same area in [0, max_size - 1]. + */ + return static_cast + (((reinterpret_cast (ptr)) * 2166179) % max_size); +} + +void pfs_print_error(const char *format, ...); + +#endif + diff --git a/storage/perfschema/pfs_instr.cc b/storage/perfschema/pfs_instr.cc new file mode 100644 index 00000000000..2ce3a844290 --- /dev/null +++ b/storage/perfschema/pfs_instr.cc @@ -0,0 +1,962 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_instr.cc + Performance schema instruments (implementation). +*/ + +#include "my_global.h" +#include "mysql_priv.h" +#include "my_sys.h" +#include "pfs_stat.h" +#include "pfs_instr.h" +#include "pfs_global.h" + +/** + @addtogroup Performance_schema_buffers + @{ +*/ + +/** Size of the mutex instances array. @sa mutex_array */ +ulong mutex_max; +/** Number of mutexes instance lost. @sa mutex_array */ +ulong mutex_lost; +/** Size of the rwlock instances array. @sa rwlock_array */ +ulong rwlock_max; +/** Number or rwlock instances lost. @sa rwlock_array */ +ulong rwlock_lost; +/** Size of the conditions instances array. @sa cond_array */ +ulong cond_max; +/** Number of conditions instances lost. @sa cond_array */ +ulong cond_lost; +/** Size of the thread instances array. @sa thread_array */ +ulong thread_max; +/** Number or thread instances lost. @sa thread_array */ +ulong thread_lost; +/** Size of the file instances array. @sa file_array */ +ulong file_max; +/** Number of file instances lost. @sa file_array */ +ulong file_lost; +/** + Size of the file handle array. @sa file_handle_array. + Signed value, for easier comparisons with a file descriptor number. +*/ +long file_handle_max; +/** Number of file handle lost. @sa file_handle_array */ +ulong file_handle_lost; +/** Size of the table instances array. @sa table_array */ +ulong table_max; +/** Number of table instances lost. @sa table_array */ +ulong table_lost; +/** Number of EVENTS_WAITS_HISTORY records per thread. */ +ulong events_waits_history_per_thread; +/** Number of instruments class per thread. */ +ulong instr_class_per_thread; +/** Number of locker lost. @sa LOCKER_STACK_SIZE. */ +ulong locker_lost; + +/** + Mutex instrumentation instances array. + @sa mutex_max + @sa mutex_lost +*/ +PFS_mutex *mutex_array= NULL; + +/** + RWLock instrumentation instances array. + @sa rwlock_max + @sa rwlock_lost +*/ +PFS_rwlock *rwlock_array= NULL; + +/** + Condition instrumentation instances array. + @sa cond_max + @sa cond_lost +*/ +PFS_cond *cond_array= NULL; + +/** + Thread instrumentation instances array. + @sa thread_max + @sa thread_lost +*/ +PFS_thread *thread_array= NULL; + +/** + File instrumentation instances array. + @sa file_max + @sa file_lost + @sa filename_hash +*/ +PFS_file *file_array= NULL; + +/** + File instrumentation handle array. + @sa file_handle_max + @sa file_handle_lost +*/ +PFS_file **file_handle_array= NULL; + +/** + Table instrumentation instances array. + @sa table_max + @sa table_lost +*/ +PFS_table *table_array= NULL; + +static volatile uint32 thread_internal_id_counter= 0; + +static uint per_thread_rwlock_class_start; +static uint per_thread_cond_class_start; +static uint per_thread_file_class_start; +static uint thread_instr_class_waits_sizing; +static PFS_single_stat_chain *thread_instr_class_waits_array= NULL; + +static PFS_events_waits *thread_history_array= NULL; + +/** Hash table for instrumented files. */ +static LF_HASH filename_hash; +/** True if filename_hash is initialized. */ +static bool filename_hash_inited= false; + +/** + Initialize all the instruments instance buffers. + @param param sizing parameters + @return 0 on success +*/ +int init_instruments(const PFS_global_param *param) +{ + uint thread_history_sizing; + uint index; + + mutex_max= param->m_mutex_sizing; + mutex_lost= 0; + rwlock_max= param->m_rwlock_sizing; + rwlock_lost= 0; + cond_max= param->m_cond_sizing; + cond_lost= 0; + file_max= param->m_file_sizing; + file_lost= 0; + file_handle_max= param->m_file_handle_sizing; + file_handle_lost= 0; + table_max= param->m_table_sizing; + table_lost= 0; + thread_max= param->m_thread_sizing; + thread_lost= 0; + + events_waits_history_per_thread= param->m_events_waits_history_sizing; + thread_history_sizing= param->m_thread_sizing + * events_waits_history_per_thread; + + per_thread_rwlock_class_start= param->m_mutex_class_sizing; + per_thread_cond_class_start= per_thread_rwlock_class_start + + param->m_rwlock_class_sizing; + per_thread_file_class_start= per_thread_cond_class_start + + param->m_cond_class_sizing; + instr_class_per_thread= per_thread_file_class_start + + param->m_file_class_sizing; + + thread_instr_class_waits_sizing= param->m_thread_sizing + * instr_class_per_thread; + + mutex_array= NULL; + rwlock_array= NULL; + cond_array= NULL; + file_array= NULL; + file_handle_array= NULL; + table_array= NULL; + thread_array= NULL; + thread_history_array= NULL; + thread_instr_class_waits_array= NULL; + thread_internal_id_counter= 0; + + if (mutex_max > 0) + { + mutex_array= PFS_MALLOC_ARRAY(mutex_max, PFS_mutex, MYF(MY_ZEROFILL)); + if (unlikely(mutex_array == NULL)) + return 1; + } + + if (rwlock_max > 0) + { + rwlock_array= PFS_MALLOC_ARRAY(rwlock_max, PFS_rwlock, MYF(MY_ZEROFILL)); + if (unlikely(rwlock_array == NULL)) + return 1; + } + + if (cond_max > 0) + { + cond_array= PFS_MALLOC_ARRAY(cond_max, PFS_cond, MYF(MY_ZEROFILL)); + if (unlikely(cond_array == NULL)) + return 1; + } + + if (file_max > 0) + { + file_array= PFS_MALLOC_ARRAY(file_max, PFS_file, MYF(MY_ZEROFILL)); + if (unlikely(file_array == NULL)) + return 1; + } + + if (file_handle_max > 0) + { + file_handle_array= PFS_MALLOC_ARRAY(file_handle_max, PFS_file*, MYF(MY_ZEROFILL)); + if (unlikely(file_handle_array == NULL)) + return 1; + } + + if (table_max > 0) + { + table_array= PFS_MALLOC_ARRAY(table_max, PFS_table, MYF(MY_ZEROFILL)); + if (unlikely(table_array == NULL)) + return 1; + } + + if (thread_max > 0) + { + thread_array= PFS_MALLOC_ARRAY(thread_max, PFS_thread, MYF(MY_ZEROFILL)); + if (unlikely(thread_array == NULL)) + return 1; + } + + if (thread_history_sizing > 0) + { + thread_history_array= + PFS_MALLOC_ARRAY(thread_history_sizing, PFS_events_waits, + MYF(MY_ZEROFILL)); + if (unlikely(thread_history_array == NULL)) + return 1; + } + + if (thread_instr_class_waits_sizing > 0) + { + thread_instr_class_waits_array= + PFS_MALLOC_ARRAY(thread_instr_class_waits_sizing, + PFS_single_stat_chain, MYF(MY_ZEROFILL)); + if (unlikely(thread_instr_class_waits_array == NULL)) + return 1; + } + + for (index= 0; index < thread_instr_class_waits_sizing; index++) + { + /* + Currently, this chain is of length 1, + but it's still implemented as a stat chain, + since more aggregations are planned to be implemented in m_parent. + */ + thread_instr_class_waits_array[index].m_control_flag= + &flag_events_waits_summary_by_thread_by_event_name; + thread_instr_class_waits_array[index].m_parent= NULL; + } + + for (index= 0; index < thread_max; index++) + { + thread_array[index].m_waits_history= + &thread_history_array[index * events_waits_history_per_thread]; + thread_array[index].m_instr_class_wait_stats= + &thread_instr_class_waits_array[index * instr_class_per_thread]; + } + + return 0; +} + +/** + Find the per-thread wait statistics for a mutex class. + @param thread input thread + @param klass mutex class + @return the per thread per mutex class wait stat +*/ +PFS_single_stat_chain * +find_per_thread_mutex_class_wait_stat(PFS_thread *thread, + PFS_mutex_class *klass) +{ + PFS_single_stat_chain *stat; + uint index; + + DBUG_ASSERT(thread != NULL); + DBUG_ASSERT(klass != NULL); + index= klass->m_index; + DBUG_ASSERT(index < mutex_class_max); + + stat= &(thread->m_instr_class_wait_stats[index]); + return stat; +} + +/** + Find the per-thread wait statistics for a rwlock class. + @param thread input thread + @param klass rwlock class + @return the per thread per rwlock class wait stat +*/ +PFS_single_stat_chain * +find_per_thread_rwlock_class_wait_stat(PFS_thread *thread, + PFS_rwlock_class *klass) +{ + PFS_single_stat_chain *stat; + uint index; + + DBUG_ASSERT(thread != NULL); + DBUG_ASSERT(klass != NULL); + index= klass->m_index; + DBUG_ASSERT(index < rwlock_class_max); + + stat= &(thread->m_instr_class_wait_stats + [per_thread_rwlock_class_start + index]); + return stat; +} + +/** + Find the per-thread wait statistics for a condition class. + @param thread input thread + @param klass condition class + @return the per thread per condition class wait stat +*/ +PFS_single_stat_chain * +find_per_thread_cond_class_wait_stat(PFS_thread *thread, + PFS_cond_class *klass) +{ + PFS_single_stat_chain *stat; + uint index; + + DBUG_ASSERT(thread != NULL); + DBUG_ASSERT(klass != NULL); + index= klass->m_index; + DBUG_ASSERT(index < cond_class_max); + + stat= &(thread->m_instr_class_wait_stats + [per_thread_cond_class_start + index]); + return stat; +} + +/** + Find the per-thread wait statistics for a file class. + @param thread input thread + @param klass file class + @return the per thread per file class wait stat +*/ +PFS_single_stat_chain * +find_per_thread_file_class_wait_stat(PFS_thread *thread, + PFS_file_class *klass) +{ + PFS_single_stat_chain *stat; + uint index; + + DBUG_ASSERT(thread != NULL); + DBUG_ASSERT(klass != NULL); + index= klass->m_index; + DBUG_ASSERT(index < file_class_max); + + stat= &(thread->m_instr_class_wait_stats + [per_thread_file_class_start + index]); + return stat; +} + +/** Reset the wait statistics per thread. */ +void reset_per_thread_wait_stat(void) +{ + PFS_single_stat_chain *stat= thread_instr_class_waits_array; + PFS_single_stat_chain *stat_last= stat + thread_instr_class_waits_sizing; + + for ( ; stat < stat_last; stat++) + reset_single_stat_link(stat); +} + +/** Cleanup all the instruments buffers. */ +void cleanup_instruments(void) +{ + pfs_free(mutex_array); + mutex_array= NULL; + mutex_max= 0; + pfs_free(rwlock_array); + rwlock_array= NULL; + rwlock_max= 0; + pfs_free(cond_array); + cond_array= NULL; + cond_max= 0; + pfs_free(file_array); + file_array= NULL; + file_max= 0; + pfs_free(file_handle_array); + file_handle_array= NULL; + file_handle_max= 0; + pfs_free(table_array); + table_array= NULL; + table_max= 0; + pfs_free(thread_array); + thread_array= NULL; + thread_max= 0; + pfs_free(thread_history_array); + thread_history_array= NULL; + pfs_free(thread_instr_class_waits_array); + thread_instr_class_waits_array= NULL; +} + +static uchar *filename_hash_get_key(const uchar *entry, size_t *length, + my_bool) +{ + const PFS_file * const *typed_entry; + const PFS_file *file; + const void *result; + typed_entry= reinterpret_cast (entry); + DBUG_ASSERT(typed_entry != NULL); + file= *typed_entry; + DBUG_ASSERT(file != NULL); + *length= file->m_filename_length; + result= file->m_filename; + return const_cast (reinterpret_cast (result)); +} + +/** + Initialize the file name hash. + @return 0 on success +*/ +int init_file_hash(void) +{ + if (! filename_hash_inited) + { + lf_hash_init(&filename_hash, sizeof(PFS_file*), LF_HASH_UNIQUE, + 0, 0, filename_hash_get_key, &my_charset_bin); + filename_hash_inited= true; + } + return 0; +} + +/** Cleanup the file name hash. */ +void cleanup_file_hash(void) +{ + if (filename_hash_inited) + { + lf_hash_destroy(&filename_hash); + filename_hash_inited= false; + } +} + +/** + Create instrumentation for a mutex instance. + @param klass the mutex class + @param identity the mutex address + @return a mutex instance, or NULL +*/ +PFS_mutex* create_mutex(PFS_mutex_class *klass, const void *identity) +{ + int pass; + uint i= randomized_index(identity, mutex_max); + + /* + Pass 1: [random, mutex_max - 1] + Pass 2: [0, mutex_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + PFS_mutex *pfs= mutex_array + i; + PFS_mutex *pfs_last= mutex_array + mutex_max; + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_identity= identity; + pfs->m_class= klass; + pfs->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_instance; + pfs->m_wait_stat.m_parent= &klass->m_wait_stat; + reset_single_stat_link(&pfs->m_wait_stat); + pfs->m_lock_stat.m_control_flag= + &flag_events_locks_summary_by_instance; + pfs->m_lock_stat.m_parent= &klass->m_lock_stat; + reset_single_stat_link(&pfs->m_lock_stat); + pfs->m_owner= NULL; + pfs->m_last_locked= 0; + pfs->m_lock.dirty_to_allocated(); + return pfs; + } + } + } + } + + mutex_lost++; + return NULL; +} + +/** + Destroy instrumentation for a mutex instance. + @param pfs the mutex to destroy +*/ +void destroy_mutex(PFS_mutex *pfs) +{ + DBUG_ASSERT(pfs != NULL); + pfs->m_lock.allocated_to_free(); +} + +/** + Create instrumentation for a rwlock instance. + @param klass the rwlock class + @param identity the rwlock address + @return a rwlock instance, or NULL +*/ +PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity) +{ + int pass; + uint i= randomized_index(identity, rwlock_max); + + /* + Pass 1: [random, rwlock_max - 1] + Pass 2: [0, rwlock_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + PFS_rwlock *pfs= rwlock_array + i; + PFS_rwlock *pfs_last= rwlock_array + rwlock_max; + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_identity= identity; + pfs->m_class= klass; + pfs->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_instance; + pfs->m_wait_stat.m_parent= &klass->m_wait_stat; + reset_single_stat_link(&pfs->m_wait_stat); + pfs->m_lock.dirty_to_allocated(); + pfs->m_read_lock_stat.m_control_flag= + &flag_events_locks_summary_by_instance; + pfs->m_read_lock_stat.m_parent= &klass->m_read_lock_stat; + reset_single_stat_link(&pfs->m_read_lock_stat); + pfs->m_write_lock_stat.m_control_flag= + &flag_events_locks_summary_by_instance; + pfs->m_write_lock_stat.m_parent= &klass->m_write_lock_stat; + reset_single_stat_link(&pfs->m_write_lock_stat); + pfs->m_writer= NULL; + pfs->m_readers= 0; + pfs->m_last_written= 0; + pfs->m_last_read= 0; + return pfs; + } + } + } + } + + rwlock_lost++; + return NULL; +} + +/** + Destroy instrumentation for a rwlock instance. + @param pfs the rwlock to destroy +*/ +void destroy_rwlock(PFS_rwlock *pfs) +{ + DBUG_ASSERT(pfs != NULL); + pfs->m_lock.allocated_to_free(); +} + +/** + Create instrumentation for a condition instance. + @param klass the condition class + @param identity the condition address + @return a condition instance, or NULL +*/ +PFS_cond* create_cond(PFS_cond_class *klass, const void *identity) +{ + int pass; + uint i= randomized_index(identity, cond_max); + + /* + Pass 1: [random, cond_max - 1] + Pass 2: [0, cond_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + PFS_cond *pfs= cond_array + i; + PFS_cond *pfs_last= cond_array + cond_max; + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_identity= identity; + pfs->m_class= klass; + pfs->m_cond_stat.m_signal_count= 0; + pfs->m_cond_stat.m_broadcast_count= 0; + pfs->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_instance; + pfs->m_wait_stat.m_parent= &klass->m_wait_stat; + reset_single_stat_link(&pfs->m_wait_stat); + pfs->m_lock.dirty_to_allocated(); + return pfs; + } + } + } + } + + cond_lost++; + return NULL; +} + +/** + Destroy instrumentation for a condition instance. + @param pfs the condition to destroy +*/ +void destroy_cond(PFS_cond *pfs) +{ + DBUG_ASSERT(pfs != NULL); + pfs->m_lock.allocated_to_free(); +} + +/** + Create instrumentation for a thread instance. + @param klass the thread class + @param identity the thread address, + or a value characteristic of this thread + @param thread_id the PROCESSLIST thread id, + or 0 if unknown + @return a thread instance, or NULL +*/ +PFS_thread* create_thread(PFS_thread_class *klass, const void *identity, + ulong thread_id) +{ + int pass; + uint i= randomized_index(identity, thread_max); + + /* + Pass 1: [random, thread_max - 1] + Pass 2: [0, thread_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + PFS_thread *pfs= thread_array + i; + PFS_thread *pfs_last= thread_array + thread_max; + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_thread_internal_id= + PFS_atomic::add_u32(&thread_internal_id_counter, 1); + pfs->m_thread_id= thread_id; + pfs->m_event_id= 1; + pfs->m_enabled= true; + pfs->m_class= klass; + pfs->m_wait_locker_count= 0; + pfs->m_waits_history_full= false; + pfs->m_waits_history_index= 0; + + PFS_single_stat_chain *stat= pfs->m_instr_class_wait_stats; + PFS_single_stat_chain *stat_last= stat + instr_class_per_thread; + for ( ; stat < stat_last; stat++) + reset_single_stat_link(stat); + pfs->m_filename_hash_pins= NULL; + pfs->m_table_share_hash_pins= NULL; + pfs->m_lock.dirty_to_allocated(); + return pfs; + } + } + } + } + + thread_lost++; + return NULL; +} + +/** + Sanitize a PFS_thread pointer. + Validate that the PFS_thread is part of thread_array. + Sanitizing data is required when the data can be + damaged with expected race conditions, for example + involving EVENTS_WAITS_HISTORY_LONG. + @param unsafe the pointer to sanitize + @return a valid pointer, or NULL +*/ +PFS_thread *sanitize_thread(PFS_thread *unsafe) +{ + if ((&thread_array[0] <= unsafe) && + (unsafe < &thread_array[thread_max])) + return unsafe; + return NULL; +} + +/** + Destroy instrumentation for a thread instance. + @param pfs the thread to destroy +*/ +void destroy_thread(PFS_thread *pfs) +{ + DBUG_ASSERT(pfs != NULL); + if (pfs->m_filename_hash_pins) + { + lf_hash_put_pins(pfs->m_filename_hash_pins); + pfs->m_filename_hash_pins= NULL; + } + if (pfs->m_table_share_hash_pins) + { + lf_hash_put_pins(pfs->m_table_share_hash_pins); + pfs->m_table_share_hash_pins= NULL; + } + pfs->m_lock.allocated_to_free(); +} + +/** + Find or create instrumentation for a file instance by file name. + @param thread the executing instrumented thread + @param klass the file class + @param filename the file name + @param len the length in bytes of filename + @return a file instance, or NULL +*/ +PFS_file* +find_or_create_file(PFS_thread *thread, PFS_file_class *klass, + const char *filename, uint len) +{ + PFS_file *pfs; + int pass; + + if (! filename_hash_inited) + { + /* File instrumentation can be turned off. */ + file_lost++; + return NULL; + } + + if (unlikely(thread->m_filename_hash_pins == NULL)) + { + thread->m_filename_hash_pins= lf_hash_get_pins(&filename_hash); + if (unlikely(thread->m_filename_hash_pins == NULL)) + { + file_lost++; + return NULL; + } + } + + if (len >= sizeof(pfs->m_filename)) + len= sizeof(pfs->m_filename) - 1; + + PFS_file **entry; + uint retry_count= 0; + const uint retry_max= 3; +search: + entry= reinterpret_cast + (lf_hash_search(&filename_hash, thread->m_filename_hash_pins, + filename, len)); + if (entry && (entry != MY_ERRPTR)) + { + pfs= *entry; + pfs->m_file_stat.m_open_count++; + lf_hash_search_unpin(thread->m_filename_hash_pins); + return pfs; + } + + /* filename is not constant, just using it for noise on create */ + uint i= randomized_index(filename, file_max); + + /* + Pass 1: [random, file_max - 1] + Pass 2: [0, file_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + pfs= file_array + i; + PFS_file *pfs_last= file_array + file_max; + + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_class= klass; + strncpy(pfs->m_filename, filename, len); + pfs->m_filename[len]= '\0'; + pfs->m_filename_length= len; + pfs->m_file_stat.m_open_count= 1; + pfs->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_instance; + pfs->m_wait_stat.m_parent= &klass->m_wait_stat; + reset_single_stat_link(&pfs->m_wait_stat); + + int res; + res= lf_hash_insert(&filename_hash, thread->m_filename_hash_pins, + &pfs); + if (likely(res == 0)) + { + pfs->m_lock.dirty_to_allocated(); + return pfs; + } + + pfs->m_lock.dirty_to_free(); + + if (res > 0) + { + /* Duplicate insert by another thread */ + if (++retry_count > retry_max) + { + /* Avoid infinite loops */ + file_lost++; + return NULL; + } + goto search; + } + + /* OOM in lf_hash_insert */ + file_lost++; + return NULL; + } + } + } + } + + file_lost++; + return NULL; +} + +/** + Release instrumentation for a file instance. + @param pfs the file to release +*/ +void release_file(PFS_file *pfs) +{ + DBUG_ASSERT(pfs != NULL); + pfs->m_file_stat.m_open_count--; +} + +/** + Destroy instrumentation for a file instance. + @param thread the executing thread instrumentation + @param pfs the file to destroy +*/ +void destroy_file(PFS_thread *thread, PFS_file *pfs) +{ + DBUG_ASSERT(thread != NULL); + DBUG_ASSERT(thread->m_filename_hash_pins != NULL); + DBUG_ASSERT(pfs != NULL); + lf_hash_delete(&filename_hash, thread->m_filename_hash_pins, + pfs->m_filename, pfs->m_filename_length); + pfs->m_lock.allocated_to_free(); +} + +/** + Create instrumentation for a table instance. + @param share the table share + @param identity the table address + @return a table instance, or NULL +*/ +PFS_table* create_table(PFS_table_share *share, const void *identity) +{ + int pass; + uint i= randomized_index(identity, table_max); + + /* + Pass 1: [random, table_max - 1] + Pass 2: [0, table_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + PFS_table *pfs= table_array + i; + PFS_table *pfs_last= table_array + table_max; + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_identity= identity; + pfs->m_share= share; + pfs->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_instance; + pfs->m_wait_stat.m_parent= &share->m_wait_stat; + reset_single_stat_link(&pfs->m_wait_stat); + pfs->m_lock.dirty_to_allocated(); + return pfs; + } + } + } + } + + table_lost++; + return NULL; +} + +/** + Destroy instrumentation for a table instance. + @param pfs the table to destroy +*/ +void destroy_table(PFS_table *pfs) +{ + DBUG_ASSERT(pfs != NULL); + pfs->m_lock.allocated_to_free(); +} + +static void reset_mutex_waits_by_instance(void) +{ + PFS_mutex *pfs= mutex_array; + PFS_mutex *pfs_last= mutex_array + mutex_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +static void reset_rwlock_waits_by_instance(void) +{ + PFS_rwlock *pfs= rwlock_array; + PFS_rwlock *pfs_last= rwlock_array + rwlock_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +static void reset_cond_waits_by_instance(void) +{ + PFS_cond *pfs= cond_array; + PFS_cond *pfs_last= cond_array + cond_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +static void reset_file_waits_by_instance(void) +{ + PFS_file *pfs= file_array; + PFS_file *pfs_last= file_array + file_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +/** Reset the wait statistics per object instance. */ +void reset_events_waits_by_instance(void) +{ + reset_mutex_waits_by_instance(); + reset_rwlock_waits_by_instance(); + reset_cond_waits_by_instance(); + reset_file_waits_by_instance(); +} + +/** Reset the io statistics per file instance. */ +void reset_file_instance_io(void) +{ + PFS_file *pfs= file_array; + PFS_file *pfs_last= file_array + file_max; + + for ( ; pfs < pfs_last; pfs++) + reset_file_stat(&pfs->m_file_stat); +} + +/** @} */ diff --git a/storage/perfschema/pfs_instr.h b/storage/perfschema/pfs_instr.h new file mode 100644 index 00000000000..a150a13fb75 --- /dev/null +++ b/storage/perfschema/pfs_instr.h @@ -0,0 +1,266 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_INSTR_H +#define PFS_INSTR_H + +/** + @file storage/perfschema/pfs_instr.h + Performance schema instruments (declarations). +*/ + +#include +#include "pfs_lock.h" +#include "pfs_instr_class.h" +#include "pfs_events_waits.h" +#include "pfs_server.h" +#include "lf.h" + +/** + @addtogroup Performance_schema_buffers + @{ +*/ + +struct PFS_thread; + +struct PFS_instr +{ + /** Internal lock. */ + pfs_lock m_lock; + /** Instrument wait statistics chain. */ + PFS_single_stat_chain m_wait_stat; +}; + +/** Instrumented mutex implementation. @see PSI_mutex. */ +struct PFS_mutex : public PFS_instr +{ + /** Mutex identity, typically a pthread_mutex_t. */ + const void *m_identity; + /** Mutex class. */ + PFS_mutex_class *m_class; + /** + Mutex lock usage statistics chain. + This statistic is not exposed in user visible tables yet. + */ + PFS_single_stat_chain m_lock_stat; + /** Current owner. */ + PFS_thread *m_owner; + /** + Timestamp of the last lock. + This statistic is not exposed in user visible tables yet. + */ + ulonglong m_last_locked; +}; + +/** Instrumented rwlock implementation. @see PSI_rwlock. */ +struct PFS_rwlock : public PFS_instr +{ + /** RWLock identity, typically a pthread_rwlock_t. */ + const void *m_identity; + /** RWLock class. */ + PFS_rwlock_class *m_class; + /** + RWLock read lock usage statistics chain. + This statistic is not exposed in user visible tables yet. + */ + PFS_single_stat_chain m_read_lock_stat; + /** + RWLock write lock usage statistics chain. + This statistic is not exposed in user visible tables yet. + */ + PFS_single_stat_chain m_write_lock_stat; + /** Current writer thread. */ + PFS_thread *m_writer; + /** Current count of readers. */ + uint m_readers; + /** + Timestamp of the last write. + This statistic is not exposed in user visible tables yet. + */ + ulonglong m_last_written; + /** + Timestamp of the last read. + This statistic is not exposed in user visible tables yet. + */ + ulonglong m_last_read; +}; + +/** Instrumented cond implementation. @see PSI_cond. */ +struct PFS_cond : public PFS_instr +{ + /** Condition identity, typically a pthread_cond_t. */ + const void *m_identity; + /** Condition class. */ + PFS_cond_class *m_class; + /** Condition instance usage statistics. */ + PFS_cond_stat m_cond_stat; +}; + +/** Instrumented File and FILE implementation. @see PSI_file. */ +struct PFS_file : public PFS_instr +{ + /** File name. */ + char m_filename[FN_REFLEN]; + /** File name length in bytes. */ + uint m_filename_length; + /** File class. */ + PFS_file_class *m_class; + /** File usage statistics. */ + PFS_file_stat m_file_stat; +}; + +/** Instrumented table implementation. @see PSI_table. */ +struct PFS_table : public PFS_instr +{ + /** Table share. */ + PFS_table_share *m_share; + /** Table identity, typically a handler. */ + const void *m_identity; +}; + +/** + @def LOCKER_STACK_SIZE + Maximum number of nested waits. +*/ +#define LOCKER_STACK_SIZE 3 + +/** Instrumented thread implementation. @see PSI_thread. */ +struct PFS_thread +{ + /** Internal lock. */ + pfs_lock m_lock; + /** Pins for filename_hash. */ + LF_PINS *m_filename_hash_pins; + /** Pins for table_share_hash. */ + LF_PINS *m_table_share_hash_pins; + /** Event ID counter */ + ulonglong m_event_id; + /** Thread instrumentation flag. */ + bool m_enabled; + /** Internal thread identifier, unique. */ + ulong m_thread_internal_id; + /** External (SHOW PROCESSLIST) thread identifier, not unique. */ + ulong m_thread_id; + /** Thread class. */ + PFS_thread_class *m_class; + /** Size of @c m_wait_locker_stack. */ + uint m_wait_locker_count; + /** + Stack of wait lockers. + This member holds the data for the table + PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. + For most locks, only 1 wait locker is used at a given time. + For composite locks, several records are needed: + - 1 for a 'logical' wait (for example on the GLOBAL READ LOCK state) + - 1 for a 'physical' wait (for example on COND_refresh) + */ + PFS_wait_locker m_wait_locker_stack[LOCKER_STACK_SIZE]; + /** True if the circular buffer @c m_waits_history is full. */ + bool m_waits_history_full; + /** Current index in the circular buffer @c m_waits_history. */ + uint m_waits_history_index; + /** + Waits history circular buffer. + This member holds the data for the table + PERFORMANCE_SCHEMA.EVENTS_WAITS_HISTORY. + */ + PFS_events_waits *m_waits_history; + /** + Per thread waits aggregated statistics. + This member holds the data for the table + PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. + */ + PFS_single_stat_chain *m_instr_class_wait_stats; +}; + +PFS_thread *sanitize_thread(PFS_thread *unsafe); + +PFS_single_stat_chain* +find_per_thread_mutex_class_wait_stat(PFS_thread *thread, + PFS_mutex_class *klass); + +PFS_single_stat_chain* +find_per_thread_rwlock_class_wait_stat(PFS_thread *thread, + PFS_rwlock_class *klass); + +PFS_single_stat_chain* +find_per_thread_cond_class_wait_stat(PFS_thread *thread, + PFS_cond_class *klass); + +PFS_single_stat_chain* +find_per_thread_file_class_wait_stat(PFS_thread *thread, + PFS_file_class *klass); + +int init_instruments(const PFS_global_param *param); +void cleanup_instruments(); +int init_file_hash(); +void cleanup_file_hash(); +PFS_mutex* create_mutex(PFS_mutex_class *mutex_class, const void *identity); +void destroy_mutex(PFS_mutex *pfs); +PFS_rwlock* create_rwlock(PFS_rwlock_class *klass, const void *identity); +void destroy_rwlock(PFS_rwlock *pfs); +PFS_cond* create_cond(PFS_cond_class *klass, const void *identity); +void destroy_cond(PFS_cond *pfs); + +PFS_thread* create_thread(PFS_thread_class *klass, const void *identity, + ulong thread_id); + +void destroy_thread(PFS_thread *pfs); + +PFS_file* find_or_create_file(PFS_thread *thread, PFS_file_class *klass, + const char *filename, uint len); + +void release_file(PFS_file *pfs); +void destroy_file(PFS_thread *thread, PFS_file *pfs); +PFS_table* create_table(PFS_table_share *share, const void *identity); +void destroy_table(PFS_table *pfs); + +/* For iterators and show status. */ + +extern ulong mutex_max; +extern ulong mutex_lost; +extern ulong rwlock_max; +extern ulong rwlock_lost; +extern ulong cond_max; +extern ulong cond_lost; +extern ulong thread_max; +extern ulong thread_lost; +extern ulong file_max; +extern ulong file_lost; +extern long file_handle_max; +extern ulong file_handle_lost; +extern ulong table_max; +extern ulong table_lost; +extern ulong events_waits_history_per_thread; +extern ulong instr_class_per_thread; +extern ulong locker_lost; + +/* Exposing the data directly, for iterators. */ + +extern PFS_mutex *mutex_array; +extern PFS_rwlock *rwlock_array; +extern PFS_cond *cond_array; +extern PFS_thread *thread_array; +extern PFS_file *file_array; +extern PFS_file **file_handle_array; +extern PFS_table *table_array; + +void reset_events_waits_by_instance(); +void reset_per_thread_wait_stat(); +void reset_file_instance_io(); + +/** @} */ +#endif + diff --git a/storage/perfschema/pfs_instr_class.cc b/storage/perfschema/pfs_instr_class.cc new file mode 100644 index 00000000000..ac8aa64b0c5 --- /dev/null +++ b/storage/perfschema/pfs_instr_class.cc @@ -0,0 +1,878 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_instr_class.cc + Performance schema instruments meta data (implementation). +*/ + +#include "my_global.h" +#include "my_sys.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" +#include "pfs_global.h" +#include "pfs_events_waits.h" +#include "pfs_atomic.h" +#include "mysql/psi/mysql_thread.h" +#include "lf.h" + +#include + +/** + @defgroup Performance_schema_buffers Performance Schema Buffers + @ingroup Performance_schema_implementation + @{ +*/ + +/** + Global performance schema flag. + Indicate if the performance schema is enabled. + This flag is set at startup, and never changes. +*/ +my_bool pfs_enabled= TRUE; + +/** + Current number of elements in mutex_class_array. + This global variable is written to during: + - the performance schema initialization + - a plugin initialization +*/ +static volatile uint32 mutex_class_dirty_count= 0; +static volatile uint32 mutex_class_allocated_count= 0; +static volatile uint32 rwlock_class_dirty_count= 0; +static volatile uint32 rwlock_class_allocated_count= 0; +static volatile uint32 cond_class_dirty_count= 0; +static volatile uint32 cond_class_allocated_count= 0; + +/** Size of the mutex class array. @sa mutex_class_array */ +ulong mutex_class_max= 0; +/** Number of mutex class lost. @sa mutex_class_array */ +ulong mutex_class_lost= 0; +/** Size of the rwlock class array. @sa rwlock_class_array */ +ulong rwlock_class_max= 0; +/** Number of rwlock class lost. @sa rwlock_class_array */ +ulong rwlock_class_lost= 0; +/** Size of the condition class array. @sa cond_class_array */ +ulong cond_class_max= 0; +/** Number of condition class lost. @sa cond_class_array */ +ulong cond_class_lost= 0; +/** Size of the thread class array. @sa thread_class_array */ +ulong thread_class_max= 0; +/** Number of thread class lost. @sa thread_class_array */ +ulong thread_class_lost= 0; +/** Size of the file class array. @sa file_class_array */ +ulong file_class_max= 0; +/** Number of file class lost. @sa file_class_array */ +ulong file_class_lost= 0; +/** Size of the table share array. @sa table_share_array */ +ulong table_share_max= 0; +/** Number of table share lost. @sa table_share_array */ +ulong table_share_lost= 0; + +static PFS_mutex_class *mutex_class_array= NULL; +static PFS_rwlock_class *rwlock_class_array= NULL; +static PFS_cond_class *cond_class_array= NULL; + +/** + Current number or elements in thread_class_array. + This global variable is written to during: + - the performance schema initialization + - a plugin initialization +*/ +static volatile uint32 thread_class_dirty_count= 0; +static volatile uint32 thread_class_allocated_count= 0; + +static PFS_thread_class *thread_class_array= NULL; + +/** + Table instance array. + @sa table_share_max + @sa table_share_lost + @sa table_share_hash +*/ +PFS_table_share *table_share_array= NULL; + +PFS_instr_class global_table_class= +{ + "wait/table", /* name */ + 10, /* name length */ + 0, /* flags */ + true, /* enabled */ + true, /* timed */ + { &flag_events_waits_current, NULL, 0, 0, 0, 0} /* wait stat chain */ +}; + +/** Hash table for instrumented tables. */ +static LF_HASH table_share_hash; +/** True if table_share_hash is initialized. */ +static bool table_share_hash_inited= false; + +static volatile uint32 file_class_dirty_count= 0; +static volatile uint32 file_class_allocated_count= 0; + +static PFS_file_class *file_class_array= NULL; + +/** + Initialize the instrument synch class buffers. + @param mutex_class_sizing max number of mutex class + @param rwlock_class_sizing max number of rwlock class + @param cond_class_sizing max number of condition class + @return 0 on success +*/ +int init_sync_class(uint mutex_class_sizing, + uint rwlock_class_sizing, + uint cond_class_sizing) +{ + mutex_class_dirty_count= mutex_class_allocated_count= 0; + rwlock_class_dirty_count= rwlock_class_allocated_count= 0; + cond_class_dirty_count= cond_class_allocated_count= 0; + mutex_class_max= mutex_class_sizing; + rwlock_class_max= rwlock_class_sizing; + cond_class_max= cond_class_sizing; + mutex_class_lost= rwlock_class_lost= cond_class_lost= 0; + + mutex_class_array= NULL; + rwlock_class_array= NULL; + cond_class_array= NULL; + + if (mutex_class_max > 0) + { + mutex_class_array= PFS_MALLOC_ARRAY(mutex_class_max, PFS_mutex_class, + MYF(MY_ZEROFILL)); + if (unlikely(mutex_class_array == NULL)) + return 1; + } + + if (rwlock_class_max > 0) + { + rwlock_class_array= PFS_MALLOC_ARRAY(rwlock_class_max, PFS_rwlock_class, + MYF(MY_ZEROFILL)); + if (unlikely(rwlock_class_array == NULL)) + return 1; + } + + if (cond_class_max > 0) + { + cond_class_array= PFS_MALLOC_ARRAY(cond_class_max, PFS_cond_class, + MYF(MY_ZEROFILL)); + if (unlikely(cond_class_array == NULL)) + return 1; + } + + return 0; +} + +/** Cleanup the instrument synch class buffers. */ +void cleanup_sync_class(void) +{ + pfs_free(mutex_class_array); + mutex_class_array= NULL; + mutex_class_dirty_count= mutex_class_allocated_count= mutex_class_max= 0; + pfs_free(rwlock_class_array); + rwlock_class_array= NULL; + rwlock_class_dirty_count= rwlock_class_allocated_count= rwlock_class_max= 0; + pfs_free(cond_class_array); + cond_class_array= NULL; + cond_class_dirty_count= cond_class_allocated_count= cond_class_max= 0; +} + +/** + Initialize the thread class buffer. + @param thread_class_sizing max number of thread class + @return 0 on success +*/ +int init_thread_class(uint thread_class_sizing) +{ + int result= 0; + thread_class_dirty_count= thread_class_allocated_count= 0; + thread_class_max= thread_class_sizing; + thread_class_lost= 0; + + if (thread_class_max > 0) + { + thread_class_array= PFS_MALLOC_ARRAY(thread_class_max, PFS_thread_class, + MYF(MY_ZEROFILL)); + if (unlikely(thread_class_array == NULL)) + result= 1; + } + else + thread_class_array= NULL; + + return result; +} + +/** Cleanup the thread class buffers. */ +void cleanup_thread_class(void) +{ + pfs_free(thread_class_array); + thread_class_array= NULL; + thread_class_dirty_count= thread_class_allocated_count= 0; + thread_class_max= 0; +} + +/** + Initialize the table share buffer. + @param table_share_sizing max number of table share + @return 0 on success +*/ +int init_table_share(uint table_share_sizing) +{ + int result= 0; + table_share_max= table_share_sizing; + table_share_lost= 0; + + if (table_share_max > 0) + { + table_share_array= PFS_MALLOC_ARRAY(table_share_max, PFS_table_share, + MYF(MY_ZEROFILL)); + if (unlikely(table_share_array == NULL)) + result= 1; + } + else + table_share_array= NULL; + + return result; +} + +/** Cleanup the table share buffers. */ +void cleanup_table_share(void) +{ + pfs_free(table_share_array); + table_share_array= NULL; + table_share_max= 0; +} + +static uchar *table_share_hash_get_key(const uchar *entry, size_t *length, + my_bool) +{ + const PFS_table_share * const *typed_entry; + const PFS_table_share *share; + const void *result; + typed_entry= reinterpret_cast (entry); + DBUG_ASSERT(typed_entry != NULL); + share= *typed_entry; + DBUG_ASSERT(share != NULL); + *length= share->m_key.m_key_length; + result= &share->m_key.m_hash_key[0]; + return const_cast (reinterpret_cast (result)); +} + +/** Initialize the table share hash table. */ +int init_table_share_hash(void) +{ + if ((! table_share_hash_inited) && (table_share_max > 0)) + { + lf_hash_init(&table_share_hash, sizeof(PFS_table_share*), LF_HASH_UNIQUE, + 0, 0, table_share_hash_get_key, &my_charset_bin); + table_share_hash_inited= true; + } + return 0; +} + +/** Cleanup the table share hash table. */ +void cleanup_table_share_hash(void) +{ + if (table_share_hash_inited) + { + lf_hash_destroy(&table_share_hash); + table_share_hash_inited= false; + } +} + +/** + Initialize the file class buffer. + @param file_class_sizing max number of file class + @return 0 on success +*/ +int init_file_class(uint file_class_sizing) +{ + int result= 0; + file_class_dirty_count= file_class_allocated_count= 0; + file_class_max= file_class_sizing; + file_class_lost= 0; + + if (file_class_max > 0) + { + file_class_array= PFS_MALLOC_ARRAY(file_class_max, PFS_file_class, + MYF(MY_ZEROFILL)); + if (unlikely(file_class_array == NULL)) + return 1; + } + else + file_class_array= NULL; + + return result; +} + +/** Cleanup the file class buffers. */ +void cleanup_file_class(void) +{ + pfs_free(file_class_array); + file_class_array= NULL; + file_class_dirty_count= file_class_allocated_count= 0; + file_class_max= 0; +} + +static void init_instr_class(PFS_instr_class *klass, + const char *name, + uint name_length, + int flags) +{ + DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH); + memset(klass, 0, sizeof(PFS_instr_class)); + strncpy(klass->m_name, name, name_length); + klass->m_name_length= name_length; + klass->m_flags= flags; + klass->m_enabled= true; + klass->m_timed= true; +} + +#define REGISTER_CLASS_BODY_PART(INDEX, ARRAY, MAX, NAME, NAME_LENGTH) \ + for (INDEX= 0; INDEX < MAX; INDEX++) \ + { \ + entry= &ARRAY[INDEX]; \ + if ((entry->m_name_length == NAME_LENGTH) && \ + (strncmp(entry->m_name, NAME, NAME_LENGTH) == 0)) \ + { \ + DBUG_ASSERT(entry->m_flags == flags); \ + return (INDEX + 1); \ + } \ + } + +/** + Register a mutex instrumentation metadata. + @param name the instrumented name + @param name_length length in bytes of name + @param flags the instrumentation flags + @return a mutex instrumentation key +*/ +PFS_sync_key register_mutex_class(const char *name, uint name_length, + int flags) +{ + uint32 index; + PFS_mutex_class *entry; + + /* + This is a full array scan, which is not optimal. + This is acceptable since this code is only used at startup, + or when a plugin is loaded. + */ + REGISTER_CLASS_BODY_PART(index, mutex_class_array, mutex_class_max, + name, name_length) + /* + Note that: + mutex_class_dirty_count is incremented *before* an entry is added + mutex_class_allocated_count is incremented *after* an entry is added + */ + index= PFS_atomic::add_u32(&mutex_class_dirty_count, 1); + + if (index < mutex_class_max) + { + /* + The instrument was not found (from a possible previous + load / unload of a plugin), allocate it. + This code is safe when 2 threads execute in parallel + for different mutex classes: + - thread 1 registering class A + - thread 2 registering class B + will not collide in the same mutex_class_array[index] entry. + This code does not protect against 2 threads registering + in parallel the same class: + - thread 1 registering class A + - thread 2 registering class A + could lead to a duplicate class A entry. + This is ok, since this case can not happen in the caller: + - classes names are derived from a plugin name + ('wait/synch/mutex//xxx') + - 2 threads can not register concurrently the same plugin + in INSTALL PLUGIN. + */ + entry= &mutex_class_array[index]; + init_instr_class(entry, name, name_length, flags); + entry->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_event_name; + entry->m_wait_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_wait_stat); + entry->m_lock_stat.m_control_flag= + &flag_events_locks_summary_by_event_name; + entry->m_lock_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_lock_stat); + entry->m_index= index; + /* + Now that this entry is populated, advertise it + + Technically, there is a small race condition here: + T0: + mutex_class_dirty_count= 10 + mutex_class_allocated_count= 10 + T1: Thread A increment mutex_class_dirty_count to 11 + T2: Thread B increment mutex_class_dirty_count to 12 + T3: Thread A populate entry 11 + T4: Thread B populate entry 12 + T5: Thread B increment mutex_class_allocated_count to 11, + advertise thread A incomplete record 11, + but does not advertise thread B complete record 12 + T6: Thread A increment mutex_class_allocated_count to 12 + This has no impact, and is acceptable. + A reader will not see record 12 for a short time. + A reader will see an incomplete record 11 for a short time, + which is ok: the mutex name / statistics will be temporarily + empty/NULL/zero, but this won't cause a crash + (mutex_class_array is initialized with MY_ZEROFILL). + */ + PFS_atomic::add_u32(&mutex_class_allocated_count, 1); + return (index + 1); + } + + /* + Out of space, report to SHOW STATUS that + the allocated memory was too small. + */ + mutex_class_lost++; + return 0; +} + +/** + Register a rwlock instrumentation metadata. + @param name the instrumented name + @param name_length length in bytes of name + @param flags the instrumentation flags + @return a rwlock instrumentation key +*/ +PFS_sync_key register_rwlock_class(const char *name, uint name_length, + int flags) +{ + /* See comments in register_mutex_class */ + uint32 index; + PFS_rwlock_class *entry; + + REGISTER_CLASS_BODY_PART(index, rwlock_class_array, rwlock_class_max, + name, name_length) + + index= PFS_atomic::add_u32(&rwlock_class_dirty_count, 1); + + if (index < rwlock_class_max) + { + entry= &rwlock_class_array[index]; + init_instr_class(entry, name, name_length, flags); + entry->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_event_name; + entry->m_wait_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_wait_stat); + entry->m_read_lock_stat.m_control_flag= + &flag_events_locks_summary_by_event_name; + entry->m_read_lock_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_read_lock_stat); + entry->m_write_lock_stat.m_control_flag= + &flag_events_locks_summary_by_event_name; + entry->m_write_lock_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_write_lock_stat); + entry->m_index= index; + PFS_atomic::add_u32(&rwlock_class_allocated_count, 1); + return (index + 1); + } + + rwlock_class_lost++; + return 0; +} + +/** + Register a condition instrumentation metadata. + @param name the instrumented name + @param name_length length in bytes of name + @param flags the instrumentation flags + @return a condition instrumentation key +*/ +PFS_sync_key register_cond_class(const char *name, uint name_length, + int flags) +{ + /* See comments in register_mutex_class */ + uint32 index; + PFS_cond_class *entry; + + REGISTER_CLASS_BODY_PART(index, cond_class_array, cond_class_max, + name, name_length) + + index= PFS_atomic::add_u32(&cond_class_dirty_count, 1); + + if (index < cond_class_max) + { + entry= &cond_class_array[index]; + init_instr_class(entry, name, name_length, flags); + entry->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_event_name; + entry->m_wait_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_wait_stat); + entry->m_index= index; + PFS_atomic::add_u32(&cond_class_allocated_count, 1); + return (index + 1); + } + + cond_class_lost++; + return 0; +} + +#define FIND_CLASS_BODY(KEY, COUNT, ARRAY) \ + if ((KEY == 0) || (KEY > COUNT)) \ + return NULL; \ + return &ARRAY[KEY - 1] + +/** + Find a mutex instrumentation class by key. + @param key the instrument key + @return the instrument class, or NULL +*/ +PFS_mutex_class *find_mutex_class(PFS_sync_key key) +{ + FIND_CLASS_BODY(key, mutex_class_allocated_count, mutex_class_array); +} + +#define SANITIZE_ARRAY_BODY(ARRAY, MAX, UNSAFE) \ + if ((&ARRAY[0] <= UNSAFE) && \ + (UNSAFE < &ARRAY[MAX])) \ + return UNSAFE; \ + return NULL + +PFS_mutex_class *sanitize_mutex_class(PFS_mutex_class *unsafe) +{ + SANITIZE_ARRAY_BODY(mutex_class_array, mutex_class_max, unsafe); +} + +/** + Find a rwlock instrumentation class by key. + @param key the instrument key + @return the instrument class, or NULL +*/ +PFS_rwlock_class *find_rwlock_class(PFS_sync_key key) +{ + FIND_CLASS_BODY(key, rwlock_class_allocated_count, rwlock_class_array); +} + +PFS_rwlock_class *sanitize_rwlock_class(PFS_rwlock_class *unsafe) +{ + SANITIZE_ARRAY_BODY(rwlock_class_array, rwlock_class_max, unsafe); +} + +/** + Find a condition instrumentation class by key. + @param key the instrument key + @return the instrument class, or NULL +*/ +PFS_cond_class *find_cond_class(PFS_sync_key key) +{ + FIND_CLASS_BODY(key, cond_class_allocated_count, cond_class_array); +} + +PFS_cond_class *sanitize_cond_class(PFS_cond_class *unsafe) +{ + SANITIZE_ARRAY_BODY(cond_class_array, cond_class_max, unsafe); +} + +/** + Register a thread instrumentation metadata. + @param name the instrumented name + @param name_length length in bytes of name + @param flags the instrumentation flags + @return a thread instrumentation key +*/ +PFS_thread_key register_thread_class(const char *name, uint name_length, + int flags) +{ + /* See comments in register_mutex_class */ + uint32 index; + PFS_thread_class *entry; + + for (index= 0; index < thread_class_max; index++) + { + entry= &thread_class_array[index]; + + if ((entry->m_name_length == name_length) && + (strncmp(entry->m_name, name, name_length) == 0)) + return (index + 1); + } + + index= PFS_atomic::add_u32(&thread_class_dirty_count, 1); + + if (index < thread_class_max) + { + entry= &thread_class_array[index]; + DBUG_ASSERT(name_length <= PFS_MAX_INFO_NAME_LENGTH); + strncpy(entry->m_name, name, name_length); + entry->m_name_length= name_length; + entry->m_enabled= true; + PFS_atomic::add_u32(&thread_class_allocated_count, 1); + return (index + 1); + } + + thread_class_lost++; + return 0; +} + +/** + Find a thread instrumentation class by key. + @param key the instrument key + @return the instrument class, or NULL +*/ +PFS_thread_class *find_thread_class(PFS_sync_key key) +{ + FIND_CLASS_BODY(key, thread_class_allocated_count, thread_class_array); +} + +PFS_thread_class *sanitize_thread_class(PFS_thread_class *unsafe) +{ + SANITIZE_ARRAY_BODY(thread_class_array, thread_class_max, unsafe); +} + +/** + Register a file instrumentation metadata. + @param name the instrumented name + @param name_length length in bytes of name + @param flags the instrumentation flags + @return a file instrumentation key +*/ +PFS_file_key register_file_class(const char *name, uint name_length, + int flags) +{ + /* See comments in register_mutex_class */ + uint32 index; + PFS_file_class *entry; + + REGISTER_CLASS_BODY_PART(index, file_class_array, file_class_max, + name, name_length) + + index= PFS_atomic::add_u32(&file_class_dirty_count, 1); + + if (index < file_class_max) + { + entry= &file_class_array[index]; + init_instr_class(entry, name, name_length, flags); + entry->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_event_name; + entry->m_wait_stat.m_parent= NULL; + reset_single_stat_link(&entry->m_wait_stat); + entry->m_index= index; + PFS_atomic::add_u32(&file_class_allocated_count, 1); + return (index + 1); + } + + file_class_lost++; + return 0; +} + +/** + Find a file instrumentation class by key. + @param key the instrument key + @return the instrument class, or NULL +*/ +PFS_file_class *find_file_class(PFS_file_key key) +{ + FIND_CLASS_BODY(key, file_class_allocated_count, file_class_array); +} + +PFS_file_class *sanitize_file_class(PFS_file_class *unsafe) +{ + SANITIZE_ARRAY_BODY(file_class_array, file_class_max, unsafe); +} + +/** + Find or create a table instance by name. + @param thread the executing instrumented thread + @param schema_name the table schema name + @param schema_name_length the table schema name length + @param table_name the table name + @param table_name_length the table name length + @return a table instance, or NULL +*/ +PFS_table_share* find_or_create_table_share(PFS_thread *thread, + const char *schema_name, + uint schema_name_length, + const char *table_name, + uint table_name_length) +{ + /* See comments in register_mutex_class */ + int pass; + PFS_table_share_key key; + + if (! table_share_hash_inited) + { + /* Table instrumentation can be turned off. */ + table_share_lost++; + return NULL; + } + + if (unlikely(thread->m_table_share_hash_pins == NULL)) + { + thread->m_table_share_hash_pins= lf_hash_get_pins(&table_share_hash); + if (unlikely(thread->m_table_share_hash_pins == NULL)) + { + table_share_lost++; + return NULL; + } + } + + DBUG_ASSERT(schema_name_length <= NAME_LEN); + DBUG_ASSERT(table_name_length <= NAME_LEN); + + char *ptr= &key.m_hash_key[0]; + memcpy(ptr, schema_name, schema_name_length); + ptr+= schema_name_length; + ptr[0]= 0; ptr++; + memcpy(ptr, table_name, table_name_length); + ptr+= table_name_length; + ptr[0]= 0; ptr++; + key.m_key_length= ptr - &key.m_hash_key[0]; + + PFS_table_share **entry; + uint retry_count= 0; + const uint retry_max= 3; +search: + entry= reinterpret_cast + (lf_hash_search(&table_share_hash, thread->m_table_share_hash_pins, + &key.m_hash_key[0], key.m_key_length)); + if (entry && (entry != MY_ERRPTR)) + { + PFS_table_share *pfs; + pfs= *entry; + lf_hash_search_unpin(thread->m_table_share_hash_pins); + return pfs; + } + + /* table_name is not constant, just using it for noise on create */ + uint i= randomized_index(table_name, table_share_max); + + /* + Pass 1: [random, table_share_max - 1] + Pass 2: [0, table_share_max - 1] + */ + for (pass= 1; pass <= 2; i=0, pass++) + { + PFS_table_share *pfs= table_share_array + i; + PFS_table_share *pfs_last= table_share_array + table_share_max; + for ( ; pfs < pfs_last; pfs++) + { + if (pfs->m_lock.is_free()) + { + if (pfs->m_lock.free_to_dirty()) + { + pfs->m_key= key; + pfs->m_schema_name= &pfs->m_key.m_hash_key[0]; + pfs->m_schema_name_length= schema_name_length; + pfs->m_table_name= &pfs->m_key.m_hash_key[schema_name_length + 1]; + pfs->m_table_name_length= table_name_length; + pfs->m_wait_stat.m_control_flag= + &flag_events_waits_summary_by_instance; + pfs->m_wait_stat.m_parent= NULL; + reset_single_stat_link(&pfs->m_wait_stat); + pfs->m_enabled= true; + pfs->m_timed= true; + pfs->m_aggregated= false; + + int res; + res= lf_hash_insert(&table_share_hash, + thread->m_table_share_hash_pins, &pfs); + if (likely(res == 0)) + { + pfs->m_lock.dirty_to_allocated(); + return pfs; + } + + pfs->m_lock.dirty_to_free(); + + if (res > 0) + { + /* Duplicate insert by another thread */ + if (++retry_count > retry_max) + { + /* Avoid infinite loops */ + table_share_lost++; + return NULL; + } + goto search; + } + + /* OOM in lf_hash_insert */ + table_share_lost++; + return NULL; + } + } + } + } + + table_share_lost++; + return NULL; +} + +PFS_table_share *sanitize_table_share(PFS_table_share *unsafe) +{ + SANITIZE_ARRAY_BODY(table_share_array, table_share_max, unsafe); +} + +static void reset_mutex_class_waits(void) +{ + PFS_mutex_class *pfs= mutex_class_array; + PFS_mutex_class *pfs_last= mutex_class_array + mutex_class_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +static void reset_rwlock_class_waits(void) +{ + PFS_rwlock_class *pfs= rwlock_class_array; + PFS_rwlock_class *pfs_last= rwlock_class_array + rwlock_class_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +static void reset_cond_class_waits(void) +{ + PFS_cond_class *pfs= cond_class_array; + PFS_cond_class *pfs_last= cond_class_array + cond_class_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +static void reset_file_class_waits(void) +{ + PFS_file_class *pfs= file_class_array; + PFS_file_class *pfs_last= file_class_array + file_class_max; + + for ( ; pfs < pfs_last; pfs++) + reset_single_stat_link(&pfs->m_wait_stat); +} + +/** Reset the wait statistics for every instrument class. */ +void reset_instrument_class_waits(void) +{ + reset_mutex_class_waits(); + reset_rwlock_class_waits(); + reset_cond_class_waits(); + reset_file_class_waits(); +} + +/** Reset the io statistics per file class. */ +void reset_file_class_io(void) +{ + PFS_file_class *pfs= file_class_array; + PFS_file_class *pfs_last= file_class_array + file_class_max; + + for ( ; pfs < pfs_last; pfs++) + reset_file_stat(&pfs->m_file_stat); +} + +/** @} */ + diff --git a/storage/perfschema/pfs_instr_class.h b/storage/perfschema/pfs_instr_class.h new file mode 100644 index 00000000000..0a58095d612 --- /dev/null +++ b/storage/perfschema/pfs_instr_class.h @@ -0,0 +1,251 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_INSTR_CLASS_H +#define PFS_INSTR_CLASS_H + +/** + @file storage/perfschema/pfs_instr_class.h + Performance schema instruments meta data (declarations). +*/ + +/** + Maximum length of an instrument name. + For example, 'wait/sync/mutex/sql/LOCK_open' is an instrument name. +*/ +#define PFS_MAX_INFO_NAME_LENGTH 128 + +/** + Maximum length of the 'full' prefix of an instrument name. + For example, for the instrument name 'wait/sync/mutex/sql/LOCK_open', + the full prefix is 'wait/sync/mutex/sql/', which in turn derives from + a prefix 'wait/sync/mutex' for mutexes, and a category of 'sql' for mutexes + of the sql layer in the server. +*/ +#define PFS_MAX_FULL_PREFIX_NAME_LENGTH 32 + +#include +#include +#include "pfs_lock.h" +#include "pfs_stat.h" + +/** + @addtogroup Performance_schema_buffers + @{ +*/ + +extern my_bool pfs_enabled; + +/** Key, naming a synch instrument (mutex, rwlock, cond). */ +typedef unsigned int PFS_sync_key; +/** Key, naming a thread instrument. */ +typedef unsigned int PFS_thread_key; +/** Key, naming a file instrument. */ +typedef unsigned int PFS_file_key; + +struct PFS_thread; + +/** Information for all instrumentation. */ +struct PFS_instr_class +{ + /** Instrument name. */ + char m_name[PFS_MAX_INFO_NAME_LENGTH]; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Instrument flags. */ + int m_flags; + /** True if this instrument is enabled. */ + bool m_enabled; + /** True if this instrument is timed. */ + bool m_timed; + /** Wait statistics chain. */ + PFS_single_stat_chain m_wait_stat; +}; + +/** Instrumentation metadata for a MUTEX. */ +struct PFS_mutex_class : public PFS_instr_class +{ + /** + Lock statistics chain. + This statistic is not exposed in user visible tables yet. + */ + PFS_single_stat_chain m_lock_stat; + /** Self index in @c mutex_class_array. */ + uint m_index; +}; + +/** Instrumentation metadata for a RWLOCK. */ +struct PFS_rwlock_class : public PFS_instr_class +{ + /** + Read lock statistics chain. + This statistic is not exposed in user visible tables yet. + */ + PFS_single_stat_chain m_read_lock_stat; + /** + Write lock statistics chain. + This statistic is not exposed in user visible tables yet. + */ + PFS_single_stat_chain m_write_lock_stat; + /** Self index in @c rwlock_class_array. */ + uint m_index; +}; + +/** Instrumentation metadata for a COND. */ +struct PFS_cond_class : public PFS_instr_class +{ + /** + Condition usage statistics. + This statistic is not exposed in user visible tables yet. + */ + PFS_cond_stat m_cond_stat; + /** Self index in @c cond_class_array. */ + uint m_index; +}; + +/** Instrumentation metadata of a thread. */ +struct PFS_thread_class +{ + /** Thread instrument name. */ + char m_name[PFS_MAX_INFO_NAME_LENGTH]; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** True if this thread instrument is enabled. */ + bool m_enabled; +}; + +/** Key identifying a table share. */ +struct PFS_table_share_key +{ + /** + Hash search key. + This has to be a string for LF_HASH, + the format is "<0x00><0x00>" + @see create_table_def_key + */ + char m_hash_key[NAME_LEN + 1 + NAME_LEN + 1]; + /** Length in bytes of @c m_hash_key. */ + uint m_key_length; +}; + +/** Instrumentation metadata for a table share. */ +struct PFS_table_share +{ + /** Internal lock. */ + pfs_lock m_lock; + /** Search key. */ + PFS_table_share_key m_key; + /** Schema name. */ + const char *m_schema_name; + /** Length in bytes of @c m_schema_name. */ + uint m_schema_name_length; + /** Table name. */ + const char *m_table_name; + /** Length in bytes of @c m_table_name. */ + uint m_table_name_length; + /** Wait statistics chain. */ + PFS_single_stat_chain m_wait_stat; + /** True if this table instrument is enabled. */ + bool m_enabled; + /** True if this table instrument is timed. */ + bool m_timed; + /** True if this table instrument is aggregated. */ + bool m_aggregated; +}; + +/** + Instrument controlling all tables. + This instrument is used as a default when there is no + entry present in SETUP_OBJECTS. +*/ +extern PFS_instr_class global_table_class; + +/** Instrumentation metadata for a file. */ +struct PFS_file_class : public PFS_instr_class +{ + /** File usage statistics. */ + PFS_file_stat m_file_stat; + /** Self index in @c file_class_array. */ + uint m_index; +}; + +int init_sync_class(uint mutex_class_sizing, + uint rwlock_class_sizing, + uint cond_class_sizing); + +void cleanup_sync_class(); +int init_thread_class(uint thread_class_sizing); +void cleanup_thread_class(); +int init_table_share(uint table_share_sizing); +void cleanup_table_share(); +int init_table_share_hash(); +void cleanup_table_share_hash(); +int init_file_class(uint file_class_sizing); +void cleanup_file_class(); + +PFS_sync_key register_mutex_class(const char *name, uint name_length, + int flags); + +PFS_sync_key register_rwlock_class(const char *name, uint name_length, + int flags); + +PFS_sync_key register_cond_class(const char *name, uint name_length, + int flags); + +PFS_thread_key register_thread_class(const char *name, uint name_length, + int flags); + +PFS_file_key register_file_class(const char *name, uint name_length, + int flags); + +PFS_mutex_class *find_mutex_class(PSI_mutex_key key); +PFS_mutex_class *sanitize_mutex_class(PFS_mutex_class *unsafe); +PFS_rwlock_class *find_rwlock_class(PSI_rwlock_key key); +PFS_rwlock_class *sanitize_rwlock_class(PFS_rwlock_class *unsafe); +PFS_cond_class *find_cond_class(PSI_cond_key key); +PFS_cond_class *sanitize_cond_class(PFS_cond_class *unsafe); +PFS_thread_class *find_thread_class(PSI_thread_key key); +PFS_thread_class *sanitize_thread_class(PFS_thread_class *unsafe); +PFS_file_class *find_file_class(PSI_file_key key); +PFS_file_class *sanitize_file_class(PFS_file_class *unsafe); + +PFS_table_share *find_or_create_table_share(PFS_thread *thread, + const char *schema_name, + uint schema_name_length, + const char *table_name, + uint table_name_length); + +PFS_table_share *sanitize_table_share(PFS_table_share *unsafe); + +extern ulong mutex_class_max; +extern ulong mutex_class_lost; +extern ulong rwlock_class_max; +extern ulong rwlock_class_lost; +extern ulong cond_class_max; +extern ulong cond_class_lost; +extern ulong thread_class_max; +extern ulong thread_class_lost; +extern ulong file_class_max; +extern ulong file_class_lost; +extern ulong table_share_max; +extern ulong table_share_lost; +extern PFS_table_share *table_share_array; + +void reset_instrument_class_waits(); +void reset_file_class_io(); + +/** @} */ +#endif + diff --git a/storage/perfschema/pfs_lock.h b/storage/perfschema/pfs_lock.h new file mode 100644 index 00000000000..46d7d33617b --- /dev/null +++ b/storage/perfschema/pfs_lock.h @@ -0,0 +1,173 @@ +/* Copyright (C) 2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_LOCK_H +#define PFS_LOCK_H + +/** + @file storage/perfschema/pfs_lock.h + Performance schema internal locks (declarations). +*/ + +#include "pfs_atomic.h" + +/** + @addtogroup Performance_schema_buffers + @{ +*/ + +/** + State of a free record. + Values of a free record should not be read by a reader. + Writers can concurrently attempt to allocate a free record. +*/ +#define PFS_LOCK_FREE 0 +/** + State of a dirty record. + Values of a dirty record should not be read by a reader, + as the record is currently being modified. + Only one writer, the writer which owns the record, should + modify the record content. +*/ +#define PFS_LOCK_DIRTY 1 +/** + State of an allocated record. + Values of an allocated record are safe to read by a reader. + A writer may modify some but not all properties of the record: + only modifying values that can never cause the reader to crash is allowed. +*/ +#define PFS_LOCK_ALLOCATED 2 + +/** + A 'lock' protecting performance schema internal buffers. + This lock is used to mark the state of a record. + Access to the record is not enforced here, + it's up to the readers and writers to look at the record state + before making an actual read or write operation. +*/ +struct pfs_lock +{ + /** + The record internal state. + @sa PFS_LOCK_FREE + @sa PFS_LOCK_DIRTY + @sa PFS_LOCK_ALLOCATED + */ + volatile int32 m_state; + /** + The record internal version number. + This version number is to transform the 'ABA' problem + (see http://en.wikipedia.org/wiki/ABA_problem) + into an 'A(n)BA(n + 1)' problem, where 'n' is the m_version number. + When the performance schema instrumentation deletes a record, + then create a different record reusing the same memory allocation, + the version number is incremented, so that a reader can detect that + the record was changed. Note that the version number is never + reset to zero when a new record is created. + */ + volatile uint32 m_version; + + /** Returns true if the record is free. */ + bool is_free(void) + { + /* This is a dirty read */ + return (m_state == PFS_LOCK_FREE); + } + + /** Returns true if the record contains values that can be read. */ + bool is_populated(void) + { + int32 copy= m_state; /* non volatile copy, and dirty read */ + return (copy == PFS_LOCK_ALLOCATED); + } + + /** + Execute a free to dirty transition. + This transition is safe to execute concurrently by multiple writers. + Only one writer will succeed to acquire the record. + @return true if the operation succeed + */ + bool free_to_dirty(void) + { + int32 old_state= PFS_LOCK_FREE; + int32 new_state= PFS_LOCK_DIRTY; + + return (PFS_atomic::cas_32(&m_state, &old_state, new_state)); + } + + /** + Execute a dirty to allocated transition. + This transition should be executed by the writer that owns the record, + after the record is in a state ready to be read. + */ + void dirty_to_allocated(void) + { + DBUG_ASSERT(m_state == PFS_LOCK_DIRTY); + PFS_atomic::add_u32(&m_version, 1); + PFS_atomic::store_32(&m_state, PFS_LOCK_ALLOCATED); + } + + /** + Execute a dirty to free transition. + This transition should be executed by the writer that owns the record. + */ + void dirty_to_free(void) + { + DBUG_ASSERT(m_state == PFS_LOCK_DIRTY); + PFS_atomic::store_32(&m_state, PFS_LOCK_FREE); + } + + /** + Execute an allocated to free transition. + This transition should be executed by the writer that owns the record. + */ + void allocated_to_free(void) + { + DBUG_ASSERT(m_state == PFS_LOCK_ALLOCATED); + PFS_atomic::store_32(&m_state, PFS_LOCK_FREE); + } + + /** + Start an optimistic read operation. + @sa end_optimist_lock. + */ + void begin_optimistic_lock(struct pfs_lock *copy) + { + copy->m_version= PFS_atomic::load_u32(&m_version); + copy->m_state= PFS_atomic::load_32(&m_state); + } + + /** + End an optimistic read operation. + @sa begin_optimist_lock. + @return true if the data read is safe to use. + */ + bool end_optimistic_lock(struct pfs_lock *copy) + { + /* + return true if: + - the version + state has not changed + - and there was valid data to look at + */ + return ((copy->m_version == PFS_atomic::load_u32(&m_version)) && + (copy->m_state == PFS_atomic::load_32(&m_state)) && + (copy->m_state == PFS_LOCK_ALLOCATED)); + } +}; + + +/** @} */ +#endif + diff --git a/storage/perfschema/pfs_server.cc b/storage/perfschema/pfs_server.cc new file mode 100644 index 00000000000..66b8a7fb22b --- /dev/null +++ b/storage/perfschema/pfs_server.cc @@ -0,0 +1,131 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_server.cc + Private interface for the server (implementation). +*/ + +#include "my_global.h" +#include "my_sys.h" +#include "mysys_err.h" +#include "mysql_priv.h" +#include "pfs_server.h" +#include "pfs.h" +#include "pfs_global.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" +#include "pfs_events_waits.h" +#include "pfs_timer.h" + +PFS_global_param pfs_param; + +static void destroy_pfs_thread(void *key); +void cleanup_performance_schema(void); + +struct PSI_bootstrap* +initialize_performance_schema(const PFS_global_param *param) +{ + pfs_initialized= false; + + if (! param->m_enabled) + { + /* + The performance schema is disabled in the startup command line. + All the instrumentation is turned off. + */ + return NULL; + } + + init_timers(); + PFS_atomic::init(); + + if (pthread_key_create(&THR_PFS, destroy_pfs_thread)) + return NULL; + + THR_PFS_initialized= true; + + if (init_sync_class(param->m_mutex_class_sizing, + param->m_rwlock_class_sizing, + param->m_cond_class_sizing) || + init_thread_class(param->m_thread_class_sizing) || + init_table_share(param->m_table_share_sizing) || + init_file_class(param->m_file_class_sizing) || + init_instruments(param) || + init_events_waits_history_long( + param->m_events_waits_history_long_sizing) || + init_file_hash() || + init_table_share_hash()) + { + /* + The performance schema initialization failed. + Free the memory used, and disable the instrumentation. + */ + cleanup_performance_schema(); + return NULL; + } + + pfs_initialized= true; + return &PFS_bootstrap; +} + +static void destroy_pfs_thread(void *key) +{ + PFS_thread* pfs= reinterpret_cast (key); + DBUG_ASSERT(pfs); + /* + This automatic cleanup is a last resort and best effort to avoid leaks, + and may not work on windows due to the implementation of pthread_key_create(). + Please either use: + - my_thread_end() + - or PSI_server->delete_current_thread() + in the instrumented code, to explicitly cleanup the instrumentation. + + Avoid invalid writes when the main() thread completes after shutdown: + the memory pointed by pfs is already released. + */ + if (pfs_initialized) + destroy_thread(pfs); +} + +void cleanup_performance_schema(void) +{ + cleanup_instruments(); + cleanup_sync_class(); + cleanup_thread_class(); + cleanup_table_share(); + cleanup_file_class(); + cleanup_events_waits_history_long(); + cleanup_table_share_hash(); + cleanup_file_hash(); + PFS_atomic::cleanup(); +} + +void shutdown_performance_schema(void) +{ + pfs_initialized= false; + cleanup_performance_schema(); + /* + Be careful to not delete un-initialized keys, + this would affect key 0, which is THR_KEY_mysys, + */ + if (THR_PFS_initialized) + { + my_pthread_setspecific_ptr(THR_PFS, NULL); + pthread_key_delete(THR_PFS); + THR_PFS_initialized= false; + } +} + diff --git a/storage/perfschema/pfs_server.h b/storage/perfschema/pfs_server.h new file mode 100644 index 00000000000..acf483e1f86 --- /dev/null +++ b/storage/perfschema/pfs_server.h @@ -0,0 +1,101 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_SERVER_H +#define PFS_SERVER_H + +/** + @file storage/perfschema/pfs_server.h + Private interface for the server (declarations). +*/ + +#ifndef PFS_MAX_MUTEX_CLASS + #define PFS_MAX_MUTEX_CLASS 200 +#endif +#ifndef PFS_MAX_MUTEX + #define PFS_MAX_MUTEX 1000 +#endif +#ifndef PFS_MAX_RWLOCK_CLASS + #define PFS_MAX_RWLOCK_CLASS 20 +#endif +#ifndef PFS_MAX_RWLOCK + #define PFS_MAX_RWLOCK 1000 +#endif +#ifndef PFS_MAX_COND_CLASS + #define PFS_MAX_COND_CLASS 80 +#endif +#ifndef PFS_MAX_COND + #define PFS_MAX_COND 1000 +#endif +#ifndef PFS_MAX_THREAD_CLASS + #define PFS_MAX_THREAD_CLASS 50 +#endif +#ifndef PFS_MAX_THREAD + #define PFS_MAX_THREAD 1000 +#endif +#ifndef PFS_MAX_FILE_CLASS + #define PFS_MAX_FILE_CLASS 50 +#endif +#ifndef PFS_MAX_FILE + #define PFS_MAX_FILE 10000 +#endif +#ifndef PFS_MAX_FILE_HANDLE + #define PFS_MAX_FILE_HANDLE 32768 +#endif +#ifndef PFS_MAX_TABLE_SHARE + #define PFS_MAX_TABLE_SHARE 50000 +#endif +#ifndef PFS_MAX_TABLE + #define PFS_MAX_TABLE 100000 +#endif +#ifndef PFS_WAITS_HISTORY_SIZE + #define PFS_WAITS_HISTORY_SIZE 10 +#endif +#ifndef PFS_WAITS_HISTORY_LONG_SIZE + #define PFS_WAITS_HISTORY_LONG_SIZE 10000 +#endif + +struct PFS_global_param +{ + bool m_enabled; + ulong m_mutex_class_sizing; + ulong m_rwlock_class_sizing; + ulong m_cond_class_sizing; + ulong m_thread_class_sizing; + ulong m_table_share_sizing; + ulong m_file_class_sizing; + ulong m_mutex_sizing; + ulong m_rwlock_sizing; + ulong m_cond_sizing; + ulong m_thread_sizing; + ulong m_table_sizing; + ulong m_file_sizing; + ulong m_file_handle_sizing; + ulong m_events_waits_history_sizing; + ulong m_events_waits_history_long_sizing; +}; + +extern PFS_global_param pfs_param; + +struct PSI_bootstrap* +initialize_performance_schema(const PFS_global_param *param); + +void initialize_performance_schema_acl(bool bootstrap); + +void check_performance_schema(); + +void shutdown_performance_schema(); + +#endif diff --git a/storage/perfschema/pfs_stat.h b/storage/perfschema/pfs_stat.h new file mode 100644 index 00000000000..654f292d82c --- /dev/null +++ b/storage/perfschema/pfs_stat.h @@ -0,0 +1,125 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_STAT_H +#define PFS_STAT_H + +/** + @file storage/perfschema/pfs_stat.h + Statistics (declarations). +*/ + +/** + @addtogroup Performance_schema_buffers + @{ +*/ + +/** Usage statistics chain, for a single value and its aggregates. */ +struct PFS_single_stat_chain +{ + /** + Control flag. + Statistics are aggregated only if the control flag is true. + */ + bool *m_control_flag; + /** Next link in the statistics chain. */ + struct PFS_single_stat_chain *m_parent; + /** Count of values. */ + ulonglong m_count; + /** Sum of values. */ + ulonglong m_sum; + /** Minimum value. */ + ulonglong m_min; + /** Maximum value. */ + ulonglong m_max; +}; + +/** + Reset a single statistic link. + Only the current link is reset, parents are not affected. + @param stat the statistics link to reset +*/ +inline void reset_single_stat_link(PFS_single_stat_chain *stat) +{ + stat->m_count= 0; + stat->m_sum= 0; + stat->m_min= ULONGLONG_MAX; + stat->m_max= 0; +} + +/** + Aggregate a value to a statistic chain. + @param stat the aggregated statistic chain + @param value the value to aggregate +*/ +inline void aggregate_single_stat_chain(PFS_single_stat_chain *stat, + ulonglong value) +{ + do + { + if (*stat->m_control_flag) + { + stat->m_count++; + stat->m_sum+= value; + if (stat->m_min > value) + stat->m_min= value; + if (stat->m_max < value) + stat->m_max= value; + } + stat= stat->m_parent; + } + while (stat); +} + +/** Statistics for COND usage. */ +struct PFS_cond_stat +{ + /** Number of times a condition was signalled. */ + ulonglong m_signal_count; + /** Number of times a condition was broadcasted. */ + ulonglong m_broadcast_count; +}; + +/** Statistics for FILE usage. */ +struct PFS_file_stat +{ + /** Number of current open handles. */ + ulong m_open_count; + /** Count of READ operations. */ + ulonglong m_count_read; + /** Count of WRITE operations. */ + ulonglong m_count_write; + /** Number of bytes read. */ + ulonglong m_read_bytes; + /** Number of bytes written. */ + ulonglong m_write_bytes; +}; + +/** + Reset file statistic. + @param stat the statistics to reset +*/ +inline void reset_file_stat(PFS_file_stat *stat) +{ + stat->m_open_count= 0; + stat->m_count_read= 0; + stat->m_count_write= 0; + stat->m_read_bytes= 0; + stat->m_write_bytes= 0; +} + +/** @} */ +#endif + diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc new file mode 100644 index 00000000000..65883b62c32 --- /dev/null +++ b/storage/perfschema/pfs_timer.cc @@ -0,0 +1,119 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/pfs_timer.cc + Performance schema timers (implementation). +*/ + +#include "my_global.h" +#include "pfs_timer.h" +#include "my_rdtsc.h" + +enum_timer_name wait_timer= TIMER_NAME_CYCLE; +MY_TIMER_INFO pfs_timer_info; + +static ulonglong cycle_v0; +static ulonglong nanosec_v0; +static ulonglong microsec_v0; +static ulonglong millisec_v0; +static ulonglong tick_v0; + +static ulong cycle_to_pico; /* 1000 at 1 GHz, 333 at 3GHz, 250 at 4GHz */ +static ulong nanosec_to_pico; /* In theory, 1 000 */ +static ulong microsec_to_pico; /* In theory, 1 000 000 */ +static ulong millisec_to_pico; /* In theory, 1 000 000 000, fits in uint32 */ +static ulonglong tick_to_pico; /* 1e10 at 100 Hz, 1.666e10 at 60 Hz */ + +static inline ulong round_to_ulong(double value) +{ + return (ulong) (value + 0.5); +} + +static inline ulonglong round_to_ulonglong(double value) +{ + return (ulonglong) (value + 0.5); +} + +void init_timers(void) +{ + double pico_frequency= 1.0e12; + + my_timer_init(&pfs_timer_info); + + cycle_v0= my_timer_cycles(); + nanosec_v0= my_timer_nanoseconds(); + microsec_v0= my_timer_microseconds(); + millisec_v0= my_timer_milliseconds(); + tick_v0= my_timer_ticks(); + + if (pfs_timer_info.cycles.frequency > 0) + cycle_to_pico= round_to_ulong(pico_frequency/ + (double)pfs_timer_info.cycles.frequency); + else + cycle_to_pico= 0; + + if (pfs_timer_info.nanoseconds.frequency > 0) + nanosec_to_pico= round_to_ulong(pico_frequency/ + (double)pfs_timer_info.nanoseconds.frequency); + else + nanosec_to_pico= 0; + + if (pfs_timer_info.microseconds.frequency > 0) + microsec_to_pico= round_to_ulong(pico_frequency/ + (double)pfs_timer_info.microseconds.frequency); + else + microsec_to_pico= 0; + + if (pfs_timer_info.milliseconds.frequency > 0) + millisec_to_pico= round_to_ulong(pico_frequency/ + (double)pfs_timer_info.milliseconds.frequency); + else + millisec_to_pico= 0; + + if (pfs_timer_info.ticks.frequency > 0) + tick_to_pico= round_to_ulonglong(pico_frequency/ + (double)pfs_timer_info.ticks.frequency); + else + tick_to_pico= 0; +} + +ulonglong get_timer_value(enum_timer_name timer_name) +{ + ulonglong result; + + switch (timer_name) { + case TIMER_NAME_CYCLE: + result= (my_timer_cycles() - cycle_v0) * cycle_to_pico; + break; + case TIMER_NAME_NANOSEC: + result= (my_timer_nanoseconds() - nanosec_v0) * nanosec_to_pico; + break; + case TIMER_NAME_MICROSEC: + result= (my_timer_microseconds() - microsec_v0) * microsec_to_pico; + break; + case TIMER_NAME_MILLISEC: + result= (my_timer_milliseconds() - millisec_v0) * millisec_to_pico; + break; + case TIMER_NAME_TICK: + result= (my_timer_ticks() - tick_v0) * tick_to_pico; + break; + default: + result= 0; + DBUG_ASSERT(false); + } + return result; +} + diff --git a/storage/perfschema/pfs_timer.h b/storage/perfschema/pfs_timer.h new file mode 100644 index 00000000000..beba263f45a --- /dev/null +++ b/storage/perfschema/pfs_timer.h @@ -0,0 +1,34 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef PFS_TIMER_H +#define PFS_TIMER_H + +/** + @file storage/perfschema/pfs_timer.h + Performance schema timers (declarations). +*/ +#include +#include "pfs_column_types.h" + +extern enum_timer_name wait_timer; +extern MY_TIMER_INFO pfs_timer_info; + +void init_timers(); + +ulonglong get_timer_value(enum_timer_name timer_name); + +#endif + diff --git a/storage/perfschema/plug.in b/storage/perfschema/plug.in new file mode 100644 index 00000000000..e6539dc1260 --- /dev/null +++ b/storage/perfschema/plug.in @@ -0,0 +1,26 @@ +dnl -*- ksh -*- + +# Copyright (C) 2008-2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +dnl This file is part of the configure scripts used by autoconf. + +MYSQL_STORAGE_ENGINE(perfschema, + perfschema, + [Performance Schema], + [Performance Schema], + [default,max,max-no-ndb]) +MYSQL_PLUGIN_DIRECTORY(perfschema, [storage/perfschema]) +MYSQL_PLUGIN_STATIC(perfschema, [libperfschema.a]) diff --git a/storage/perfschema/table_all_instr.cc b/storage/perfschema/table_all_instr.cc new file mode 100644 index 00000000000..e6cd7897f6f --- /dev/null +++ b/storage/perfschema/table_all_instr.cc @@ -0,0 +1,264 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_all_instr.cc + Abstract tables for all instruments (implementation). +*/ + +#include "mysql_priv.h" +#include "table_all_instr.h" +#include "pfs_global.h" + +table_all_instr::table_all_instr(const PFS_engine_table_share *share) + : PFS_readonly_table(share, &m_pos), + m_pos(), m_next_pos() +{} + +void table_all_instr::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_all_instr::rnd_next(void) +{ + PFS_mutex *mutex; + PFS_rwlock *rwlock; + PFS_cond *cond; + PFS_file *file; + + for (m_pos.set_at(&m_next_pos); + m_pos.has_more_view(); + m_pos.next_view()) + { + switch (m_pos.m_index_1) { + case pos_all_instr::VIEW_MUTEX: + for ( ; m_pos.m_index_2 < mutex_max; m_pos.m_index_2++) + { + mutex= &mutex_array[m_pos.m_index_2]; + if (mutex->m_lock.is_populated()) + { + make_mutex_row(mutex); + m_next_pos.set_after(&m_pos); + return 0; + } + } + break; + case pos_all_instr::VIEW_RWLOCK: + for ( ; m_pos.m_index_2 < rwlock_max; m_pos.m_index_2++) + { + rwlock= &rwlock_array[m_pos.m_index_2]; + if (rwlock->m_lock.is_populated()) + { + make_rwlock_row(rwlock); + m_next_pos.set_after(&m_pos); + return 0; + } + } + break; + case pos_all_instr::VIEW_COND: + for ( ; m_pos.m_index_2 < cond_max; m_pos.m_index_2++) + { + cond= &cond_array[m_pos.m_index_2]; + if (cond->m_lock.is_populated()) + { + make_cond_row(cond); + m_next_pos.set_after(&m_pos); + return 0; + } + } + break; + case pos_all_instr::VIEW_FILE: + for ( ; m_pos.m_index_2 < file_max; m_pos.m_index_2++) + { + file= &file_array[m_pos.m_index_2]; + if (file->m_lock.is_populated()) + { + make_file_row(file); + m_next_pos.set_after(&m_pos); + return 0; + } + } + break; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_all_instr::rnd_pos(const void *pos) +{ + PFS_mutex *mutex; + PFS_rwlock *rwlock; + PFS_cond *cond; + PFS_file *file; + + set_position(pos); + + switch (m_pos.m_index_1) { + case pos_all_instr::VIEW_MUTEX: + DBUG_ASSERT(m_pos.m_index_2 < mutex_max); + mutex= &mutex_array[m_pos.m_index_2]; + if (mutex->m_lock.is_populated()) + { + make_mutex_row(mutex); + return 0; + } + break; + case pos_all_instr::VIEW_RWLOCK: + DBUG_ASSERT(m_pos.m_index_2 < rwlock_max); + rwlock= &rwlock_array[m_pos.m_index_2]; + if (rwlock->m_lock.is_populated()) + { + make_rwlock_row(rwlock); + return 0; + } + break; + case pos_all_instr::VIEW_COND: + DBUG_ASSERT(m_pos.m_index_2 < cond_max); + cond= &cond_array[m_pos.m_index_2]; + if (cond->m_lock.is_populated()) + { + make_cond_row(cond); + return 0; + } + break; + case pos_all_instr::VIEW_FILE: + DBUG_ASSERT(m_pos.m_index_2 < file_max); + file= &file_array[m_pos.m_index_2]; + if (file->m_lock.is_populated()) + { + make_file_row(file); + return 0; + } + break; + } + + return HA_ERR_RECORD_DELETED; +} + +table_all_instr_class::table_all_instr_class +(const PFS_engine_table_share *share) + : PFS_readonly_table(share, &m_pos), + m_pos(), m_next_pos() +{} + +void table_all_instr_class::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_all_instr_class::rnd_next(void) +{ + PFS_mutex_class *mutex_class; + PFS_rwlock_class *rwlock_class; + PFS_cond_class *cond_class; + PFS_file_class *file_class; + + for (m_pos.set_at(&m_next_pos); + m_pos.has_more_view(); + m_pos.next_view()) + { + switch (m_pos.m_index_1) { + case pos_all_instr_class::VIEW_MUTEX: + mutex_class= find_mutex_class(m_pos.m_index_2); + if (mutex_class) + { + make_instr_row(mutex_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_all_instr_class::VIEW_RWLOCK: + rwlock_class= find_rwlock_class(m_pos.m_index_2); + if (rwlock_class) + { + make_instr_row(rwlock_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_all_instr_class::VIEW_COND: + cond_class= find_cond_class(m_pos.m_index_2); + if (cond_class) + { + make_instr_row(cond_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_all_instr_class::VIEW_FILE: + file_class= find_file_class(m_pos.m_index_2); + if (file_class) + { + make_instr_row(file_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_all_instr_class::rnd_pos(const void *pos) +{ + PFS_mutex_class *mutex_class; + PFS_rwlock_class *rwlock_class; + PFS_cond_class *cond_class; + PFS_file_class *file_class; + + set_position(pos); + switch (m_pos.m_index_1) { + case pos_all_instr_class::VIEW_MUTEX: + mutex_class= find_mutex_class(m_pos.m_index_2); + if (mutex_class) + { + make_instr_row(mutex_class); + return 0; + } + break; + case pos_all_instr_class::VIEW_RWLOCK: + rwlock_class= find_rwlock_class(m_pos.m_index_2); + if (rwlock_class) + { + make_instr_row(rwlock_class); + return 0; + } + break; + case pos_all_instr_class::VIEW_COND: + cond_class= find_cond_class(m_pos.m_index_2); + if (cond_class) + { + make_instr_row(cond_class); + return 0; + } + break; + case pos_all_instr_class::VIEW_FILE: + file_class= find_file_class(m_pos.m_index_2); + if (file_class) + { + make_instr_row(file_class); + return 0; + } + break; + } + + return HA_ERR_RECORD_DELETED; +} + diff --git a/storage/perfschema/table_all_instr.h b/storage/perfschema/table_all_instr.h new file mode 100644 index 00000000000..a8767695602 --- /dev/null +++ b/storage/perfschema/table_all_instr.h @@ -0,0 +1,168 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_ALL_INSTR_H +#define TABLE_ALL_INSTR_H + +/** + @file storage/perfschema/table_all_instr.h + Abstract tables for all instruments (declarations). +*/ + +#include "pfs_instr_class.h" +#include "pfs_instr.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** Position of a cursor on table_all_instr_class. */ +struct pos_all_instr_class : public PFS_double_index, + public PFS_instrument_view_constants +{ + pos_all_instr_class() + : PFS_double_index(VIEW_MUTEX, 1) + {} + + inline void reset(void) + { + m_index_1= VIEW_MUTEX; + m_index_2= 1; + } + + inline bool has_more_view(void) + { return (m_index_1 <= VIEW_FILE); } + + inline void next_view(void) + { + m_index_1++; + /* Instrument keys start at 1, not 0. */ + m_index_2= 1; + } +}; + +/** + Abstract table, a union of all instrumentations class metadata. + This table is a union of: + - a view on all mutex classes, + - a view on all rwlock classes, + - a view on all cond classes, + - a view on all file classes +*/ +class table_all_instr_class : public PFS_readonly_table +{ +public: + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + table_all_instr_class(const PFS_engine_table_share *share); + +public: + ~table_all_instr_class() + {} + +protected: + /** + Build a row. + @param klass the instrument class + */ + virtual void make_instr_row(PFS_instr_class *klass)= 0; + + /** Current position. */ + pos_all_instr_class m_pos; + /** Next position. */ + pos_all_instr_class m_next_pos; +}; + +/** Position of a cursor on table_all_instr. */ +struct pos_all_instr : public PFS_double_index, + public PFS_instrument_view_constants +{ + pos_all_instr() + : PFS_double_index(VIEW_MUTEX, 0) + {} + + inline void reset(void) + { + m_index_1= VIEW_MUTEX; + m_index_2= 0; + } + + inline bool has_more_view(void) + { return (m_index_1 <= VIEW_FILE); } + + inline void next_view(void) + { + m_index_1++; + m_index_2= 0; + } +}; + +/** + Abstract table, a union of all instrumentations instances. + This table is a union of: + - a view on all mutex instances, + - a view on all rwlock instances, + - a view on all cond instances, + - a view on all file instances +*/ +class table_all_instr : public PFS_readonly_table +{ +public: + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + table_all_instr(const PFS_engine_table_share *share); + +public: + ~table_all_instr() + {} + +protected: + /** + Build a row in the mutex instance view. + @param pfs the mutex instance + */ + virtual void make_mutex_row(PFS_mutex *pfs)= 0; + /** + Build a row in the rwlock instance view. + @param pfs the rwlock instance + */ + virtual void make_rwlock_row(PFS_rwlock *pfs)= 0; + /** + Build a row in the condition instance view. + @param pfs the condition instance + */ + virtual void make_cond_row(PFS_cond *pfs)= 0; + /** + Build a row in the file instance view. + @param pfs the file instance + */ + virtual void make_file_row(PFS_file *pfs)= 0; + + /** Current position. */ + pos_all_instr m_pos; + /** Next position. */ + pos_all_instr m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_events_waits.cc b/storage/perfschema/table_events_waits.cc new file mode 100644 index 00000000000..3a12578597e --- /dev/null +++ b/storage/perfschema/table_events_waits.cc @@ -0,0 +1,773 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_events_waits.cc + Table EVENTS_WAITS_xxx (implementation). +*/ + +#include "mysql_priv.h" +#include "table_events_waits.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" +#include "pfs_events_waits.h" + +THR_LOCK table_events_waits_current::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("THREAD_ID") }, + { C_STRING_WITH_LEN("int(11)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("EVENT_ID") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SOURCE") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_START") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_END") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SPINS") }, + { C_STRING_WITH_LEN("int(10)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_SCHEMA") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_NAME") }, + { C_STRING_WITH_LEN("varchar(512)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_TYPE") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("NESTING_EVENT_ID") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OPERATION") }, + { C_STRING_WITH_LEN("varchar(16)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("NUMBER_OF_BYTES") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("FLAGS") }, + { C_STRING_WITH_LEN("int(10)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_events_waits_current::m_field_def= +{ 16, field_types }; + +PFS_engine_table_share +table_events_waits_current::m_share= +{ + { C_STRING_WITH_LEN("EVENTS_WAITS_CURRENT") }, + &pfs_truncatable_acl, + &table_events_waits_current::create, + NULL, /* write_row */ + &table_events_waits_current::delete_all_rows, + 1000, /* records */ + sizeof(pos_events_waits_current), /* ref length */ + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +THR_LOCK table_events_waits_history::m_table_lock; + +PFS_engine_table_share +table_events_waits_history::m_share= +{ + { C_STRING_WITH_LEN("EVENTS_WAITS_HISTORY") }, + &pfs_truncatable_acl, + &table_events_waits_history::create, + NULL, /* write_row */ + &table_events_waits_history::delete_all_rows, + 1000, /* records */ + sizeof(pos_events_waits_history), /* ref length */ + &m_table_lock, + &table_events_waits_current::m_field_def, + false /* checked */ +}; + +THR_LOCK table_events_waits_history_long::m_table_lock; + +PFS_engine_table_share +table_events_waits_history_long::m_share= +{ + { C_STRING_WITH_LEN("EVENTS_WAITS_HISTORY_LONG") }, + &pfs_truncatable_acl, + &table_events_waits_history_long::create, + NULL, /* write_row */ + &table_events_waits_history_long::delete_all_rows, + 10000, /* records */ + sizeof(PFS_simple_index), /* ref length */ + &m_table_lock, + &table_events_waits_current::m_field_def, + false /* checked */ +}; + +table_events_waits_common::table_events_waits_common +(const PFS_engine_table_share *share, void *pos) + : PFS_readonly_table(share, pos), + m_row_exists(false) +{} + +void table_events_waits_common::clear_object_columns() +{ + m_row.m_object_type= NULL; + m_row.m_object_type_length= 0; + m_row.m_object_schema_length= 0; + m_row.m_object_name_length= 0; +} + +/** + Build a row. + @param thread_own_wait True if the memory for the wait + is owned by pfs_thread + @param pfs_thread the thread the cursor is reading + @param wait the wait the cursor is reading +*/ +void table_events_waits_common::make_row(bool thread_own_wait, + PFS_thread *pfs_thread, + PFS_events_waits *wait) +{ + pfs_lock lock; + PFS_thread *safe_thread; + PFS_instr_class *safe_class; + const char *base; + const char *safe_source_file; + + m_row_exists= false; + safe_thread= sanitize_thread(pfs_thread); + if (unlikely(safe_thread == NULL)) + return; + + /* Protect this reader against a thread termination */ + if (thread_own_wait) + safe_thread->m_lock.begin_optimistic_lock(&lock); + + /* + Design choice: + We could have used a pfs_lock in PFS_events_waits here, + to protect the reader from concurrent event generation, + but this leads to too many pfs_lock atomic operations + each time an event is recorded: + - 1 dirty() + 1 allocated() per event start, for EVENTS_WAITS_CURRENT + - 1 dirty() + 1 allocated() per event end, for EVENTS_WAITS_CURRENT + - 1 dirty() + 1 allocated() per copy to EVENTS_WAITS_HISTORY + - 1 dirty() + 1 allocated() per copy to EVENTS_WAITS_HISTORY_LONG + or 8 atomics per recorded event. + The problem is that we record a *lot* of events ... + + Instead, a *dirty* marking is done using m_wait_class. + Using m_wait_class alone does not guarantee anything, it just filters + out most of the bad data. + This is acceptable because this code is garbage-proof, + and won't crash on bad data, only display it, + very rarely (which is accepted). + + If a bad record is displayed, it's a very transient failure: + the next select * from EVENTS_WAITS_CURRENT/_HISTORY/_HISTORY_LONG will + show clean data again. + */ + + m_row.m_thread_internal_id= safe_thread->m_thread_internal_id; + m_row.m_event_id= wait->m_event_id; + m_row.m_timer_state= wait->m_timer_state; + m_row.m_timer_start= wait->m_timer_start; + m_row.m_timer_end= wait->m_timer_end; + m_row.m_object_instance_addr= (intptr) wait->m_object_instance_addr; + + /* + PFS_events_waits::m_class needs to be sanitized, + for race conditions when this code: + - reads a new value in m_wait_class, + - reads an old value in m_class. + */ + switch (wait->m_wait_class) + { + case WAIT_CLASS_MUTEX: + clear_object_columns(); + safe_class= sanitize_mutex_class((PFS_mutex_class*) wait->m_class); + break; + case WAIT_CLASS_RWLOCK: + clear_object_columns(); + safe_class= sanitize_rwlock_class((PFS_rwlock_class*) wait->m_class); + break; + case WAIT_CLASS_COND: + clear_object_columns(); + safe_class= sanitize_cond_class((PFS_cond_class*) wait->m_class); + break; + case WAIT_CLASS_TABLE: + m_row.m_object_type= "TABLE"; + m_row.m_object_type_length= 5; + memcpy(m_row.m_object_schema, wait->m_schema_name, + wait->m_schema_name_length); + m_row.m_object_schema_length= wait->m_schema_name_length; + memcpy(m_row.m_object_name, wait->m_object_name, + wait->m_object_name_length); + m_row.m_object_name_length= wait->m_object_name_length; + safe_class= &global_table_class; + break; + case WAIT_CLASS_FILE: + m_row.m_object_type= "FILE"; + m_row.m_object_type_length= 4; + m_row.m_object_schema_length= 0; + memcpy(m_row.m_object_name, wait->m_object_name, + wait->m_object_name_length); + m_row.m_object_name_length= wait->m_object_name_length; + safe_class= sanitize_file_class((PFS_file_class*) wait->m_class); + break; + case NO_WAIT_CLASS: + default: + return; + } + if (unlikely(safe_class == NULL)) + return; + m_row.m_name= safe_class->m_name; + m_row.m_name_length= safe_class->m_name_length; + + /* + We are assuming this pointer is sane, + since it comes from __FILE__. + */ + safe_source_file= wait->m_source_file; + if (unlikely(safe_source_file == NULL)) + return; + + base= base_name(wait->m_source_file); + m_row.m_source_length= my_snprintf(m_row.m_source, sizeof(m_row.m_source), + "%s:%d", base, wait->m_source_line); + if (m_row.m_source_length > sizeof(m_row.m_source)) + m_row.m_source_length= sizeof(m_row.m_source); + m_row.m_operation= wait->m_operation; + m_row.m_number_of_bytes= wait->m_number_of_bytes; + m_row.m_flags= 0; + + if (thread_own_wait) + { + if (safe_thread->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; + } + else + { + /* + For EVENTS_WAITS_HISTORY_LONG (thread_own_wait is false), + the wait record is always valid, because it is not stored + in memory owned by pfs_thread. + Even when the thread terminated, the record is mostly readable, + so this record is displayed. + */ + m_row_exists= true; + } +} + +/** + Operations names map, as displayed in the 'OPERATION' column. + Indexed by enum_operation_type - 1. + Note: enum_operation_type contains a more precise definition, + since more details are needed internally by the instrumentation. + Different similar operations (CLOSE vs STREAMCLOSE) are displayed + with the same name 'close'. +*/ +static const LEX_STRING operation_names_map[]= +{ + /* Mutex operations */ + { C_STRING_WITH_LEN("lock") }, + { C_STRING_WITH_LEN("try_lock") }, + + /* RWLock operations */ + { C_STRING_WITH_LEN("read_lock") }, + { C_STRING_WITH_LEN("write_lock") }, + { C_STRING_WITH_LEN("try_read_lock") }, + { C_STRING_WITH_LEN("try_write_lock") }, + + /* Condition operations */ + { C_STRING_WITH_LEN("wait") }, + { C_STRING_WITH_LEN("timed_wait") }, + + /* File operations */ + { C_STRING_WITH_LEN("create") }, + { C_STRING_WITH_LEN("create") }, /* create tmp */ + { C_STRING_WITH_LEN("open") }, + { C_STRING_WITH_LEN("open") }, /* stream open */ + { C_STRING_WITH_LEN("close") }, + { C_STRING_WITH_LEN("close") }, /* stream close */ + { C_STRING_WITH_LEN("read") }, + { C_STRING_WITH_LEN("write") }, + { C_STRING_WITH_LEN("seek") }, + { C_STRING_WITH_LEN("tell") }, + { C_STRING_WITH_LEN("flush") }, + { C_STRING_WITH_LEN("stat") }, + { C_STRING_WITH_LEN("stat") }, /* fstat */ + { C_STRING_WITH_LEN("chsize") }, + { C_STRING_WITH_LEN("delete") }, + { C_STRING_WITH_LEN("rename") }, + { C_STRING_WITH_LEN("sync") } +}; + + +int table_events_waits_common::read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) +{ + Field *f; + const LEX_STRING *operation; + + compile_time_assert(COUNT_OPERATION_TYPE == + array_elements(operation_names_map)); + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 2); + buf[0]= 0; + buf[1]= 0; + + /* + Some columns are unreliable, because they are joined with other buffers, + which could have changed and been reused for something else. + These columns are: + - THREAD_ID (m_thread joins with PFS_thread), + - SCHEMA_NAME (m_schema_name joins with PFS_table_share) + - OBJECT_NAME (m_object_name joins with PFS_table_share) + */ + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* THREAD_ID */ + set_field_ulong(f, m_row.m_thread_internal_id); + break; + case 1: /* EVENT_ID */ + set_field_ulonglong(f, m_row.m_event_id); + break; + case 2: /* EVENT_NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 3: /* SOURCE */ + set_field_varchar_utf8(f, m_row.m_source, m_row.m_source_length); + break; + case 4: /* TIMER_START */ + if ((m_row.m_timer_state == TIMER_STATE_STARTED) || + (m_row.m_timer_state == TIMER_STATE_TIMED)) + set_field_ulonglong(f, m_row.m_timer_start); + else + f->set_null(); + break; + case 5: /* TIMER_END */ + if (m_row.m_timer_state == TIMER_STATE_TIMED) + set_field_ulonglong(f, m_row.m_timer_end); + else + f->set_null(); + break; + case 6: /* TIMER_WAIT */ + if (m_row.m_timer_state == TIMER_STATE_TIMED) + set_field_ulonglong(f, m_row.m_timer_end - m_row.m_timer_start); + else + f->set_null(); + break; + case 7: /* SPINS */ + f->set_null(); + break; + case 8: /* OBJECT_SCHEMA */ + if (m_row.m_object_schema_length > 0) + { + set_field_varchar_utf8(f, m_row.m_object_schema, + m_row.m_object_schema_length); + } + else + f->set_null(); + break; + case 9: /* OBJECT_NAME */ + if (m_row.m_object_name_length > 0) + { + set_field_varchar_utf8(f, m_row.m_object_name, + m_row.m_object_name_length); + } + else + f->set_null(); + break; + case 10: /* OBJECT_TYPE */ + if (m_row.m_object_type) + { + set_field_varchar_utf8(f, m_row.m_object_type, + m_row.m_object_type_length); + } + else + f->set_null(); + break; + case 11: /* OBJECT_INSTANCE */ + set_field_ulonglong(f, m_row.m_object_instance_addr); + break; + case 12: /* NESTING_EVENT_ID */ + f->set_null(); + break; + case 13: /* OPERATION */ + operation= &operation_names_map[(int) m_row.m_operation - 1]; + set_field_varchar_utf8(f, operation->str, operation->length); + break; + case 14: /* NUMBER_OF_BYTES */ + if ((m_row.m_operation == OPERATION_TYPE_FILEREAD) || + (m_row.m_operation == OPERATION_TYPE_FILEWRITE) || + (m_row.m_operation == OPERATION_TYPE_FILECHSIZE)) + set_field_ulonglong(f, m_row.m_number_of_bytes); + else + f->set_null(); + break; + case 15: /* FLAGS */ + set_field_ulong(f, m_row.m_flags); + break; + default: + DBUG_ASSERT(false); + } + } + } + return 0; +} + +PFS_engine_table* table_events_waits_current::create(void) +{ + return new table_events_waits_current(); +} + +table_events_waits_current::table_events_waits_current() + : table_events_waits_common(&m_share, &m_pos), + m_pos(), m_next_pos() +{} + +void table_events_waits_current::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_events_waits_current::rnd_next(void) +{ + PFS_thread *pfs_thread; + PFS_events_waits *wait; + + for (m_pos.set_at(&m_next_pos); + m_pos.m_index_1 < thread_max; + m_pos.next_thread()) + { + pfs_thread= &thread_array[m_pos.m_index_1]; + + if (! pfs_thread->m_lock.is_populated()) + { + /* This thread does not exist */ + continue; + } + + /* + We do not show nested events for now, + this will be revised with TABLE io + */ +#define ONLY_SHOW_ONE_WAIT + +#ifdef ONLY_SHOW_ONE_WAIT + if (m_pos.m_index_2 >= 1) + continue; +#else + if (m_pos.m_index_2 >= pfs_thread->m_wait_locker_count) + continue; +#endif + + wait= &pfs_thread->m_wait_locker_stack[m_pos.m_index_2].m_waits_current; + + if (wait->m_wait_class == NO_WAIT_CLASS) + { + /* + This locker does not exist. + There can not be more lockers in the stack, skip to the next thread + */ + continue; + } + + make_row(true, pfs_thread, wait); + /* Next iteration, look for the next locker in this thread */ + m_next_pos.set_after(&m_pos); + return 0; + } + + return HA_ERR_END_OF_FILE; +} + +int table_events_waits_current::rnd_pos(const void *pos) +{ + PFS_thread *pfs_thread; + PFS_events_waits *wait; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index_1 < thread_max); + pfs_thread= &thread_array[m_pos.m_index_1]; + + if (! pfs_thread->m_lock.is_populated()) + return HA_ERR_RECORD_DELETED; + +#ifdef ONLY_SHOW_CURRENT_WAITS + if (m_pos.m_index_2 >= pfs_thread->m_wait_locker_count) + return HA_ERR_RECORD_DELETED; +#endif + + DBUG_ASSERT(m_pos.m_index_2 < LOCKER_STACK_SIZE); + + wait= &pfs_thread->m_wait_locker_stack[m_pos.m_index_2].m_waits_current; + + if (wait->m_wait_class == NO_WAIT_CLASS) + return HA_ERR_RECORD_DELETED; + + make_row(true, pfs_thread, wait); + return 0; +} + +int table_events_waits_current::delete_all_rows(void) +{ + reset_events_waits_current(); + return 0; +} + +PFS_engine_table* table_events_waits_history::create(void) +{ + return new table_events_waits_history(); +} + +table_events_waits_history::table_events_waits_history() + : table_events_waits_common(&m_share, &m_pos), + m_pos(), m_next_pos() +{} + +void table_events_waits_history::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_events_waits_history::rnd_next(void) +{ + PFS_thread *pfs_thread; + PFS_events_waits *wait; + + if (events_waits_history_per_thread == 0) + return HA_ERR_END_OF_FILE; + + for (m_pos.set_at(&m_next_pos); + m_pos.m_index_1 < thread_max; + m_pos.next_thread()) + { + pfs_thread= &thread_array[m_pos.m_index_1]; + + if (! pfs_thread->m_lock.is_populated()) + { + /* This thread does not exist */ + continue; + } + + if (m_pos.m_index_2 >= events_waits_history_per_thread) + { + /* This thread does not have more (full) history */ + continue; + } + + if ( ! pfs_thread->m_waits_history_full && + (m_pos.m_index_2 >= pfs_thread->m_waits_history_index)) + { + /* This thread does not have more (not full) history */ + continue; + } + + if (pfs_thread->m_waits_history[m_pos.m_index_2].m_wait_class + == NO_WAIT_CLASS) + { + /* + This locker does not exist. + There can not be more lockers in the stack, skip to the next thread + */ + continue; + } + + wait= &pfs_thread->m_waits_history[m_pos.m_index_2]; + + make_row(true, pfs_thread, wait); + /* Next iteration, look for the next history in this thread */ + m_next_pos.set_after(&m_pos); + return 0; + } + + return HA_ERR_END_OF_FILE; +} + +int table_events_waits_history::rnd_pos(const void *pos) +{ + PFS_thread *pfs_thread; + PFS_events_waits *wait; + + DBUG_ASSERT(events_waits_history_per_thread != 0); + set_position(pos); + DBUG_ASSERT(m_pos.m_index_1 < thread_max); + pfs_thread= &thread_array[m_pos.m_index_1]; + + if (! pfs_thread->m_lock.is_populated()) + return HA_ERR_RECORD_DELETED; + + DBUG_ASSERT(m_pos.m_index_2 < events_waits_history_per_thread); + + if ( ! pfs_thread->m_waits_history_full && + (m_pos.m_index_2 >= pfs_thread->m_waits_history_index)) + return HA_ERR_RECORD_DELETED; + + if (pfs_thread->m_waits_history[m_pos.m_index_2].m_wait_class + == NO_WAIT_CLASS) + return HA_ERR_RECORD_DELETED; + + wait= &pfs_thread->m_waits_history[m_pos.m_index_2]; + + make_row(true, pfs_thread, wait); + return 0; +} + +int table_events_waits_history::delete_all_rows(void) +{ + reset_events_waits_history(); + return 0; +} + +PFS_engine_table* table_events_waits_history_long::create(void) +{ + return new table_events_waits_history_long(); +} + +table_events_waits_history_long::table_events_waits_history_long() + : table_events_waits_common(&m_share, &m_pos), + m_pos(0), m_next_pos(0) +{} + +void table_events_waits_history_long::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_events_waits_history_long::rnd_next(void) +{ + PFS_events_waits *wait; + uint limit; + + if (events_waits_history_long_size == 0) + return HA_ERR_END_OF_FILE; + + if (events_waits_history_long_full) + limit= events_waits_history_long_size; + else + limit= events_waits_history_long_index % events_waits_history_long_size; + + for (m_pos.set_at(&m_next_pos); m_pos.m_index < limit; m_pos.next()) + { + wait= &events_waits_history_long_array[m_pos.m_index]; + + if (wait->m_wait_class != NO_WAIT_CLASS) + { + make_row(false, wait->m_thread, wait); + /* Next iteration, look for the next entry */ + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_events_waits_history_long::rnd_pos(const void *pos) +{ + PFS_events_waits *wait; + uint limit; + + if (events_waits_history_long_size == 0) + return HA_ERR_RECORD_DELETED; + + set_position(pos); + + if (events_waits_history_long_full) + limit= events_waits_history_long_size; + else + limit= events_waits_history_long_index % events_waits_history_long_size; + + if (m_pos.m_index >= limit) + return HA_ERR_RECORD_DELETED; + + wait= &events_waits_history_long_array[m_pos.m_index]; + + if (wait->m_wait_class == NO_WAIT_CLASS) + return HA_ERR_RECORD_DELETED; + + make_row(false, wait->m_thread, wait); + return 0; +} + +int table_events_waits_history_long::delete_all_rows(void) +{ + reset_events_waits_history_long(); + return 0; +} + diff --git a/storage/perfschema/table_events_waits.h b/storage/perfschema/table_events_waits.h new file mode 100644 index 00000000000..5aa16cc0cab --- /dev/null +++ b/storage/perfschema/table_events_waits.h @@ -0,0 +1,248 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_EVENTS_WAITS_H +#define TABLE_EVENTS_WAITS_H + +/** + @file storage/perfschema/table_events_waits.h + Table EVENTS_WAITS_xxx (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" +#include "pfs_events_waits.h" + +struct PFS_thread; + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of table_events_waits_common. */ +struct row_events_waits +{ + /** Column THREAD_ID. */ + ulong m_thread_internal_id; + /** Column EVENT_ID. */ + ulonglong m_event_id; + /** Column EVENT_NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Timer state. */ + enum timer_state m_timer_state; + /** Column TIMER_START. */ + ulonglong m_timer_start; + /** True if TIMER_END is null. */ + bool m_timer_end_null; + /** Column TIMER_END. */ + ulonglong m_timer_end; + /** Column OBJECT_TYPE. */ + const char *m_object_type; + /** Length in bytes of @c m_object_type. */ + uint m_object_type_length; + /** Column OBJECT_SCHEMA. */ + char m_object_schema[COL_OBJECT_SCHEMA_SIZE]; + /** Length in bytes of @c m_object_schema. */ + uint m_object_schema_length; + /** Column OBJECT_NAME. */ + char m_object_name[COL_OBJECT_NAME_EXTENDED_SIZE]; + /** Length in bytes of @c m_object_name. */ + uint m_object_name_length; + /** Column OBJECT_INSTANCE_BEGIN. */ + intptr m_object_instance_addr; + /** Column SOURCE. */ + char m_source[COL_SOURCE_SIZE]; + /** Length in bytes of @c m_source. */ + uint m_source_length; + /** Column OPERATION. */ + enum_operation_type m_operation; + /** Column NUMBER_OF_BYTES. */ + ulonglong m_number_of_bytes; + /** Column FLAGS. */ + uint m_flags; +}; + +/** Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. */ +struct pos_events_waits_current : public PFS_double_index +{ + pos_events_waits_current() + : PFS_double_index(0, 0) + {} + + inline void reset(void) + { + m_index_1= 0; + m_index_2= 0; + } + + inline void next_thread(void) + { + m_index_1++; + m_index_2= 0; + } +}; + +/** Position of a cursor on PERFORMANCE_SCHEMA.EVENTS_WAITS_HISTORY. */ +struct pos_events_waits_history : public PFS_double_index +{ + pos_events_waits_history() + : PFS_double_index(0, 0) + {} + + inline void reset(void) + { + m_index_1= 0; + m_index_2= 0; + } + + inline void next_thread(void) + { + m_index_1++; + m_index_2= 0; + } +}; + +/** + Adapter, for table sharing the structure of + PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. +*/ +class table_events_waits_common : public PFS_readonly_table +{ +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_events_waits_common(const PFS_engine_table_share *share, void *pos); + + ~table_events_waits_common() + {} + + void clear_object_columns(); + + void make_row(bool thread_own_wait, PFS_thread *pfs_thread, + PFS_events_waits *wait); + + /** Current row. */ + row_events_waits m_row; + /** True is the current row exists. */ + bool m_row_exists; +}; + +/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_CURRENT. */ +class table_events_waits_current : public table_events_waits_common +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + table_events_waits_current(); + +public: + ~table_events_waits_current() + {} + +private: + friend class table_events_waits_history; + friend class table_events_waits_history_long; + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** + Fields definition. + Also used by table_events_waits_history + and table_events_waits_history_long. + */ + static TABLE_FIELD_DEF m_field_def; + + /** Current position. */ + pos_events_waits_current m_pos; + /** Next position. */ + pos_events_waits_current m_next_pos; +}; + +/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_HISTORY. */ +class table_events_waits_history : public table_events_waits_common +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + table_events_waits_history(); + +public: + ~table_events_waits_history() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + + /** Current position. */ + pos_events_waits_history m_pos; + /** Next position. */ + pos_events_waits_history m_next_pos; +}; + +/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_HISTORY_LONG. */ +class table_events_waits_history_long : public table_events_waits_common +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + table_events_waits_history_long(); + +public: + ~table_events_waits_history_long() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_events_waits_summary.cc b/storage/perfschema/table_events_waits_summary.cc new file mode 100644 index 00000000000..c3d678d374c --- /dev/null +++ b/storage/perfschema/table_events_waits_summary.cc @@ -0,0 +1,696 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_events_waits_summary.cc + Table EVENTS_WAITS_SUMMARY_BY_xxx (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_instr_class.h" +#include "pfs_column_types.h" +#include "pfs_column_values.h" +#include "table_events_waits_summary.h" +#include "pfs_global.h" + +THR_LOCK table_events_waits_summary_by_thread_by_event_name::m_table_lock; + +static const TABLE_FIELD_TYPE ews_by_thread_by_event_name_field_types[]= +{ + { + { C_STRING_WITH_LEN("THREAD_ID") }, + { C_STRING_WITH_LEN("int(11)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_STAR") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("MIN_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("AVG_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("MAX_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_events_waits_summary_by_thread_by_event_name::m_field_def= +{ 7, ews_by_thread_by_event_name_field_types }; + +PFS_engine_table_share +table_events_waits_summary_by_thread_by_event_name::m_share= +{ + { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME") }, + &pfs_truncatable_acl, + &table_events_waits_summary_by_thread_by_event_name::create, + NULL, /* write_row */ + &table_events_waits_summary_by_thread_by_event_name::delete_all_rows, + 1000, /* records */ + sizeof(pos_events_waits_summary_by_thread_by_event_name), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* +table_events_waits_summary_by_thread_by_event_name::create(void) +{ + return new table_events_waits_summary_by_thread_by_event_name(); +} + +int +table_events_waits_summary_by_thread_by_event_name::delete_all_rows(void) +{ + reset_per_thread_wait_stat(); + return 0; +} + +table_events_waits_summary_by_thread_by_event_name +::table_events_waits_summary_by_thread_by_event_name() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(), m_next_pos() +{} + +void table_events_waits_summary_by_thread_by_event_name::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_events_waits_summary_by_thread_by_event_name::rnd_next(void) +{ + PFS_thread *thread; + PFS_mutex_class *mutex_class; + PFS_rwlock_class *rwlock_class; + PFS_cond_class *cond_class; + PFS_file_class *file_class; + + for (m_pos.set_at(&m_next_pos); + m_pos.has_more_thread(); + m_pos.next_thread()) + { + thread= &thread_array[m_pos.m_index_1]; + if (thread->m_lock.is_populated()) + { + for ( ; m_pos.has_more_view(); m_pos.next_view()) + { + switch (m_pos.m_index_2) { + case pos_events_waits_summary_by_thread_by_event_name::VIEW_MUTEX: + mutex_class= find_mutex_class(m_pos.m_index_3); + if (mutex_class) + { + make_mutex_row(thread, mutex_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_events_waits_summary_by_thread_by_event_name::VIEW_RWLOCK: + rwlock_class= find_rwlock_class(m_pos.m_index_3); + if (rwlock_class) + { + make_rwlock_row(thread, rwlock_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_events_waits_summary_by_thread_by_event_name::VIEW_COND: + cond_class= find_cond_class(m_pos.m_index_3); + if (cond_class) + { + make_cond_row(thread, cond_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_events_waits_summary_by_thread_by_event_name::VIEW_FILE: + file_class= find_file_class(m_pos.m_index_3); + if (file_class) + { + make_file_row(thread, file_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + } + } + } + } + + return HA_ERR_END_OF_FILE; +} + +int +table_events_waits_summary_by_thread_by_event_name::rnd_pos(const void *pos) +{ + PFS_thread *thread; + PFS_mutex_class *mutex_class; + PFS_rwlock_class *rwlock_class; + PFS_cond_class *cond_class; + PFS_file_class *file_class; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index_1 < thread_max); + + thread= &thread_array[m_pos.m_index_1]; + if (! thread->m_lock.is_populated()) + return HA_ERR_RECORD_DELETED; + + switch (m_pos.m_index_2) { + case pos_events_waits_summary_by_thread_by_event_name::VIEW_MUTEX: + mutex_class= find_mutex_class(m_pos.m_index_3); + if (mutex_class) + { + make_mutex_row(thread, mutex_class); + return 0; + } + break; + case pos_events_waits_summary_by_thread_by_event_name::VIEW_RWLOCK: + rwlock_class= find_rwlock_class(m_pos.m_index_3); + if (rwlock_class) + { + make_rwlock_row(thread, rwlock_class); + return 0; + } + break; + case pos_events_waits_summary_by_thread_by_event_name::VIEW_COND: + cond_class= find_cond_class(m_pos.m_index_3); + if (cond_class) + { + make_cond_row(thread, cond_class); + return 0; + } + break; + case pos_events_waits_summary_by_thread_by_event_name::VIEW_FILE: + file_class= find_file_class(m_pos.m_index_3); + if (file_class) + { + make_file_row(thread, file_class); + return 0; + } + break; + } + return HA_ERR_RECORD_DELETED; +} + +void table_events_waits_summary_by_thread_by_event_name +::make_instr_row(PFS_thread *thread, PFS_instr_class *klass, + PFS_single_stat_chain *stat) +{ + pfs_lock lock; + + m_row_exists= false; + + /* Protect this reader against a thread termination */ + thread->m_lock.begin_optimistic_lock(&lock); + + m_row.m_thread_internal_id= thread->m_thread_internal_id; + m_row.m_name= klass->m_name; + m_row.m_name_length= klass->m_name_length; + + m_row.m_count= stat->m_count; + m_row.m_sum= stat->m_sum; + m_row.m_min= stat->m_min; + m_row.m_max= stat->m_max; + + if (m_row.m_count) + m_row.m_avg= m_row.m_sum / m_row.m_count; + else + { + m_row.m_min= 0; + m_row.m_avg= 0; + } + + if (thread->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +void table_events_waits_summary_by_thread_by_event_name +::make_mutex_row(PFS_thread *thread, PFS_mutex_class *klass) +{ + PFS_single_stat_chain *stat; + stat= find_per_thread_mutex_class_wait_stat(thread, klass); + make_instr_row(thread, klass, stat); +} + +void table_events_waits_summary_by_thread_by_event_name +::make_rwlock_row(PFS_thread *thread, PFS_rwlock_class *klass) +{ + PFS_single_stat_chain *stat; + stat= find_per_thread_rwlock_class_wait_stat(thread, klass); + make_instr_row(thread, klass, stat); +} + +void table_events_waits_summary_by_thread_by_event_name +::make_cond_row(PFS_thread *thread, PFS_cond_class *klass) +{ + PFS_single_stat_chain *stat; + stat= find_per_thread_cond_class_wait_stat(thread, klass); + make_instr_row(thread, klass, stat); +} + +void table_events_waits_summary_by_thread_by_event_name +::make_file_row(PFS_thread *thread, PFS_file_class *klass) +{ + PFS_single_stat_chain *stat; + stat= find_per_thread_file_class_wait_stat(thread, klass); + make_instr_row(thread, klass, stat); +} + +int table_events_waits_summary_by_thread_by_event_name +::read_row_values(TABLE *table, unsigned char *, Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* THREAD_ID */ + set_field_ulong(f, m_row.m_thread_internal_id); + break; + case 1: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 2: /* COUNT */ + set_field_ulonglong(f, m_row.m_count); + break; + case 3: /* SUM */ + set_field_ulonglong(f, m_row.m_sum); + break; + case 4: /* MIN */ + set_field_ulonglong(f, m_row.m_min); + break; + case 5: /* AVG */ + set_field_ulonglong(f, m_row.m_avg); + break; + case 6: /* MAX */ + set_field_ulonglong(f, m_row.m_max); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +THR_LOCK table_events_waits_summary_by_event_name::m_table_lock; + +static const TABLE_FIELD_TYPE ews_by_event_name_field_types[]= +{ + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_STAR") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("MIN_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("AVG_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("MAX_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_events_waits_summary_by_event_name::m_field_def= +{ 6, ews_by_event_name_field_types }; + +PFS_engine_table_share +table_events_waits_summary_by_event_name::m_share= +{ + { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_BY_EVENT_NAME") }, + &pfs_truncatable_acl, + &table_events_waits_summary_by_event_name::create, + NULL, /* write_row */ + &table_events_waits_summary_by_event_name::delete_all_rows, + 1000, /* records */ + sizeof(pos_all_instr_class), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_events_waits_summary_by_event_name::create(void) +{ + return new table_events_waits_summary_by_event_name(); +} + +int table_events_waits_summary_by_event_name::delete_all_rows(void) +{ + reset_instrument_class_waits(); + return 0; +} + +table_events_waits_summary_by_event_name +::table_events_waits_summary_by_event_name() + : table_all_instr_class(&m_share) +{} + +void table_events_waits_summary_by_event_name +::make_instr_row(PFS_instr_class *klass) +{ + m_row.m_name= klass->m_name; + m_row.m_name_length= klass->m_name_length; + + m_row.m_count= klass->m_wait_stat.m_count; + m_row.m_sum= klass->m_wait_stat.m_sum; + m_row.m_min= klass->m_wait_stat.m_min; + m_row.m_max= klass->m_wait_stat.m_max; + + if (m_row.m_count) + m_row.m_avg= m_row.m_sum / m_row.m_count; + else + { + m_row.m_min= 0; + m_row.m_avg= 0; + } +} + +int table_events_waits_summary_by_event_name +::read_row_values(TABLE *table, unsigned char *, Field **fields, + bool read_all) +{ + Field *f; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + /* + The row always exist, + the instrument classes are static and never disappear. + */ + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* COUNT */ + set_field_ulonglong(f, m_row.m_count); + break; + case 2: /* SUM */ + set_field_ulonglong(f, m_row.m_sum); + break; + case 3: /* MIN */ + set_field_ulonglong(f, m_row.m_min); + break; + case 4: /* AVG */ + set_field_ulonglong(f, m_row.m_avg); + break; + case 5: /* MAX */ + set_field_ulonglong(f, m_row.m_max); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +THR_LOCK table_events_waits_summary_by_instance::m_table_lock; + +static const TABLE_FIELD_TYPE ews_by_instance_field_types[]= +{ + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_STAR") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("MIN_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("AVG_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("MAX_TIMER_WAIT") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_events_waits_summary_by_instance::m_field_def= +{ 7, ews_by_instance_field_types }; + +PFS_engine_table_share +table_events_waits_summary_by_instance::m_share= +{ + { C_STRING_WITH_LEN("EVENTS_WAITS_SUMMARY_BY_INSTANCE") }, + &pfs_truncatable_acl, + &table_events_waits_summary_by_instance::create, + NULL, /* write_row */ + &table_events_waits_summary_by_instance::delete_all_rows, + 1000, /* records */ + sizeof(pos_all_instr), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_events_waits_summary_by_instance::create(void) +{ + return new table_events_waits_summary_by_instance(); +} + +int table_events_waits_summary_by_instance::delete_all_rows(void) +{ + reset_events_waits_by_instance(); + return 0; +} + +table_events_waits_summary_by_instance +::table_events_waits_summary_by_instance() + : table_all_instr(&m_share), m_row_exists(false) +{} + +void table_events_waits_summary_by_instance +::make_instr_row(PFS_instr *pfs, PFS_instr_class *klass, + const void *object_instance_begin) +{ + pfs_lock lock; + + m_row_exists= false; + + /* + Protect this reader against a mutex/rwlock/cond destroy, + file delete, table drop. + */ + pfs->m_lock.begin_optimistic_lock(&lock); + + m_row.m_name= klass->m_name; + m_row.m_name_length= klass->m_name_length; + m_row.m_object_instance_addr= (intptr) object_instance_begin; + + m_row.m_count= pfs->m_wait_stat.m_count; + m_row.m_sum= pfs->m_wait_stat.m_sum; + m_row.m_min= pfs->m_wait_stat.m_min; + m_row.m_max= pfs->m_wait_stat.m_max; + + if (m_row.m_count) + m_row.m_avg= m_row.m_sum / m_row.m_count; + else + { + m_row.m_min= 0; + m_row.m_avg= 0; + } + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +/** + Build a row, for mutex statistics in a thread. + @param pfs the mutex this cursor is reading +*/ +void table_events_waits_summary_by_instance::make_mutex_row(PFS_mutex *pfs) +{ + PFS_mutex_class *safe_class; + safe_class= sanitize_mutex_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + make_instr_row(pfs, safe_class, pfs->m_identity); +} + +/** + Build a row, for rwlock statistics in a thread. + @param pfs the rwlock this cursor is reading +*/ +void table_events_waits_summary_by_instance::make_rwlock_row(PFS_rwlock *pfs) +{ + PFS_rwlock_class *safe_class; + safe_class= sanitize_rwlock_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + make_instr_row(pfs, safe_class, pfs->m_identity); +} + +/** + Build a row, for condition statistics in a thread. + @param pfs the condition this cursor is reading +*/ +void table_events_waits_summary_by_instance::make_cond_row(PFS_cond *pfs) +{ + PFS_cond_class *safe_class; + safe_class= sanitize_cond_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + make_instr_row(pfs, safe_class, pfs->m_identity); +} + +/** + Build a row, for file statistics in a thread. + @param pfs the file this cursor is reading +*/ +void table_events_waits_summary_by_instance::make_file_row(PFS_file *pfs) +{ + PFS_file_class *safe_class; + safe_class= sanitize_file_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + /* + Files don't have a in memory structure associated to it, + so we use the address of the PFS_file buffer as object_instance_begin + */ + make_instr_row(pfs, safe_class, pfs); +} + +int table_events_waits_summary_by_instance +::read_row_values(TABLE *table, unsigned char *, Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* OBJECT_INSTANCE */ + set_field_ulonglong(f, m_row.m_object_instance_addr); + break; + case 2: /* COUNT */ + set_field_ulonglong(f, m_row.m_count); + break; + case 3: /* SUM */ + set_field_ulonglong(f, m_row.m_sum); + break; + case 4: /* MIN */ + set_field_ulonglong(f, m_row.m_min); + break; + case 5: /* AVG */ + set_field_ulonglong(f, m_row.m_avg); + break; + case 6: /* MAX */ + set_field_ulonglong(f, m_row.m_max); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_events_waits_summary.h b/storage/perfschema/table_events_waits_summary.h new file mode 100644 index 00000000000..28c820e5c81 --- /dev/null +++ b/storage/perfschema/table_events_waits_summary.h @@ -0,0 +1,261 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_EVENTS_WAITS_SUMMARY_H +#define TABLE_EVENTS_WAITS_SUMMARY_H + +/** + @file storage/perfschema/table_events_waits_summary.h + Table EVENTS_WAITS_SUMMARY_BY_xxx (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" +#include "table_all_instr.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** + A row of table + PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. +*/ +struct row_events_waits_summary_by_thread_by_event_name +{ + /** Column THREAD_ID. */ + ulong m_thread_internal_id; + /** Column EVENT_NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column COUNT_STAR. */ + ulonglong m_count; + /** Column SUM_TIMER_WAIT. */ + ulonglong m_sum; + /** Column MIN_TIMER_WAIT. */ + ulonglong m_min; + /** Column AVG_TIMER_WAIT. */ + ulonglong m_avg; + /** Column MAX_TIMER_WAIT. */ + ulonglong m_max; +}; + +/** + Position of a cursor on + PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. +*/ +struct pos_events_waits_summary_by_thread_by_event_name +: public PFS_triple_index, public PFS_instrument_view_constants +{ + pos_events_waits_summary_by_thread_by_event_name() + : PFS_triple_index(0, VIEW_MUTEX, 1) + {} + + inline void reset(void) + { + m_index_1= 0; + m_index_2= VIEW_MUTEX; + m_index_3= 1; + } + + inline bool has_more_thread(void) + { return (m_index_1 < thread_max); } + + inline bool has_more_view(void) + { return (m_index_2 <= VIEW_FILE); } + + inline void next_thread(void) + { + m_index_1++; + m_index_2= VIEW_MUTEX; + m_index_3= 1; + } + + inline void next_view(void) + { + m_index_2++; + m_index_3= 1; + } +}; + +/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_THREAD_BY_EVENT_NAME. */ +class table_events_waits_summary_by_thread_by_event_name + : public PFS_readonly_table +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_events_waits_summary_by_thread_by_event_name(); + +public: + ~table_events_waits_summary_by_thread_by_event_name() + {} + +protected: + void make_instr_row(PFS_thread *thread, PFS_instr_class *klass, + PFS_single_stat_chain *stat); + void make_mutex_row(PFS_thread *thread, PFS_mutex_class *klass); + void make_rwlock_row(PFS_thread *thread, PFS_rwlock_class *klass); + void make_cond_row(PFS_thread *thread, PFS_cond_class *klass); + void make_file_row(PFS_thread *thread, PFS_file_class *klass); + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_events_waits_summary_by_thread_by_event_name m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + pos_events_waits_summary_by_thread_by_event_name m_pos; + /** Next position. */ + pos_events_waits_summary_by_thread_by_event_name m_next_pos; +}; + +/** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME. */ +struct row_events_waits_summary_by_event_name +{ + /** Column EVENT_NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column COUNT_STAR. */ + ulonglong m_count; + /** Column SUM_TIMER_WAIT. */ + ulonglong m_sum; + /** Column MIN_TIMER_WAIT. */ + ulonglong m_min; + /** Column AVG_TIMER_WAIT. */ + ulonglong m_avg; + /** Column MAX_TIMER_WAIT. */ + ulonglong m_max; +}; + +/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_EVENT_NAME. */ +class table_events_waits_summary_by_event_name : public table_all_instr_class +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + +protected: + virtual void make_instr_row(PFS_instr_class *klass); + + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_events_waits_summary_by_event_name(); + +public: + ~table_events_waits_summary_by_event_name() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_events_waits_summary_by_event_name m_row; +}; + +/** A row of PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */ +struct row_events_waits_summary_by_instance +{ + /** Column EVENT_NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column OBJECT_INSTANCE_BEGIN. */ + intptr m_object_instance_addr; + /** Column COUNT_STAR. */ + ulonglong m_count; + /** Column SUM_TIMER_WAIT. */ + ulonglong m_sum; + /** Column MIN_TIMER_WAIT. */ + ulonglong m_min; + /** Column AVG_TIMER_WAIT. */ + ulonglong m_avg; + /** Column MAX_TIMER_WAIT. */ + ulonglong m_max; +}; + +/** Table PERFORMANCE_SCHEMA.EVENTS_WAITS_SUMMARY_BY_INSTANCE. */ +class table_events_waits_summary_by_instance : public table_all_instr +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + +protected: + void make_instr_row(PFS_instr *pfs, PFS_instr_class *klass, + const void *object_instance_begin); + virtual void make_mutex_row(PFS_mutex *pfs); + virtual void make_rwlock_row(PFS_rwlock *pfs); + virtual void make_cond_row(PFS_cond *pfs); + virtual void make_file_row(PFS_file *pfs); + + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_events_waits_summary_by_instance(); + +public: + ~table_events_waits_summary_by_instance() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_events_waits_summary_by_instance m_row; + /** True is the current row exists. */ + bool m_row_exists; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_file_instances.cc b/storage/perfschema/table_file_instances.cc new file mode 100644 index 00000000000..b6bc7ecbcf3 --- /dev/null +++ b/storage/perfschema/table_file_instances.cc @@ -0,0 +1,180 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_file_instances.cc + Table FILE_INSTANCES (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_instr.h" +#include "pfs_column_types.h" +#include "pfs_column_values.h" +#include "table_file_instances.h" +#include "pfs_global.h" + +THR_LOCK table_file_instances::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("FILE_NAME") }, + { C_STRING_WITH_LEN("varchar(512)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OPEN_COUNT") }, + { C_STRING_WITH_LEN("int(10)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_file_instances::m_field_def= +{ 3, field_types }; + +PFS_engine_table_share +table_file_instances::m_share= +{ + { C_STRING_WITH_LEN("FILE_INSTANCES") }, + &pfs_readonly_acl, + &table_file_instances::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + 1000, /* records */ + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_file_instances::create(void) +{ + return new table_file_instances(); +} + +table_file_instances::table_file_instances() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(0), m_next_pos(0) +{} + +void table_file_instances::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_file_instances::rnd_next(void) +{ + PFS_file *pfs; + + for (m_pos.set_at(&m_next_pos); + m_pos.m_index < file_max; + m_pos.next()) + { + pfs= &file_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_file_instances::rnd_pos(const void *pos) +{ + PFS_file *pfs; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index < file_max); + pfs= &file_array[m_pos.m_index]; + + if (! pfs->m_lock.is_populated()) + return HA_ERR_RECORD_DELETED; + + make_row(pfs); + return 0; +} + +void table_file_instances::make_row(PFS_file *pfs) +{ + pfs_lock lock; + PFS_file_class *safe_class; + + m_row_exists= false; + + /* Protect this reader against a file delete */ + pfs->m_lock.begin_optimistic_lock(&lock); + + safe_class= sanitize_file_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + m_row.m_filename= pfs->m_filename; + m_row.m_filename_length= pfs->m_filename_length; + m_row.m_event_name= safe_class->m_name; + m_row.m_event_name_length= safe_class->m_name_length; + m_row.m_open_count= pfs->m_file_stat.m_open_count; + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_file_instances::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* FILENAME */ + set_field_varchar_utf8(f, m_row.m_filename, m_row.m_filename_length); + break; + case 1: /* EVENT_NAME */ + set_field_varchar_utf8(f, m_row.m_event_name, + m_row.m_event_name_length); + break; + case 2: /* OPEN_COUNT */ + set_field_ulong(f, m_row.m_open_count); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_file_instances.h b/storage/perfschema/table_file_instances.h new file mode 100644 index 00000000000..fb5298f37b3 --- /dev/null +++ b/storage/perfschema/table_file_instances.h @@ -0,0 +1,90 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_FILE_INSTANCES_H +#define TABLE_FILE_INSTANCES_H + +/** + @file storage/perfschema/table_file_instances.h + Table FILE_INSTANCES (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.FILE_INSTANCES. */ +struct row_file_instances +{ + /** Column FILE_NAME. */ + const char *m_filename; + /** Length in bytes of @c m_filename. */ + uint m_filename_length; + /** Column EVENT_NAME. */ + const char *m_event_name; + /** Length in bytes of @c m_event_name. */ + uint m_event_name_length; + /** Column OPEN_COUNT. */ + uint m_open_count; +}; + +/** Table PERFORMANCE_SCHEMA.FILE_INSTANCES. */ +class table_file_instances : public PFS_readonly_table +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +private: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_file_instances(); + +public: + ~table_file_instances() + {} + +private: + void make_row(PFS_file *pfs); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_file_instances m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_file_summary.cc b/storage/perfschema/table_file_summary.cc new file mode 100644 index 00000000000..0db4e08625a --- /dev/null +++ b/storage/perfschema/table_file_summary.cc @@ -0,0 +1,371 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_file_summary.cc + Table FILE_SUMMARY_BY_xxx (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_instr_class.h" +#include "pfs_column_types.h" +#include "pfs_column_values.h" +#include "table_file_summary.h" +#include "pfs_global.h" + +THR_LOCK table_file_summary_by_event_name::m_table_lock; + +static const TABLE_FIELD_TYPE fs_by_event_name_field_types[]= +{ + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_READ") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_WRITE") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_file_summary_by_event_name::m_field_def= +{ 5, fs_by_event_name_field_types }; + +PFS_engine_table_share +table_file_summary_by_event_name::m_share= +{ + { C_STRING_WITH_LEN("FILE_SUMMARY_BY_EVENT_NAME") }, + &pfs_truncatable_acl, + &table_file_summary_by_event_name::create, + NULL, /* write_row */ + table_file_summary_by_event_name::delete_all_rows, + 1000, /* records */ + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_file_summary_by_event_name::create(void) +{ + return new table_file_summary_by_event_name(); +} + +int table_file_summary_by_event_name::delete_all_rows(void) +{ + reset_file_class_io(); + return 0; +} + +table_file_summary_by_event_name::table_file_summary_by_event_name() + : PFS_readonly_table(&m_share, &m_pos), + m_pos(1), m_next_pos(1) +{} + +void table_file_summary_by_event_name::reset_position(void) +{ + m_pos.m_index= 1; + m_next_pos.m_index= 1; +} + +int table_file_summary_by_event_name::rnd_next(void) +{ + PFS_file_class *file_class; + + m_pos.set_at(&m_next_pos); + + file_class= find_file_class(m_pos.m_index); + if (file_class) + { + make_row(file_class); + m_next_pos.set_after(&m_pos); + return 0; + } + + return HA_ERR_END_OF_FILE; +} + +int table_file_summary_by_event_name::rnd_pos(const void *pos) +{ + PFS_file_class *file_class; + + set_position(pos); + + file_class= find_file_class(m_pos.m_index); + if (file_class) + { + make_row(file_class); + return 0; + } + + return HA_ERR_RECORD_DELETED; +} + +/** + Build a row. + @param klass the file class the cursor is reading +*/ +void table_file_summary_by_event_name::make_row(PFS_file_class *klass) +{ + m_row.m_name= &klass->m_name[0]; + m_row.m_name_length= klass->m_name_length; + m_row.m_file_stat= klass->m_file_stat; +} + +int table_file_summary_by_event_name::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + /* The row always exists for classes */ + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* COUNT_READ */ + set_field_ulonglong(f, m_row.m_file_stat.m_count_read); + break; + case 2: /* COUNT_WRITE */ + set_field_ulonglong(f, m_row.m_file_stat.m_count_write); + break; + case 3: /* READ_BYTES */ + set_field_ulonglong(f, m_row.m_file_stat.m_read_bytes); + break; + case 4: /* WRITE_BYTES */ + set_field_ulonglong(f, m_row.m_file_stat.m_write_bytes); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +THR_LOCK table_file_summary_by_instance::m_table_lock; + +static const TABLE_FIELD_TYPE fs_by_instance_field_types[]= +{ + { + { C_STRING_WITH_LEN("FILE_NAME") }, + { C_STRING_WITH_LEN("varchar(512)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("EVENT_NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_READ") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("COUNT_WRITE") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_READ") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("SUM_NUMBER_OF_BYTES_WRITE") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_file_summary_by_instance::m_field_def= +{ 6, fs_by_instance_field_types }; + +PFS_engine_table_share +table_file_summary_by_instance::m_share= +{ + { C_STRING_WITH_LEN("FILE_SUMMARY_BY_INSTANCE") }, + &pfs_truncatable_acl, + &table_file_summary_by_instance::create, + NULL, /* write_row */ + table_file_summary_by_instance::delete_all_rows, + 1000, /* records */ + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_file_summary_by_instance::create(void) +{ + return new table_file_summary_by_instance(); +} + +int table_file_summary_by_instance::delete_all_rows(void) +{ + reset_file_instance_io(); + return 0; +} + +table_file_summary_by_instance::table_file_summary_by_instance() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(0), m_next_pos(0) +{} + +void table_file_summary_by_instance::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_file_summary_by_instance::rnd_next(void) +{ + PFS_file *pfs; + + for (m_pos.set_at(&m_next_pos); + m_pos.m_index < file_max; + m_pos.next()) + { + pfs= &file_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_file_summary_by_instance::rnd_pos(const void *pos) +{ + PFS_file *pfs; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index < file_max); + pfs= &file_array[m_pos.m_index]; + + if (! pfs->m_lock.is_populated()) + return HA_ERR_RECORD_DELETED; + + make_row(pfs); + return 0; +} + +/** + Build a row. + @param pfs the file the cursor is reading +*/ +void table_file_summary_by_instance::make_row(PFS_file *pfs) +{ + pfs_lock lock; + PFS_file_class *safe_class; + + m_row_exists= false; + + /* Protect this reader against a file delete */ + pfs->m_lock.begin_optimistic_lock(&lock); + + safe_class= sanitize_file_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + m_row.m_filename= pfs->m_filename; + m_row.m_filename_length= pfs->m_filename_length; + m_row.m_name= safe_class->m_name; + m_row.m_name_length= safe_class->m_name_length; + m_row.m_file_stat= pfs->m_file_stat; + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_file_summary_by_instance::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* FILENAME */ + set_field_varchar_utf8(f, m_row.m_filename, m_row.m_filename_length); + break; + case 1: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 2: /* COUNT_READ */ + set_field_ulonglong(f, m_row.m_file_stat.m_count_read); + break; + case 3: /* COUNT_WRITE */ + set_field_ulonglong(f, m_row.m_file_stat.m_count_write); + break; + case 4: /* READ_BYTES */ + set_field_ulonglong(f, m_row.m_file_stat.m_read_bytes); + break; + case 5: /* WRITE_BYTES */ + set_field_ulonglong(f, m_row.m_file_stat.m_write_bytes); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_file_summary.h b/storage/perfschema/table_file_summary.h new file mode 100644 index 00000000000..e962292a725 --- /dev/null +++ b/storage/perfschema/table_file_summary.h @@ -0,0 +1,151 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_FILE_SUMMARY_H +#define TABLE_FILE_SUMMARY_H + +/** + @file storage/perfschema/table_file_summary.h + Table FILE_SUMMARY_BY_xxx (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */ +struct row_file_summary_by_event_name +{ + /** Column EVENT_NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** + Columns COUNT_READ, COUNT_WRITE, + SUM_NUMBER_OF_BYTES_READ, SUM_NUMBER_OF_BYTES_WRITE. + */ + PFS_file_stat m_file_stat; +}; + +/** Table PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_EVENT_NAME. */ +class table_file_summary_by_event_name : public PFS_readonly_table +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + void make_row(PFS_file_class *klass); + + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_file_summary_by_event_name(); + +public: + ~table_file_summary_by_event_name() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_file_summary_by_event_name m_row; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** A row of PERFORMANCE_SCHEMA.FILE_SUMMARY_BY_INSTANCE. */ +struct row_file_summary_by_instance +{ + /** Column FILE_NAME. */ + const char *m_filename; + /** Length in bytes of @c m_filename. */ + uint m_filename_length; + /** Column EVENT_NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** + Columns COUNT_READ, COUNT_WRITE, + SUM_NUMBER_OF_BYTES_READ, SUM_NUMBER_OF_BYTES_WRITE. + */ + PFS_file_stat m_file_stat; +}; + +/** Table PERFORMANCE_SCHEMA.FILE_UMMARY_BY_INSTANCE. */ +class table_file_summary_by_instance : public PFS_readonly_table +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + void make_row(PFS_file *pfs); + + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_file_summary_by_instance(); + +public: + ~table_file_summary_by_instance() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_file_summary_by_instance m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_performance_timers.cc b/storage/perfschema/table_performance_timers.cc new file mode 100644 index 00000000000..ab4e72b89fa --- /dev/null +++ b/storage/perfschema/table_performance_timers.cc @@ -0,0 +1,187 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_performance_timers.cc + Table PERFORMANCE_TIMERS (implementation). +*/ + +#include "mysql_priv.h" +#include "table_performance_timers.h" +#include "pfs_timer.h" +#include "pfs_global.h" + +THR_LOCK table_performance_timers::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("TIMER_NAME") }, + { C_STRING_WITH_LEN("enum(\'CYCLE\',\'NANOSECOND\',\'MICROSECOND\'," + "\'MILLISECOND\',\'TICK\')") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_FREQUENCY") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_RESOLUTION") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_OVERHEAD") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_performance_timers::m_field_def= +{ 4, field_types }; + +PFS_engine_table_share +table_performance_timers::m_share= +{ + { C_STRING_WITH_LEN("PERFORMANCE_TIMERS") }, + &pfs_readonly_acl, + &table_performance_timers::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + COUNT_TIMER_NAME, /* records */ + sizeof(PFS_simple_index), /* ref length */ + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_performance_timers::create(void) +{ + return new table_performance_timers(); +} + +table_performance_timers::table_performance_timers() + : PFS_readonly_table(&m_share, &m_pos), + m_row(NULL), m_pos(0), m_next_pos(0) +{ + int index; + + index= (int)TIMER_NAME_CYCLE - FIRST_TIMER_NAME; + m_data[index].m_timer_name= TIMER_NAME_CYCLE; + m_data[index].m_info= pfs_timer_info.cycles; + + index= (int)TIMER_NAME_NANOSEC - FIRST_TIMER_NAME; + m_data[index].m_timer_name= TIMER_NAME_NANOSEC; + m_data[index].m_info= pfs_timer_info.nanoseconds; + + index= (int)TIMER_NAME_MICROSEC - FIRST_TIMER_NAME; + m_data[index].m_timer_name= TIMER_NAME_MICROSEC; + m_data[index].m_info= pfs_timer_info.microseconds; + + index= (int)TIMER_NAME_MILLISEC - FIRST_TIMER_NAME; + m_data[index].m_timer_name= TIMER_NAME_MILLISEC; + m_data[index].m_info= pfs_timer_info.milliseconds; + + index= (int)TIMER_NAME_TICK - FIRST_TIMER_NAME; + m_data[index].m_timer_name= TIMER_NAME_TICK; + m_data[index].m_info= pfs_timer_info.ticks; +} + +void table_performance_timers::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_performance_timers::rnd_next(void) +{ + int result; + + m_pos.set_at(&m_next_pos); + + if (m_pos.m_index < COUNT_TIMER_NAME) + { + m_row= &m_data[m_pos.m_index]; + m_next_pos.set_after(&m_pos); + result= 0; + } + else + { + m_row= NULL; + result= HA_ERR_END_OF_FILE; + } + + return result; +} + +int table_performance_timers::rnd_pos(const void *pos) +{ + set_position(pos); + DBUG_ASSERT(m_pos.m_index < COUNT_TIMER_NAME); + m_row= &m_data[m_pos.m_index]; + return 0; +} + +int table_performance_timers::read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) +{ + Field *f; + + DBUG_ASSERT(m_row); + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 1); + buf[0]= 0; + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* TIMER_NAME */ + set_field_enum(f, m_row->m_timer_name); + break; + case 1: /* TIMER_FREQUENCY */ + if (m_row->m_info.routine != 0) + set_field_ulonglong(f, m_row->m_info.frequency); + else + f->set_null(); + break; + case 2: /* TIMER_RESOLUTION */ + if (m_row->m_info.routine != 0) + set_field_ulonglong(f, m_row->m_info.resolution); + else + f->set_null(); + break; + case 3: /* TIMER_OVERHEAD */ + if (m_row->m_info.routine != 0) + set_field_ulonglong(f, m_row->m_info.overhead); + else + f->set_null(); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_performance_timers.h b/storage/perfschema/table_performance_timers.h new file mode 100644 index 00000000000..0818a0af2fe --- /dev/null +++ b/storage/perfschema/table_performance_timers.h @@ -0,0 +1,86 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_PERFORMANCE_TIMERS_H +#define TABLE_PERFORMANCE_TIMERS_H + +/** + @file storage/perfschema/table_performance_timers.h + Table PERFORMANCE_TIMERS (declarations). +*/ + +#include +#include "pfs_column_types.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.PERFORMANCE_TIMERS. */ +struct row_performance_timers +{ + /** Column TIMER_NAME. */ + enum_timer_name m_timer_name; + /** + Columns ROUTINE (not displayed), TIMER_OVERHEAD, + TIMER_FREQUENCY, TIMER_RESOLUTION. + */ + struct my_timer_unit_info m_info; +}; + +/** Table PERFORMANCE_SCHEMA.PERFORMANCE_TIMERS. */ +class table_performance_timers : public PFS_readonly_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + +protected: + table_performance_timers(); + +public: + ~table_performance_timers() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_performance_timers *m_row; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; + row_performance_timers m_data[COUNT_TIMER_NAME]; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_processlist.cc b/storage/perfschema/table_processlist.cc new file mode 100644 index 00000000000..d0707b9df60 --- /dev/null +++ b/storage/perfschema/table_processlist.cc @@ -0,0 +1,176 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_processlist.cc + Table PROCESSLIST (implementation). +*/ + +#include "mysql_priv.h" +#include "table_processlist.h" +#include "pfs_instr_class.h" +#include "pfs_instr.h" + +THR_LOCK table_processlist::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("THREAD_ID") }, + { C_STRING_WITH_LEN("int(11)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("ID") }, + { C_STRING_WITH_LEN("int(11)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_processlist::m_field_def= +{ 3, field_types }; + +PFS_engine_table_share +table_processlist::m_share= +{ + { C_STRING_WITH_LEN("PROCESSLIST") }, + &pfs_readonly_acl, + &table_processlist::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + 1000, /* records */ + sizeof(PFS_simple_index), /* ref length */ + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_processlist::create(void) +{ + return new table_processlist(); +} + +table_processlist::table_processlist() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(0), m_next_pos(0) +{} + +void table_processlist::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_processlist::rnd_next(void) +{ + PFS_thread *pfs; + + for (m_pos.set_at(&m_next_pos); + m_pos.m_index < thread_max; + m_pos.next()) + { + pfs= &thread_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_processlist::rnd_pos(const void *pos) +{ + PFS_thread *pfs; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index < thread_max); + pfs= &thread_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + return 0; + } + + return HA_ERR_RECORD_DELETED; +} + +void table_processlist::make_row(PFS_thread *pfs) +{ + pfs_lock lock; + PFS_thread_class *safe_class; + + m_row_exists= false; + + /* Protect this reader against thread termination */ + pfs->m_lock.begin_optimistic_lock(&lock); + + safe_class= sanitize_thread_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + m_row.m_thread_internal_id= pfs->m_thread_internal_id; + m_row.m_thread_id= pfs->m_thread_id; + m_row.m_name= safe_class->m_name; + m_row.m_name_length= safe_class->m_name_length; + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_processlist::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* THREAD_ID */ + set_field_ulong(f, m_row.m_thread_internal_id); + break; + case 1: /* ID */ + set_field_ulong(f, m_row.m_thread_id); + break; + case 2: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + default: + DBUG_ASSERT(false); + } + } + } + return 0; +} + diff --git a/storage/perfschema/table_processlist.h b/storage/perfschema/table_processlist.h new file mode 100644 index 00000000000..2c6d5160f41 --- /dev/null +++ b/storage/perfschema/table_processlist.h @@ -0,0 +1,91 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_PROCESSIST_H +#define TABLE_PROCESSIST_H + +/** + @file storage/perfschema/table_processlist.h + Table PROCESSLIST (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" + +struct PFS_thread; + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.PROCESSLIST. */ +struct row_processlist +{ + /** Column THREAD_ID. */ + ulong m_thread_internal_id; + /** Column ID. */ + ulong m_thread_id; + /** Column NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; +}; + +/** Table PERFORMANCE_SCHEMA.PROCESSLIST. */ +class table_processlist : public PFS_readonly_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + +protected: + table_processlist(); + +public: + ~table_processlist() + {} + +private: + void make_row(PFS_thread *pfs); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_processlist m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_setup_consumers.cc b/storage/perfschema/table_setup_consumers.cc new file mode 100644 index 00000000000..f23dca8a675 --- /dev/null +++ b/storage/perfschema/table_setup_consumers.cc @@ -0,0 +1,211 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_setup_consumers.cc + Table SETUP_CONSUMERS (implementation). +*/ + +#include "mysql_priv.h" +#include "table_setup_consumers.h" +#include "pfs_instr.h" +#include "pfs_events_waits.h" + +#define COUNT_SETUP_CONSUMERS 8 +static row_setup_consumers all_setup_consumers_data[COUNT_SETUP_CONSUMERS]= +{ + { + { C_STRING_WITH_LEN("events_waits_current") }, + &flag_events_waits_current + }, + { + { C_STRING_WITH_LEN("events_waits_history") }, + &flag_events_waits_history + }, + { + { C_STRING_WITH_LEN("events_waits_history_long") }, + &flag_events_waits_history_long + }, + { + { C_STRING_WITH_LEN("events_waits_summary_by_thread_by_event_name") }, + &flag_events_waits_summary_by_thread_by_event_name + }, + { + { C_STRING_WITH_LEN("events_waits_summary_by_event_name") }, + &flag_events_waits_summary_by_event_name + }, + { + { C_STRING_WITH_LEN("events_waits_summary_by_instance") }, + &flag_events_waits_summary_by_instance + }, + { + { C_STRING_WITH_LEN("file_summary_by_event_name") }, + &flag_file_summary_by_event_name + }, + { + { C_STRING_WITH_LEN("file_summary_by_instance") }, + &flag_file_summary_by_instance + } +}; + +THR_LOCK table_setup_consumers::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("ENABLED") }, + { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_setup_consumers::m_field_def= +{ 2, field_types }; + +PFS_engine_table_share +table_setup_consumers::m_share= +{ + { C_STRING_WITH_LEN("SETUP_CONSUMERS") }, + &pfs_updatable_acl, + &table_setup_consumers::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + COUNT_SETUP_CONSUMERS, /* records */ + sizeof(PFS_simple_index), /* ref length */ + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_setup_consumers::create(void) +{ + return new table_setup_consumers(); +} + +table_setup_consumers::table_setup_consumers() + : PFS_engine_table(&m_share, &m_pos), + m_row(NULL), m_pos(0), m_next_pos(0) +{} + +void table_setup_consumers::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_setup_consumers::rnd_next(void) +{ + int result; + + m_pos.set_at(&m_next_pos); + + if (m_pos.m_index < COUNT_SETUP_CONSUMERS) + { + m_row= &all_setup_consumers_data[m_pos.m_index]; + m_next_pos.set_after(&m_pos); + result= 0; + } + else + { + m_row= NULL; + result= HA_ERR_END_OF_FILE; + } + + return result; +} + +int table_setup_consumers::rnd_pos(const void *pos) +{ + set_position(pos); + DBUG_ASSERT(m_pos.m_index < COUNT_SETUP_CONSUMERS); + m_row= &all_setup_consumers_data[m_pos.m_index]; + return 0; +} + +int table_setup_consumers::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + DBUG_ASSERT(m_row); + + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row->m_name.str, m_row->m_name.length); + break; + case 1: /* ENABLED */ + set_field_enum(f, (*m_row->m_enabled_ptr) ? ENUM_YES : ENUM_NO); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +int table_setup_consumers::update_row_values(TABLE *table, + const unsigned char *, + unsigned char *, + Field **fields) +{ + Field *f; + enum_yes_no value; + + DBUG_ASSERT(m_row); + + for (; (f= *fields) ; fields++) + { + if (bitmap_is_set(table->write_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + return HA_ERR_WRONG_COMMAND; + case 1: /* ENABLED */ + { + value= (enum_yes_no) get_field_enum(f); + *m_row->m_enabled_ptr= (value == ENUM_YES) ? true : false; + break; + } + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + + diff --git a/storage/perfschema/table_setup_consumers.h b/storage/perfschema/table_setup_consumers.h new file mode 100644 index 00000000000..f54f69fcef5 --- /dev/null +++ b/storage/perfschema/table_setup_consumers.h @@ -0,0 +1,85 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_SETUP_CONSUMERS_H +#define TABLE_SETUP_CONSUMERS_H + +/** + @file storage/perfschema/table_setup_consumers.h + Table SETUP_CONSUMERS (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.SETUP_CONSUMERS. */ +struct row_setup_consumers +{ + /** Column NAME. */ + LEX_STRING m_name; + /** Column ENABLED. */ + bool *m_enabled_ptr; +}; + +/** Table PERFORMANCE_SCHEMA.SETUP_CONSUMERS. */ +class table_setup_consumers : public PFS_engine_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + virtual int update_row_values(TABLE *table, + const unsigned char *old_buf, + unsigned char *new_buf, + Field **fields); + + table_setup_consumers(); + +public: + ~table_setup_consumers() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_setup_consumers *m_row; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_setup_instruments.cc b/storage/perfschema/table_setup_instruments.cc new file mode 100644 index 00000000000..6756e780d78 --- /dev/null +++ b/storage/perfschema/table_setup_instruments.cc @@ -0,0 +1,276 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_setup_instruments.cc + Table SETUP_INSTRUMENTS (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_instr_class.h" +#include "pfs_column_types.h" +#include "pfs_column_values.h" +#include "table_setup_instruments.h" +#include "pfs_global.h" + +THR_LOCK table_setup_instruments::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("ENABLED") }, + { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMED") }, + { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_setup_instruments::m_field_def= +{ 3, field_types }; + +PFS_engine_table_share +table_setup_instruments::m_share= +{ + { C_STRING_WITH_LEN("SETUP_INSTRUMENTS") }, + &pfs_updatable_acl, + &table_setup_instruments::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + 1000, /* records */ + sizeof(pos_setup_instruments), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_setup_instruments::create(void) +{ + return new table_setup_instruments(); +} + +table_setup_instruments::table_setup_instruments() + : PFS_engine_table(&m_share, &m_pos), + m_pos(), m_next_pos() +{} + +void table_setup_instruments::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_setup_instruments::rnd_next(void) +{ + PFS_mutex_class *mutex_class; + PFS_rwlock_class *rwlock_class; + PFS_cond_class *cond_class; + PFS_file_class *file_class; + + for (m_pos.set_at(&m_next_pos); + m_pos.has_more_view(); + m_pos.next_view()) + { + switch (m_pos.m_index_1) { + case pos_setup_instruments::VIEW_MUTEX: + mutex_class= find_mutex_class(m_pos.m_index_2); + if (mutex_class) + { + make_row(mutex_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_setup_instruments::VIEW_RWLOCK: + rwlock_class= find_rwlock_class(m_pos.m_index_2); + if (rwlock_class) + { + make_row(rwlock_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_setup_instruments::VIEW_COND: + cond_class= find_cond_class(m_pos.m_index_2); + if (cond_class) + { + make_row(cond_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + case pos_setup_instruments::VIEW_THREAD: + /* Reserved for WL#4674, PERFORMANCE_SCHEMA Setup For Actors. */ + break; + case pos_setup_instruments::VIEW_FILE: + file_class= find_file_class(m_pos.m_index_2); + if (file_class) + { + make_row(file_class); + m_next_pos.set_after(&m_pos); + return 0; + } + break; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_setup_instruments::rnd_pos(const void *pos) +{ + PFS_mutex_class *mutex_class; + PFS_rwlock_class *rwlock_class; + PFS_cond_class *cond_class; + PFS_file_class *file_class; + + set_position(pos); + + switch (m_pos.m_index_1) { + case pos_setup_instruments::VIEW_MUTEX: + mutex_class= find_mutex_class(m_pos.m_index_2); + if (mutex_class) + { + make_row(mutex_class); + return 0; + } + break; + case pos_setup_instruments::VIEW_RWLOCK: + rwlock_class= find_rwlock_class(m_pos.m_index_2); + if (rwlock_class) + { + make_row(rwlock_class); + return 0; + } + break; + case pos_setup_instruments::VIEW_COND: + cond_class= find_cond_class(m_pos.m_index_2); + if (cond_class) + { + make_row(cond_class); + return 0; + } + break; + case pos_setup_instruments::VIEW_THREAD: + /* Reserved for WL#4674, PERFORMANCE_SCHEMA Setup For Actors. */ + break; + case pos_setup_instruments::VIEW_FILE: + file_class= find_file_class(m_pos.m_index_2); + if (file_class) + { + make_row(file_class); + return 0; + } + break; + } + + return HA_ERR_RECORD_DELETED; +} + +void table_setup_instruments::make_row(PFS_instr_class *klass) +{ + m_row.m_name= &klass->m_name[0]; + m_row.m_name_length= klass->m_name_length; + m_row.m_enabled_ptr= &klass->m_enabled; + m_row.m_timed_ptr= &klass->m_timed; +} + +int table_setup_instruments::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + DBUG_ASSERT(table->s->null_bytes == 0); + + /* + The row always exist, the instrument classes + are static and never disappear. + */ + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* ENABLED */ + set_field_enum(f, (*m_row.m_enabled_ptr) ? ENUM_YES : ENUM_NO); + break; + case 2: /* TIMED */ + if (m_row.m_timed_ptr) + set_field_enum(f, (*m_row.m_timed_ptr) ? ENUM_YES : ENUM_NO); + else + set_field_enum(f, ENUM_NO); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +int table_setup_instruments::update_row_values(TABLE *table, + const unsigned char *, + unsigned char *, + Field **fields) +{ + Field *f; + enum_yes_no value; + + for (; (f= *fields) ; fields++) + { + if (bitmap_is_set(table->write_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + return HA_ERR_WRONG_COMMAND; + case 1: /* ENABLED */ + value= (enum_yes_no) get_field_enum(f); + *m_row.m_enabled_ptr= (value == ENUM_YES) ? true : false; + break; + case 2: /* TIMED */ + if (m_row.m_timed_ptr) + { + value= (enum_yes_no) get_field_enum(f); + *m_row.m_timed_ptr= (value == ENUM_YES) ? true : false; + } + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_setup_instruments.h b/storage/perfschema/table_setup_instruments.h new file mode 100644 index 00000000000..549fe4fa5f9 --- /dev/null +++ b/storage/perfschema/table_setup_instruments.h @@ -0,0 +1,121 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_SETUP_INSTRUMENTS_H +#define TABLE_SETUP_INSTRUMENTS_H + +/** + @file storage/perfschema/table_setup_instruments.h + Table SETUP_INSTRUMENTS (declarations). +*/ + +#include "pfs_instr_class.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.SETUP_INSTRUMENTS. */ +struct row_setup_instruments +{ + /** Column NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column ENABLED. */ + bool *m_enabled_ptr; + /** Column TIMED. */ + bool *m_timed_ptr; +}; + +/** Position of a cursor on PERFORMANCE_SCHEMA.SETUP_INSTRUMENTS. */ +struct pos_setup_instruments : public PFS_double_index +{ + static const uint VIEW_MUTEX= 1; + static const uint VIEW_RWLOCK= 2; + static const uint VIEW_COND= 3; + /** Reverved for WL#4674, PERFORMANCE_SCHEMA Setup For Actors. */ + static const uint VIEW_THREAD= 4; + static const uint VIEW_FILE= 5; + + pos_setup_instruments() + : PFS_double_index(VIEW_MUTEX, 1) + {} + + inline void reset(void) + { + m_index_1= VIEW_MUTEX; + m_index_2= 1; + } + + inline bool has_more_view(void) + { return (m_index_1 <= VIEW_FILE); } + + inline void next_view(void) + { + m_index_1++; + m_index_2= 1; + } +}; + +/** Table PERFORMANCE_SCHEMA.SETUP_INSTRUMENTS. */ +class table_setup_instruments : public PFS_engine_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + virtual int update_row_values(TABLE *table, + const unsigned char *old_buf, + unsigned char *new_buf, + Field **fields); + + table_setup_instruments(); + +public: + ~table_setup_instruments() + {} + +private: + void make_row(PFS_instr_class *klass); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_setup_instruments m_row; + /** Current position. */ + pos_setup_instruments m_pos; + /** Next position. */ + pos_setup_instruments m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_setup_objects.cc b/storage/perfschema/table_setup_objects.cc new file mode 100644 index 00000000000..53a80782da0 --- /dev/null +++ b/storage/perfschema/table_setup_objects.cc @@ -0,0 +1,280 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_setup_objects.cc + Table SETUP_OBJECTS (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_instr_class.h" +#include "pfs_column_types.h" +#include "pfs_column_values.h" +#include "table_setup_objects.h" +#include "pfs_global.h" + +THR_LOCK table_setup_objects::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("OBJECT_TYPE") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_SCHEMA") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_NAME") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("ENABLED") }, + { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMED") }, + { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("AGGREGATED") }, + { C_STRING_WITH_LEN("enum(\'YES\',\'NO\')") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_setup_objects::m_field_def= +{ 6, field_types }; + +PFS_engine_table_share +table_setup_objects::m_share= +{ + { C_STRING_WITH_LEN("SETUP_OBJECTS") }, + &pfs_editable_acl, + &table_setup_objects::create, + table_setup_objects::write_row, + table_setup_objects::delete_all_rows, + 1000, /* records */ + sizeof(pos_setup_objects), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_setup_objects::create(void) +{ + return new table_setup_objects(); +} + +int table_setup_objects::write_row(TABLE *table, unsigned char *buf, + Field **fields) +{ + /* Not implemented */ + return HA_ERR_WRONG_COMMAND; +} + +int table_setup_objects::delete_all_rows(void) +{ + /* Not implemented */ + return HA_ERR_WRONG_COMMAND; +} + +table_setup_objects::table_setup_objects() + : PFS_engine_table(&m_share, &m_pos), + m_row_exists(false), m_pos(), m_next_pos() +{} + +void table_setup_objects::reset_position(void) +{ + m_pos.reset(); + m_next_pos.reset(); +} + +int table_setup_objects::rnd_next(void) +{ + PFS_table_share *table_share; + + for (m_pos.set_at(&m_next_pos); + m_pos.has_more_view(); + m_pos.next_view()) + { + switch (m_pos.m_index_1) { + case pos_setup_objects::VIEW_TABLE: + for ( ; m_pos.m_index_2 < table_share_max; m_pos.m_index_2++) + { + table_share= &table_share_array[m_pos.m_index_2]; + if (table_share->m_lock.is_populated()) + { + make_row(table_share); + m_next_pos.set_after(&m_pos); + return 0; + } + } + break; + case pos_setup_objects::VIEW_EVENT: + case pos_setup_objects::VIEW_PROCEDURE: + case pos_setup_objects::VIEW_FUNCTION: + default: + break; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_setup_objects::rnd_pos(const void *pos) +{ + PFS_table_share *share; + + set_position(pos); + + switch (m_pos.m_index_1) { + case pos_setup_objects::VIEW_TABLE: + DBUG_ASSERT(m_pos.m_index_2 < table_share_max); + share= &table_share_array[m_pos.m_index_2]; + if (share->m_lock.is_populated()) + { + make_row(share); + return 0; + } + break; + case pos_setup_objects::VIEW_EVENT: + case pos_setup_objects::VIEW_PROCEDURE: + case pos_setup_objects::VIEW_FUNCTION: + default: + break; + } + + return HA_ERR_RECORD_DELETED; +} + +void table_setup_objects::make_row(PFS_table_share *share) +{ + pfs_lock lock; + + m_row_exists= false; + if (share == NULL) + return; + + share->m_lock.begin_optimistic_lock(&lock); + + m_row.m_schema_name= &share->m_schema_name[0]; + m_row.m_schema_name_length= share->m_schema_name_length; + m_row.m_object_name= &share->m_table_name[0]; + m_row.m_object_name_length= share->m_table_name_length; + m_row.m_enabled_ptr= &share->m_enabled; + m_row.m_timed_ptr= &share->m_timed; + m_row.m_aggregated_ptr= &share->m_aggregated; + + if (share->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_setup_objects::read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 1); + buf[0]= 0; + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* OBJECT_TYPE */ + set_field_varchar_utf8(f, "TABLE", 5); + break; + case 1: /* OBJECT_SCHEMA */ + set_field_varchar_utf8(f, m_row.m_schema_name, + m_row.m_schema_name_length); + break; + case 2: /* OBJECT_NAME */ + set_field_varchar_utf8(f, m_row.m_object_name, + m_row.m_object_name_length); + break; + case 3: /* ENABLED */ + set_field_enum(f, (*m_row.m_enabled_ptr) ? ENUM_YES : ENUM_NO); + break; + case 4: /* TIMED */ + set_field_enum(f, (*m_row.m_timed_ptr) ? ENUM_YES : ENUM_NO); + break; + case 5: /* AGGREGATED */ + set_field_enum(f, (*m_row.m_aggregated_ptr) ? ENUM_YES : ENUM_NO); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +int table_setup_objects::update_row_values(TABLE *table, + const unsigned char *, + unsigned char *, + Field **fields) +{ + Field *f; + enum_yes_no value; + + for (; (f= *fields) ; fields++) + { + if (bitmap_is_set(table->write_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* OBJECT_TYPE */ + case 1: /* OBJECT_SCHEMA */ + case 2: /* OBJECT_NAME */ + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + return HA_ERR_WRONG_COMMAND; + case 3: /* ENABLED */ + value= (enum_yes_no) get_field_enum(f); + *m_row.m_enabled_ptr= (value == ENUM_YES) ? true : false; + break; + case 4: /* TIMED */ + value= (enum_yes_no) get_field_enum(f); + *m_row.m_timed_ptr= (value == ENUM_YES) ? true : false; + break; + case 5: /* AGGREGATED */ + value= (enum_yes_no) get_field_enum(f); + *m_row.m_aggregated_ptr= (value == ENUM_YES) ? true : false; + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_setup_objects.h b/storage/perfschema/table_setup_objects.h new file mode 100644 index 00000000000..994e12016a6 --- /dev/null +++ b/storage/perfschema/table_setup_objects.h @@ -0,0 +1,125 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_SETUP_OBJECTS_H +#define TABLE_SETUP_OBJECTS_H + +/** + @file storage/perfschema/table_setup_objects.h + Table SETUP_OBJECTS (declarations). +*/ + +#include "pfs_instr_class.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of PERFORMANCE_SCHEMA.SETUP_OBJECTS. */ +struct row_setup_objects +{ + /** Column SCHEMA_NAME. */ + const char *m_schema_name; + /** Length in bytes of @c m_schema_name. */ + uint m_schema_name_length; + /** Column OBJECT_NAME. */ + const char *m_object_name; + /** Length in bytes of @c m_object_name. */ + uint m_object_name_length; + /** Column ENABLED. */ + bool *m_enabled_ptr; + /** Column TIMED. */ + bool *m_timed_ptr; + /** Column AGGREGATED. */ + bool *m_aggregated_ptr; +}; + +/** Position of a cursor on PERFORMANCE_SCHEMA.SETUP_OBJECTS. */ +struct pos_setup_objects : public PFS_double_index, + public PFS_object_view_constants +{ + pos_setup_objects() + : PFS_double_index(VIEW_TABLE, 0) + {} + + inline void reset(void) + { + m_index_1= VIEW_TABLE; + m_index_2= 0; + } + + inline bool has_more_view(void) + { return (m_index_1 <= VIEW_FUNCTION); } + + inline void next_view(void) + { + m_index_1++; + m_index_2= 0; + } +}; + +/** Table PERFORMANCE_SCHEMA.SETUP_OBJECTS. */ +class table_setup_objects : public PFS_engine_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + static int write_row(TABLE *table, unsigned char *buf, Field **fields); + static int delete_all_rows(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + virtual int update_row_values(TABLE *table, + const unsigned char *old_buf, + unsigned char *new_buf, + Field **fields); + + table_setup_objects(); + +public: + ~table_setup_objects() + {} + +private: + void make_row(PFS_table_share *share); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_setup_objects m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + pos_setup_objects m_pos; + /** Next position. */ + pos_setup_objects m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_setup_timers.cc b/storage/perfschema/table_setup_timers.cc new file mode 100644 index 00000000000..2d57adb3a85 --- /dev/null +++ b/storage/perfschema/table_setup_timers.cc @@ -0,0 +1,183 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_setup_timers.cc + Table SETUP_TIMERS (implementation). +*/ + +#include "mysql_priv.h" +#include "table_setup_timers.h" +#include "pfs_column_values.h" +#include "pfs_timer.h" + +#define COUNT_SETUP_TIMERS 1 +static row_setup_timers all_setup_timers_data[COUNT_SETUP_TIMERS]= +{ + { + { C_STRING_WITH_LEN("wait") }, + &wait_timer + } +}; + +THR_LOCK table_setup_timers::m_table_lock; + +static const TABLE_FIELD_TYPE field_types[]= +{ + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(64)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("TIMER_NAME") }, + { C_STRING_WITH_LEN("enum(\'CYCLE\',\'NANOSECOND\',\'MICROSECOND\'," + "\'MILLISECOND\',\'TICK\')") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_setup_timers::m_field_def= +{ 2, field_types }; + +PFS_engine_table_share +table_setup_timers::m_share= +{ + { C_STRING_WITH_LEN("SETUP_TIMERS") }, + &pfs_updatable_acl, + &table_setup_timers::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + COUNT_SETUP_TIMERS, + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_setup_timers::create(void) +{ + return new table_setup_timers(); +} + +table_setup_timers::table_setup_timers() + : PFS_engine_table(&m_share, &m_pos), + m_row(NULL), m_pos(0), m_next_pos(0) +{} + +void table_setup_timers::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_setup_timers::rnd_next(void) +{ + int result; + + m_pos.set_at(&m_next_pos); + + if (m_pos.m_index < COUNT_SETUP_TIMERS) + { + m_row= &all_setup_timers_data[m_pos.m_index]; + m_next_pos.set_after(&m_pos); + result= 0; + } + else + { + m_row= NULL; + result= HA_ERR_END_OF_FILE; + } + + return result; +} + +int table_setup_timers::rnd_pos(const void *pos) +{ + set_position(pos); + DBUG_ASSERT(m_pos.m_index < COUNT_SETUP_TIMERS); + m_row= &all_setup_timers_data[m_pos.m_index]; + return 0; +} + +int table_setup_timers::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + DBUG_ASSERT(m_row); + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row->m_name.str, m_row->m_name.length); + break; + case 1: /* TIMER_NAME */ + set_field_enum(f, *(m_row->m_timer_name_ptr)); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +int table_setup_timers::update_row_values(TABLE *table, + const unsigned char *, + unsigned char *, + Field **fields) +{ + Field *f; + longlong value; + + DBUG_ASSERT(m_row); + + for (; (f= *fields) ; fields++) + { + if (bitmap_is_set(table->write_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + my_error(ER_WRONG_PERFSCHEMA_USAGE, MYF(0)); + return HA_ERR_WRONG_COMMAND; + case 1: /* TIMER_NAME */ + value= get_field_enum(f); + if ((value >= FIRST_TIMER_NAME) && (value <= LAST_TIMER_NAME)) + *(m_row->m_timer_name_ptr)= (enum_timer_name) value; + else + return HA_ERR_WRONG_COMMAND; + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_setup_timers.h b/storage/perfschema/table_setup_timers.h new file mode 100644 index 00000000000..96af76ae05c --- /dev/null +++ b/storage/perfschema/table_setup_timers.h @@ -0,0 +1,85 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_SETUP_TIMERS_H +#define TABLE_SETUP_TIMERS_H + +/** + @file storage/perfschema/table_setup_timers.h + Table SETUP_TIMERS (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of table PERFORMANCE_SCHEMA.SETUP_TIMERS. */ +struct row_setup_timers +{ + /** Column NAME. */ + LEX_STRING m_name; + /** Column TIMER_NAME. */ + enum_timer_name *m_timer_name_ptr; +}; + +/** Table PERFORMANCE_SCHEMA.SETUP_TIMERS. */ +class table_setup_timers : public PFS_engine_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +protected: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + virtual int update_row_values(TABLE *table, + const unsigned char *old_buf, + unsigned char *new_buf, + Field **fields); + + table_setup_timers(); + +public: + ~table_setup_timers() + {} + +private: + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_setup_timers *m_row; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/table_sync_instances.cc b/storage/perfschema/table_sync_instances.cc new file mode 100644 index 00000000000..a783b5b817b --- /dev/null +++ b/storage/perfschema/table_sync_instances.cc @@ -0,0 +1,507 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/** + @file storage/perfschema/table_sync_instances.cc + Table MUTEX_INSTANCES, RWLOCK_INSTANCES + and COND_INSTANCES (implementation). +*/ + +#include "mysql_priv.h" +#include "pfs_instr.h" +#include "pfs_column_types.h" +#include "pfs_column_values.h" +#include "table_sync_instances.h" +#include "pfs_global.h" + +THR_LOCK table_mutex_instances::m_table_lock; + +static const TABLE_FIELD_TYPE mutex_field_types[]= +{ + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("LOCKED_BY_THREAD_ID") }, + { C_STRING_WITH_LEN("int(11)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_mutex_instances::m_field_def= +{ 3, mutex_field_types }; + +PFS_engine_table_share +table_mutex_instances::m_share= +{ + { C_STRING_WITH_LEN("MUTEX_INSTANCES") }, + &pfs_readonly_acl, + &table_mutex_instances::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + 1000, /* records */ + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_mutex_instances::create(void) +{ + return new table_mutex_instances(); +} + +table_mutex_instances::table_mutex_instances() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(0), m_next_pos(0) +{} + +void table_mutex_instances::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_mutex_instances::rnd_next(void) +{ + PFS_mutex *pfs; + + for (m_pos.set_at(&m_next_pos); m_pos.m_index < mutex_max; m_pos.next()) + { + pfs= &mutex_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_mutex_instances::rnd_pos(const void *pos) +{ + PFS_mutex *pfs; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index < mutex_max); + pfs= &mutex_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + return 0; + } + + return HA_ERR_RECORD_DELETED; +} + +void table_mutex_instances::make_row(PFS_mutex *pfs) +{ + pfs_lock lock; + PFS_mutex_class *safe_class; + + m_row_exists= false; + + /* Protect this reader against a mutex destroy */ + pfs->m_lock.begin_optimistic_lock(&lock); + + safe_class= sanitize_mutex_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + m_row.m_name= safe_class->m_name; + m_row.m_name_length= safe_class->m_name_length; + m_row.m_identity= pfs->m_identity; + + /* Protect this reader against a mutex unlock */ + PFS_thread *safe_owner= sanitize_thread(pfs->m_owner); + if (safe_owner) + { + m_row.m_locked_by_thread_id= safe_owner->m_thread_internal_id; + m_row.m_locked= true; + } + else + m_row.m_locked= false; + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_mutex_instances::read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 1); + buf[0]= 0; + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* OBJECT_INSTANCE */ + set_field_ulonglong(f, (intptr) m_row.m_identity); + break; + case 2: /* LOCKED_BY_THREAD_ID */ + if (m_row.m_locked) + set_field_ulong(f, m_row.m_locked_by_thread_id); + else + f->set_null(); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +THR_LOCK table_rwlock_instances::m_table_lock; + +static const TABLE_FIELD_TYPE rwlock_field_types[]= +{ + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("WRITE_LOCKED_BY_THREAD_ID") }, + { C_STRING_WITH_LEN("int(11)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("READ_LOCKED_BY_COUNT") }, + { C_STRING_WITH_LEN("int(10)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_rwlock_instances::m_field_def= +{ 4, rwlock_field_types }; + +PFS_engine_table_share +table_rwlock_instances::m_share= +{ + { C_STRING_WITH_LEN("RWLOCK_INSTANCES") }, + &pfs_readonly_acl, + &table_rwlock_instances::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + 1000, /* records */ + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_rwlock_instances::create(void) +{ + return new table_rwlock_instances(); +} + +table_rwlock_instances::table_rwlock_instances() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(0), m_next_pos(0) +{} + +void table_rwlock_instances::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_rwlock_instances::rnd_next(void) +{ + PFS_rwlock *pfs; + + for (m_pos.set_at(&m_next_pos); m_pos.m_index < rwlock_max; m_pos.next()) + { + pfs= &rwlock_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_rwlock_instances::rnd_pos(const void *pos) +{ + PFS_rwlock *pfs; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index < rwlock_max); + pfs= &rwlock_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + return 0; + } + + return HA_ERR_RECORD_DELETED; +} + +void table_rwlock_instances::make_row(PFS_rwlock *pfs) +{ + pfs_lock lock; + PFS_rwlock_class *safe_class; + + m_row_exists= false; + + /* Protect this reader against a rwlock destroy */ + pfs->m_lock.begin_optimistic_lock(&lock); + + safe_class= sanitize_rwlock_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + m_row.m_name= safe_class->m_name; + m_row.m_name_length= safe_class->m_name_length; + m_row.m_identity= pfs->m_identity; + + /* Protect this reader against a rwlock unlock in the writer */ + PFS_thread *safe_writer= sanitize_thread(pfs->m_writer); + if (safe_writer) + { + m_row.m_write_locked_by_thread_id= safe_writer->m_thread_internal_id; + m_row.m_readers= 0; + m_row.m_write_locked= true; + } + else + { + m_row.m_readers= pfs->m_readers; + m_row.m_write_locked= false; + } + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_rwlock_instances::read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 1); + buf[0]= 0; + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* OBJECT_INSTANCE */ + set_field_ulonglong(f, (intptr) m_row.m_identity); + break; + case 2: /* WRITE_LOCKED_BY_THREAD_ID */ + if (m_row.m_write_locked) + set_field_ulong(f, m_row.m_write_locked_by_thread_id); + else + f->set_null(); + break; + case 3: /* READ_LOCKED_BY_COUNT */ + set_field_ulong(f, m_row.m_readers); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + +THR_LOCK table_cond_instances::m_table_lock; + +static const TABLE_FIELD_TYPE cond_field_types[]= +{ + { + { C_STRING_WITH_LEN("NAME") }, + { C_STRING_WITH_LEN("varchar(128)") }, + { NULL, 0} + }, + { + { C_STRING_WITH_LEN("OBJECT_INSTANCE_BEGIN") }, + { C_STRING_WITH_LEN("bigint(20)") }, + { NULL, 0} + } +}; + +TABLE_FIELD_DEF +table_cond_instances::m_field_def= +{ 2, cond_field_types }; + +PFS_engine_table_share +table_cond_instances::m_share= +{ + { C_STRING_WITH_LEN("COND_INSTANCES") }, + &pfs_readonly_acl, + &table_cond_instances::create, + NULL, /* write_row */ + NULL, /* delete_all_rows */ + 1000, /* records */ + sizeof(PFS_simple_index), + &m_table_lock, + &m_field_def, + false /* checked */ +}; + +PFS_engine_table* table_cond_instances::create(void) +{ + return new table_cond_instances(); +} + +table_cond_instances::table_cond_instances() + : PFS_readonly_table(&m_share, &m_pos), + m_row_exists(false), m_pos(0), m_next_pos(0) +{} + +void table_cond_instances::reset_position(void) +{ + m_pos.m_index= 0; + m_next_pos.m_index= 0; +} + +int table_cond_instances::rnd_next(void) +{ + PFS_cond *pfs; + + for (m_pos.set_at(&m_next_pos); m_pos.m_index < cond_max; m_pos.next()) + { + pfs= &cond_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + m_next_pos.set_after(&m_pos); + return 0; + } + } + + return HA_ERR_END_OF_FILE; +} + +int table_cond_instances::rnd_pos(const void *pos) +{ + PFS_cond *pfs; + + set_position(pos); + DBUG_ASSERT(m_pos.m_index < cond_max); + pfs= &cond_array[m_pos.m_index]; + if (pfs->m_lock.is_populated()) + { + make_row(pfs); + return 0; + } + + return HA_ERR_RECORD_DELETED; +} + +void table_cond_instances::make_row(PFS_cond *pfs) +{ + pfs_lock lock; + PFS_cond_class *safe_class; + + m_row_exists= false; + + /* Protect this reader against a cond destroy */ + pfs->m_lock.begin_optimistic_lock(&lock); + + safe_class= sanitize_cond_class(pfs->m_class); + if (unlikely(safe_class == NULL)) + return; + + m_row.m_name= safe_class->m_name; + m_row.m_name_length= safe_class->m_name_length; + m_row.m_identity= pfs->m_identity; + + if (pfs->m_lock.end_optimistic_lock(&lock)) + m_row_exists= true; +} + +int table_cond_instances::read_row_values(TABLE *table, + unsigned char *, + Field **fields, + bool read_all) +{ + Field *f; + + if (unlikely(! m_row_exists)) + return HA_ERR_RECORD_DELETED; + + /* Set the null bits */ + DBUG_ASSERT(table->s->null_bytes == 0); + + for (; (f= *fields) ; fields++) + { + if (read_all || bitmap_is_set(table->read_set, f->field_index)) + { + switch(f->field_index) + { + case 0: /* NAME */ + set_field_varchar_utf8(f, m_row.m_name, m_row.m_name_length); + break; + case 1: /* OBJECT_INSTANCE */ + set_field_ulonglong(f, (intptr) m_row.m_identity); + break; + default: + DBUG_ASSERT(false); + } + } + } + + return 0; +} + diff --git a/storage/perfschema/table_sync_instances.h b/storage/perfschema/table_sync_instances.h new file mode 100644 index 00000000000..a8a9cdaa071 --- /dev/null +++ b/storage/perfschema/table_sync_instances.h @@ -0,0 +1,206 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef TABLE_SYNC_INSTANCE_H +#define TABLE_SYNC_INSTANCE_H + +/** + @file storage/perfschema/table_sync_instances.h + Table MUTEX_INSTANCES, RWLOCK_INSTANCES and COND_INSTANCES (declarations). +*/ + +#include "pfs_column_types.h" +#include "pfs_engine_table.h" + +struct PFS_mutex; +struct PFS_rwlock; +struct PFS_cond; + +/** + @addtogroup Performance_schema_tables + @{ +*/ + +/** A row of table PERFORMANCE_SCHEMA.MUTEX_INSTANCES. */ +struct row_mutex_instances +{ + /** Column NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column OBJECT_INSTANCE_BEGIN. */ + const void *m_identity; + /** True if column LOCKED_BY_THREAD_ID is not null. */ + bool m_locked; + /** Column LOCKED_BY_THREAD_ID. */ + ulong m_locked_by_thread_id; +}; + +/** Table PERFORMANCE_SCHEMA.MUTEX_INSTANCES. */ +class table_mutex_instances : public PFS_readonly_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +private: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_mutex_instances(); + +public: + ~table_mutex_instances() + {} + +private: + void make_row(PFS_mutex *pfs); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_mutex_instances m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** A row of table PERFORMANCE_SCHEMA.RWLOCK_INSTANCES. */ +struct row_rwlock_instances +{ + /** Column NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column OBJECT_INSTANCE_BEGIN. */ + const void *m_identity; + /** True if column WRITE_LOCKED_BY_THREAD_ID is not null. */ + bool m_write_locked; + /** Column WRITE_LOCKED_BY_THREAD_ID. */ + ulong m_write_locked_by_thread_id; + /** Column READ_LOCKED_BY_COUNT. */ + ulong m_readers; +}; + +/** Table PERFORMANCE_SCHEMA.RWLOCK_INSTANCES. */ +class table_rwlock_instances : public PFS_readonly_table +{ +public: + /** Table share */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +private: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_rwlock_instances(); + +public: + ~table_rwlock_instances() + {} + +private: + void make_row(PFS_rwlock *pfs); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_rwlock_instances m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** A row of table PERFORMANCE_SCHEMA.COND_INSTANCES. */ +struct row_cond_instances +{ + /** Column NAME. */ + const char *m_name; + /** Length in bytes of @c m_name. */ + uint m_name_length; + /** Column OBJECT_INSTANCE_BEGIN. */ + const void *m_identity; +}; + +/** Table PERFORMANCE_SCHEMA.COND_INSTANCES. */ +class table_cond_instances : public PFS_readonly_table +{ +public: + /** Table share. */ + static PFS_engine_table_share m_share; + static PFS_engine_table* create(); + + virtual int rnd_next(); + virtual int rnd_pos(const void *pos); + virtual void reset_position(void); + +private: + virtual int read_row_values(TABLE *table, + unsigned char *buf, + Field **fields, + bool read_all); + + table_cond_instances(); + +public: + ~table_cond_instances() + {} + +private: + void make_row(PFS_cond *pfs); + + /** Table share lock. */ + static THR_LOCK m_table_lock; + /** Fields definition. */ + static TABLE_FIELD_DEF m_field_def; + + /** Current row. */ + row_cond_instances m_row; + /** True is the current row exists. */ + bool m_row_exists; + /** Current position. */ + PFS_simple_index m_pos; + /** Next position. */ + PFS_simple_index m_next_pos; +}; + +/** @} */ +#endif diff --git a/storage/perfschema/unittest/CMakeLists.txt b/storage/perfschema/unittest/CMakeLists.txt new file mode 100644 index 00000000000..01f3fbb8c98 --- /dev/null +++ b/storage/perfschema/unittest/CMakeLists.txt @@ -0,0 +1,39 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/include/mysql + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/sql + ${CMAKE_SOURCE_DIR}/extra/yassl/include + ${CMAKE_SOURCE_DIR}/unittest/mytap + ${CMAKE_SOURCE_DIR}/storage/perfschema) + +ADD_DEFINITIONS(-DMYSQL_SERVER) + +LINK_LIBRARIES(perfschema mytap mysys dbug strings) + +ADD_EXECUTABLE(pfs_instr_class-t pfs_instr_class-t.cc) + +ADD_EXECUTABLE(pfs_instr_class-oom-t pfs_instr_class-oom-t.cc) + +ADD_EXECUTABLE(pfs_instr-t pfs_instr-t.cc) + +ADD_EXECUTABLE(pfs_instr-oom-t pfs_instr-oom-t.cc) + +ADD_EXECUTABLE(pfs_timer-t pfs_timer-t.cc) + +ADD_EXECUTABLE(pfs-t pfs-t.cc) + diff --git a/storage/perfschema/unittest/Makefile.am b/storage/perfschema/unittest/Makefile.am new file mode 100644 index 00000000000..7d82753c9e5 --- /dev/null +++ b/storage/perfschema/unittest/Makefile.am @@ -0,0 +1,58 @@ +# Copyright (C) 2008-2009 Sun Microsystems, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +INCLUDES = -I$(top_builddir)/include \ + -I$(top_srcdir)/include \ + -I$(top_srcdir)/include/mysql \ + -I$(top_srcdir)/regex \ + -I$(top_srcdir)/unittest/mytap \ + -I$(top_srcdir)/sql \ + -I$(top_srcdir)/storage/perfschema + +DEFS = -DMYSQL_SERVER @DEFS@ + +TEST_CODE = $(top_builddir)/unittest/mytap/libmytap.a + +$(TEST_CODE) : + (cd $(top_builddir)/unittest/mytap; $(MAKE)) + +PROD_CODE = $(top_builddir)/storage/perfschema/libperfschema.a \ + $(top_builddir)/mysys/libmysys.a \ + $(top_builddir)/dbug/libdbug.a \ + $(top_builddir)/strings/libmystrings.a + +noinst_PROGRAMS = pfs_instr_class-t pfs_instr_class-oom-t \ + pfs_instr-t pfs_instr-oom-t pfs_timer-t pfs-t + +pfs_t_SOURCES = pfs-t.cc stub_print_error.h +pfs_t_LDADD = $(TEST_CODE) $(PROD_CODE) + +pfs_instr_class_t_SOURCES = pfs_instr_class-t.cc +pfs_instr_class_t_LDADD = $(TEST_CODE) $(PROD_CODE) + +pfs_instr_class_oom_t_SOURCES = pfs_instr_class-oom-t.cc stub_pfs_global.h +pfs_instr_class_oom_t_LDADD = $(TEST_CODE) $(PROD_CODE) + +pfs_instr_t_SOURCES = pfs_instr-t.cc +pfs_instr_t_LDADD = $(TEST_CODE) $(PROD_CODE) + +pfs_instr_oom_t_SOURCES = pfs_instr-oom-t.cc stub_pfs_global.h +pfs_instr_oom_t_LDADD = $(TEST_CODE) $(PROD_CODE) + +pfs_timer_t_SOURCES = pfs_timer-t.cc +pfs_timer_t_LDADD = $(TEST_CODE) $(PROD_CODE) + +EXTRA_DIST = conf.txt CMakeLists.txt + diff --git a/storage/perfschema/unittest/conf.txt b/storage/perfschema/unittest/conf.txt new file mode 100644 index 00000000000..a3bee9c3be5 --- /dev/null +++ b/storage/perfschema/unittest/conf.txt @@ -0,0 +1,420 @@ +# Copyright (C) 2009 Sun Microsystems, Inc +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Performance schema test configurations. +(Used internally for performance testing) + +Configuration PERFSCHEMA-COMPILED-OUT +===================================== + +Description +----------- + +Reference for timings, server built without the performance schema. + +Compiling options +----------------- + +./configure --without-perfschema + +Server start options +-------------------- + +N/A + +Configuration +------------- + +N/A + +Pre-test queries +---------------- + +select version(); + +This is just to make sure the build is not including the performance schema. + +Post-test queries +----------------- + +N/A + +Configuration PERFSCHEMA-DISABLED +================================= + +Description +----------- + +Server built with the performance schema, +but the performance schema is disabled at startup. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --disable-performance-schema + +Configuration +------------- + +N/A + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +N/A + +Configuration PERFSCHEMA-ENABLED-STANDBY +======================================== + +Description +----------- + +Server built with the performance schema. +The performance schema is enabled at startup, +but configured to not record anything. +This is a "stanby" configuration, in the sense that the DBA can add +dynamically more setup options later to get data. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --enable-performance-schema + +Configuration +------------- + +UPDATE performance_schema.SETUP_INSTRUMENTS + set enabled='NO', timed='NO'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='NO'; + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; + +Configuration PERFSCHEMA-ENABLED-CURRENT +======================================== + +Description +----------- + +Server built with the performance schema. +The performance schema is enabled at startup. +All instruments are enabled but not timed, +and only one consumer (EVENTS_WAITS_CURRENT) is set. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --enable-performance-schema + +Configuration +------------- + +UPDATE performance_schema.SETUP_INSTRUMENTS + set enabled='YES', timed='NO'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='NO'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES' where name='EVENTS_WAITS_CURRENT'; + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; + +Configuration PERFSCHEMA-ENABLED-CURRENT-CYCLE +============================================== + +Description +----------- + +Server built with the performance schema. +The performance schema is enabled at startup. +All instruments are enabled and timed, +and only one consumer (EVENTS_WAITS_CURRENT) is set. +The timer used is CYCLE. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --enable-performance-schema + +Configuration +------------- + +UPDATE performance_schema.SETUP_INSTRUMENTS + set enabled='YES', timed='YES'; + +UPDATE performance_schema.SETUP_TIMERS + set timer_name='CYCLE'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='NO'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES' where name='EVENTS_WAITS_CURRENT'; + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; + +Configuration PERFSCHEMA-ENABLED-HISTORY-CYCLE +============================================== + +Description +----------- + +Server built with the performance schema. +The performance schema is enabled at startup. +All instruments are enabled and timed, in CYCLE. +Two consumers (EVENTS_WAITS_CURRENT, EVENTS_WAITS_HISTORY) are set. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --enable-performance-schema + +Configuration +------------- + +UPDATE performance_schema.SETUP_INSTRUMENTS + set enabled='YES', timed='YES'; + +UPDATE performance_schema.SETUP_TIMERS + set timer_name='CYCLE'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='NO'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES' where name='EVENTS_WAITS_CURRENT'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES' where name='EVENTS_WAITS_HISTORY'; + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; + +Configuration PERFSCHEMA-ENABLED-HISTORY_LONG-CYCLE +=================================================== + +Description +----------- + +Server built with the performance schema. +The performance schema is enabled at startup. +All instruments are enabled and timed, in CYCLE. +Two consumers (EVENTS_WAITS_CURRENT, EVENTS_WAITS_HISTORY_LONG) are set. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --enable-performance-schema + +Configuration +------------- + +UPDATE performance_schema.SETUP_INSTRUMENTS + set enabled='YES', timed='YES'; + +UPDATE performance_schema.SETUP_TIMERS + set timer_name='CYCLE'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='NO'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES' where name='EVENTS_WAITS_CURRENT'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES' where name='EVENTS_WAITS_HISTORY_LONG'; + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; + +Configuration PERFSCHEMA-ENABLED-BIGBANG-CYCLE +============================================== + +Description +----------- + +Server built with the performance schema. +The performance schema is enabled at startup. +All instruments are enabled and timed, in CYCLE. +All possible consumers are enabled. + +Compiling options +----------------- + +./configure --with-perfschema + +Server start options +-------------------- + +./mysqld --enable-performance-schema + +Configuration +------------- + +UPDATE performance_schema.SETUP_INSTRUMENTS + set enabled='YES', timed='YES'; + +UPDATE performance_schema.SETUP_TIMERS + set timer_name='CYCLE'; + +UPDATE performance_schema.SETUP_CONSUMERS + set enabled='YES'; + +Pre-test queries +---------------- + +select version(); +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; +select * from performance_schema.PERFORMANCE_TIMERS; +select * from performance_schema.SETUP_CONSUMERS; +select * from performance_schema.SETUP_INSTRUMENTS; +select * from performance_schema.SETUP_TIMERS; + +Post-test queries +----------------- + +show engine performance_schema status; +show variables like "performance%"; +show status like "performance%"; + diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc new file mode 100644 index 00000000000..fcbaf4aeb8f --- /dev/null +++ b/storage/perfschema/unittest/pfs-t.cc @@ -0,0 +1,1201 @@ +/* Copyright (C) 2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include +#include + +#include "stub_print_error.h" + +/* test helpers, to simulate the setup */ + +void setup_thread(PSI_thread *t, bool enabled) +{ + PFS_thread *t2= (PFS_thread*) t; + t2->m_enabled= enabled; +} + +/* test helpers, to inspect data */ + +PFS_file* lookup_file_by_name(const char* name) +{ + uint i; + PFS_file *pfs; + uint len= strlen(name); + + for (i= 0; i < file_max; i++) + { + pfs= & file_array[i]; + if (pfs->m_lock.is_populated()) + { + if ((len == pfs->m_filename_length) && + (strncmp(name, pfs->m_filename, pfs->m_filename_length) == 0)) + return pfs; + } + } + + return NULL; +} + +/* tests */ + +void test_bootstrap() +{ + void *psi; + void *psi_2; + PSI_bootstrap *boot; + PFS_global_param param; + + diag("test_bootstrap"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + boot= initialize_performance_schema(& param); + ok(boot != NULL, "boot"); + ok(boot->get_interface != NULL, "boot->get_interface"); + + psi= boot->get_interface(0); + ok(psi == NULL, "no version 0"); + + psi= boot->get_interface(PSI_VERSION_1); + ok(psi != NULL, "version 1"); + + psi_2= boot->get_interface(PSI_VERSION_2); + ok(psi_2 == NULL, "version 2"); + + shutdown_performance_schema(); +} + +/* + Not a test, helper for testing pfs.cc +*/ +PSI * load_perfschema() +{ + void *psi; + PSI_bootstrap *boot; + PFS_global_param param; + + param.m_enabled= true; + param.m_mutex_class_sizing= 10; + param.m_rwlock_class_sizing= 10; + param.m_cond_class_sizing= 10; + param.m_thread_class_sizing= 10; + param.m_table_share_sizing= 10; + param.m_file_class_sizing= 10; + param.m_mutex_sizing= 10; + param.m_rwlock_sizing= 10; + param.m_cond_sizing= 10; + param.m_thread_sizing= 10; + param.m_table_sizing= 10; + param.m_file_sizing= 10; + param.m_file_handle_sizing= 50; + param.m_events_waits_history_sizing= 10; + param.m_events_waits_history_long_sizing= 10; + + /* test_bootstrap() covered this, assuming it just works */ + boot= initialize_performance_schema(& param); + psi= boot->get_interface(PSI_VERSION_1); + + return (PSI*) psi; +} + +void test_bad_registration() +{ + PSI *psi; + + diag("test_bad_registration"); + + psi= load_perfschema(); + + /* + Test that length('wait/synch/mutex/' (17) + category + '/' (1)) < 32 + --> category can be up to 13 chars for a mutex. + */ + + PSI_mutex_key dummy_mutex_key= 9999; + PSI_mutex_info bad_mutex_1[]= + { + { & dummy_mutex_key, "X", 0} + }; + + psi->register_mutex("/", bad_mutex_1, 1); + ok(dummy_mutex_key == 0, "zero key"); + dummy_mutex_key= 9999; + psi->register_mutex("a/", bad_mutex_1, 1); + ok(dummy_mutex_key == 0, "zero key"); + dummy_mutex_key= 9999; + psi->register_mutex("/b", bad_mutex_1, 1); + ok(dummy_mutex_key == 0, "zero key"); + dummy_mutex_key= 9999; + psi->register_mutex("a/b", bad_mutex_1, 1); + ok(dummy_mutex_key == 0, "zero key"); + dummy_mutex_key= 9999; + psi->register_mutex("12345678901234", bad_mutex_1, 1); + ok(dummy_mutex_key == 0, "zero key"); + dummy_mutex_key= 9999; + psi->register_mutex("1234567890123", bad_mutex_1, 1); + ok(dummy_mutex_key == 1, "assigned key"); + + /* + Test that length('wait/synch/mutex/' (17) + category + '/' (1) + name) <= 128 + --> category + name can be up to 110 chars for a mutex. + */ + + dummy_mutex_key= 9999; + PSI_mutex_info bad_mutex_2[]= + { + { & dummy_mutex_key, + /* 110 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "1234567890", + 0} + }; + + psi->register_mutex("X", bad_mutex_2, 1); + ok(dummy_mutex_key == 0, "zero key"); + + dummy_mutex_key= 9999; + PSI_mutex_info bad_mutex_3[]= + { + { & dummy_mutex_key, + /* 109 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "123456789", + 0} + }; + + psi->register_mutex("XX", bad_mutex_3, 1); + ok(dummy_mutex_key == 0, "zero key"); + + psi->register_mutex("X", bad_mutex_3, 1); + ok(dummy_mutex_key == 2, "assigned key"); + + /* + Test that length('wait/synch/rwlock/' (18) + category + '/' (1)) < 32 + --> category can be up to 12 chars for a rwlock. + */ + + PSI_rwlock_key dummy_rwlock_key= 9999; + PSI_rwlock_info bad_rwlock_1[]= + { + { & dummy_rwlock_key, "X", 0} + }; + + psi->register_rwlock("/", bad_rwlock_1, 1); + ok(dummy_rwlock_key == 0, "zero key"); + dummy_rwlock_key= 9999; + psi->register_rwlock("a/", bad_rwlock_1, 1); + ok(dummy_rwlock_key == 0, "zero key"); + dummy_rwlock_key= 9999; + psi->register_rwlock("/b", bad_rwlock_1, 1); + ok(dummy_rwlock_key == 0, "zero key"); + dummy_rwlock_key= 9999; + psi->register_rwlock("a/b", bad_rwlock_1, 1); + ok(dummy_rwlock_key == 0, "zero key"); + dummy_rwlock_key= 9999; + psi->register_rwlock("1234567890123", bad_rwlock_1, 1); + ok(dummy_rwlock_key == 0, "zero key"); + dummy_rwlock_key= 9999; + psi->register_rwlock("123456789012", bad_rwlock_1, 1); + ok(dummy_rwlock_key == 1, "assigned key"); + + /* + Test that length('wait/synch/rwlock/' (18) + category + '/' (1) + name) <= 128 + --> category + name can be up to 109 chars for a rwlock. + */ + + dummy_rwlock_key= 9999; + PSI_rwlock_info bad_rwlock_2[]= + { + { & dummy_rwlock_key, + /* 109 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "123456789", + 0} + }; + + psi->register_rwlock("X", bad_rwlock_2, 1); + ok(dummy_rwlock_key == 0, "zero key"); + + dummy_rwlock_key= 9999; + PSI_rwlock_info bad_rwlock_3[]= + { + { & dummy_rwlock_key, + /* 108 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678", + 0} + }; + + psi->register_rwlock("XX", bad_rwlock_3, 1); + ok(dummy_rwlock_key == 0, "zero key"); + + psi->register_rwlock("X", bad_rwlock_3, 1); + ok(dummy_rwlock_key == 2, "assigned key"); + + /* + Test that length('wait/synch/cond/' (16) + category + '/' (1)) < 32 + --> category can be up to 14 chars for a cond. + */ + + PSI_cond_key dummy_cond_key= 9999; + PSI_cond_info bad_cond_1[]= + { + { & dummy_cond_key, "X", 0} + }; + + psi->register_cond("/", bad_cond_1, 1); + ok(dummy_cond_key == 0, "zero key"); + dummy_cond_key= 9999; + psi->register_cond("a/", bad_cond_1, 1); + ok(dummy_cond_key == 0, "zero key"); + dummy_cond_key= 9999; + psi->register_cond("/b", bad_cond_1, 1); + ok(dummy_cond_key == 0, "zero key"); + dummy_cond_key= 9999; + psi->register_cond("a/b", bad_cond_1, 1); + ok(dummy_cond_key == 0, "zero key"); + dummy_cond_key= 9999; + psi->register_cond("123456789012345", bad_cond_1, 1); + ok(dummy_cond_key == 0, "zero key"); + dummy_cond_key= 9999; + psi->register_cond("12345678901234", bad_cond_1, 1); + ok(dummy_cond_key == 1, "assigned key"); + + /* + Test that length('wait/synch/cond/' (16) + category + '/' (1) + name) <= 128 + --> category + name can be up to 111 chars for a cond. + */ + + dummy_cond_key= 9999; + PSI_cond_info bad_cond_2[]= + { + { & dummy_cond_key, + /* 111 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901", + 0} + }; + + psi->register_cond("X", bad_cond_2, 1); + ok(dummy_cond_key == 0, "zero key"); + + dummy_cond_key= 9999; + PSI_cond_info bad_cond_3[]= + { + { & dummy_cond_key, + /* 110 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "1234567890", + 0} + }; + + psi->register_cond("XX", bad_cond_3, 1); + ok(dummy_cond_key == 0, "zero key"); + + psi->register_cond("X", bad_cond_3, 1); + ok(dummy_cond_key == 2, "assigned key"); + + /* + Test that length('thread/' (7) + category + '/' (1)) < 32 + --> category can be up to 23 chars for a thread. + */ + + PSI_thread_key dummy_thread_key= 9999; + PSI_thread_info bad_thread_1[]= + { + { & dummy_thread_key, "X", 0} + }; + + psi->register_thread("/", bad_thread_1, 1); + ok(dummy_thread_key == 0, "zero key"); + dummy_thread_key= 9999; + psi->register_thread("a/", bad_thread_1, 1); + ok(dummy_thread_key == 0, "zero key"); + dummy_thread_key= 9999; + psi->register_thread("/b", bad_thread_1, 1); + ok(dummy_thread_key == 0, "zero key"); + dummy_thread_key= 9999; + psi->register_thread("a/b", bad_thread_1, 1); + ok(dummy_thread_key == 0, "zero key"); + dummy_thread_key= 9999; + psi->register_thread("123456789012345678901234", bad_thread_1, 1); + ok(dummy_thread_key == 0, "zero key"); + dummy_thread_key= 9999; + psi->register_thread("12345678901234567890123", bad_thread_1, 1); + ok(dummy_thread_key == 1, "assigned key"); + + /* + Test that length('thread/' (7) + category + '/' (1) + name) <= 128 + --> category + name can be up to 120 chars for a thread. + */ + + dummy_thread_key= 9999; + PSI_thread_info bad_thread_2[]= + { + { & dummy_thread_key, + /* 120 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234567890", + 0} + }; + + psi->register_thread("X", bad_thread_2, 1); + ok(dummy_thread_key == 0, "zero key"); + + dummy_thread_key= 9999; + PSI_thread_info bad_thread_3[]= + { + { & dummy_thread_key, + /* 119 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "1234567890123456789", + 0} + }; + + psi->register_thread("XX", bad_thread_3, 1); + ok(dummy_thread_key == 0, "zero key"); + + psi->register_thread("X", bad_thread_3, 1); + ok(dummy_thread_key == 2, "assigned key"); + + /* + Test that length('wait/io/file/' (13) + category + '/' (1)) < 32 + --> category can be up to 17 chars for a file. + */ + + PSI_file_key dummy_file_key= 9999; + PSI_file_info bad_file_1[]= + { + { & dummy_file_key, "X", 0} + }; + + psi->register_file("/", bad_file_1, 1); + ok(dummy_file_key == 0, "zero key"); + dummy_file_key= 9999; + psi->register_file("a/", bad_file_1, 1); + ok(dummy_file_key == 0, "zero key"); + dummy_file_key= 9999; + psi->register_file("/b", bad_file_1, 1); + ok(dummy_file_key == 0, "zero key"); + dummy_file_key= 9999; + psi->register_file("a/b", bad_file_1, 1); + ok(dummy_file_key == 0, "zero key"); + dummy_file_key= 9999; + psi->register_file("123456789012345678", bad_file_1, 1); + ok(dummy_file_key == 0, "zero key"); + dummy_file_key= 9999; + psi->register_file("12345678901234567", bad_file_1, 1); + ok(dummy_file_key == 1, "assigned key"); + + /* + Test that length('wait/io/file/' (13) + category + '/' (1) + name) <= 128 + --> category + name can be up to 114 chars for a file. + */ + + dummy_file_key= 9999; + PSI_file_info bad_file_2[]= + { + { & dummy_file_key, + /* 114 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "12345678901234", + 0} + }; + + psi->register_file("X", bad_file_2, 1); + ok(dummy_file_key == 0, "zero key"); + + dummy_file_key= 9999; + PSI_file_info bad_file_3[]= + { + { & dummy_file_key, + /* 113 chars name */ + "12345678901234567890123456789012345678901234567890" + "12345678901234567890123456789012345678901234567890" + "1234567890123", + 0} + }; + + psi->register_file("XX", bad_file_3, 1); + ok(dummy_file_key == 0, "zero key"); + + psi->register_file("X", bad_file_3, 1); + ok(dummy_file_key == 2, "assigned key"); + + shutdown_performance_schema(); +} + +void test_init_disabled() +{ + PSI *psi; + + diag("test_init_disabled"); + + psi= load_perfschema(); + + PSI_mutex_key mutex_key_A; + PSI_mutex_info all_mutex[]= + { + { & mutex_key_A, "M-A", 0} + }; + + PSI_rwlock_key rwlock_key_A; + PSI_rwlock_info all_rwlock[]= + { + { & rwlock_key_A, "RW-A", 0} + }; + + PSI_cond_key cond_key_A; + PSI_cond_info all_cond[]= + { + { & cond_key_A, "C-A", 0} + }; + + PSI_file_key file_key_A; + PSI_file_info all_file[]= + { + { & file_key_A, "F-A", 0} + }; + + PSI_thread_key thread_key_1; + PSI_thread_info all_thread[]= + { + { & thread_key_1, "T-1", 0} + }; + + psi->register_mutex("test", all_mutex, 1); + psi->register_rwlock("test", all_rwlock, 1); + psi->register_cond("test", all_cond, 1); + psi->register_file("test", all_file, 1); + psi->register_thread("test", all_thread, 1); + + PFS_mutex_class *mutex_class_A; + PFS_rwlock_class *rwlock_class_A; + PFS_cond_class *cond_class_A; + PFS_file_class *file_class_A; + PSI_mutex *mutex_A1; + PSI_rwlock *rwlock_A1; + PSI_cond *cond_A1; + PFS_file *file_A1; + PSI_thread *thread_1; + + /* Preparation */ + + thread_1= psi->new_thread(thread_key_1, NULL, 0); + ok(thread_1 != NULL, "T-1"); + psi->set_thread_id(thread_1, 1); + + mutex_class_A= find_mutex_class(mutex_key_A); + ok(mutex_class_A != NULL, "mutex class A"); + + rwlock_class_A= find_rwlock_class(rwlock_key_A); + ok(rwlock_class_A != NULL, "rwlock class A"); + + cond_class_A= find_cond_class(cond_key_A); + ok(cond_class_A != NULL, "cond class A"); + + file_class_A= find_file_class(file_key_A); + ok(file_class_A != NULL, "file class A"); + + /* Pretend thread T-1 is running, and disabled */ + /* ------------------------------------------- */ + + psi->set_thread(thread_1); + setup_thread(thread_1, false); + + /* disabled M-A + disabled T-1: no instrumentation */ + + mutex_class_A->m_enabled= false; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* enabled M-A + disabled T-1: no instrumentation */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* broken key + disabled T-1: no instrumentation */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(0, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + mutex_A1= psi->init_mutex(99, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* disabled RW-A + disabled T-1: no instrumentation */ + + rwlock_class_A->m_enabled= false; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* enabled RW-A + disabled T-1: no instrumentation */ + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* broken key + disabled T-1: no instrumentation */ + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(0, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + rwlock_A1= psi->init_rwlock(99, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* disabled C-A + disabled T-1: no instrumentation */ + + cond_class_A->m_enabled= false; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* enabled C-A + disabled T-1: no instrumentation */ + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* broken key + disabled T-1: no instrumentation */ + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(0, NULL); + ok(cond_A1 == NULL, "not instrumented"); + cond_A1= psi->init_cond(99, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* disabled F-A + disabled T-1: no instrumentation */ + + file_class_A->m_enabled= false; + psi->create_file(file_key_A, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* enabled F-A + disabled T-1: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(file_key_A, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* broken key + disabled T-1: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(0, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + psi->create_file(99, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* Pretend thread T-1 is enabled */ + /* ----------------------------- */ + + setup_thread(thread_1, true); + + /* disabled M-A + enabled T-1: no instrumentation */ + + mutex_class_A->m_enabled= false; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* enabled M-A + enabled T-1: instrumentation */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 != NULL, "instrumented"); + psi->destroy_mutex(mutex_A1); + + /* broken key + enabled T-1: no instrumentation */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(0, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + mutex_A1= psi->init_mutex(99, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* disabled RW-A + enabled T-1: no instrumentation */ + + rwlock_class_A->m_enabled= false; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* enabled RW-A + enabled T-1: instrumentation */ + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 != NULL, "instrumented"); + psi->destroy_rwlock(rwlock_A1); + + /* broken key + enabled T-1: no instrumentation */ + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(0, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + rwlock_A1= psi->init_rwlock(99, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* disabled C-A + enabled T-1: no instrumentation */ + + cond_class_A->m_enabled= false; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* enabled C-A + enabled T-1: instrumentation */ + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 != NULL, "instrumented"); + psi->destroy_cond(cond_A1); + + /* broken key + enabled T-1: no instrumentation */ + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(0, NULL); + ok(cond_A1 == NULL, "not instrumented"); + cond_A1= psi->init_cond(99, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* disabled F-A + enabled T-1: no instrumentation */ + + file_class_A->m_enabled= false; + psi->create_file(file_key_A, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* enabled F-A + open failed + enabled T-1: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(file_key_A, "foo", (File) -1); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* enabled F-A + out-of-descriptors + enabled T-1: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(file_key_A, "foo", (File) 65000); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + ok(file_handle_lost == 1, "lost a file handle"); + file_handle_lost= 0; + + /* enabled F-A + enabled T-1: instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(file_key_A, "foo-instrumented", (File) 12); + file_A1= lookup_file_by_name("foo-instrumented"); + ok(file_A1 != NULL, "instrumented"); + + /* broken key + enabled T-1: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(0, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + psi->create_file(99, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* Pretend the running thread is not instrumented */ + /* ---------------------------------------------- */ + + psi->delete_current_thread(); + + /* disabled M-A + unknown thread: no instrumentation */ + + mutex_class_A->m_enabled= false; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* enabled M-A + unknown thread: no instrumentation */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* broken key + unknown thread: no instrumentation */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(0, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + mutex_A1= psi->init_mutex(99, NULL); + ok(mutex_A1 == NULL, "not instrumented"); + + /* disabled RW-A + unknown thread: no instrumentation */ + + rwlock_class_A->m_enabled= false; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* enabled RW-A + unknown thread: no instrumentation */ + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* broken key + unknown thread: no instrumentation */ + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(0, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + rwlock_A1= psi->init_rwlock(99, NULL); + ok(rwlock_A1 == NULL, "not instrumented"); + + /* disabled C-A + unknown thread: no instrumentation */ + + cond_class_A->m_enabled= false; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* enabled C-A + unknown thread: no instrumentation */ + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* broken key + unknown thread: no instrumentation */ + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(0, NULL); + ok(cond_A1 == NULL, "not instrumented"); + cond_A1= psi->init_cond(99, NULL); + ok(cond_A1 == NULL, "not instrumented"); + + /* disabled F-A + unknown thread: no instrumentation */ + + file_class_A->m_enabled= false; + psi->create_file(file_key_A, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* enabled F-A + unknown thread: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(file_key_A, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + /* broken key + unknown thread: no instrumentation */ + + file_class_A->m_enabled= true; + psi->create_file(0, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + psi->create_file(99, "foo", (File) 12); + file_A1= lookup_file_by_name("foo"); + ok(file_A1 == NULL, "not instrumented"); + + shutdown_performance_schema(); +} + +void test_locker_disabled() +{ + PSI *psi; + + diag("test_locker_disabled"); + + psi= load_perfschema(); + + PSI_mutex_key mutex_key_A; + PSI_mutex_info all_mutex[]= + { + { & mutex_key_A, "M-A", 0} + }; + + PSI_rwlock_key rwlock_key_A; + PSI_rwlock_info all_rwlock[]= + { + { & rwlock_key_A, "RW-A", 0} + }; + + PSI_cond_key cond_key_A; + PSI_cond_info all_cond[]= + { + { & cond_key_A, "C-A", 0} + }; + + PSI_file_key file_key_A; + PSI_file_info all_file[]= + { + { & file_key_A, "F-A", 0} + }; + + PSI_thread_key thread_key_1; + PSI_thread_info all_thread[]= + { + { & thread_key_1, "T-1", 0} + }; + + psi->register_mutex("test", all_mutex, 1); + psi->register_rwlock("test", all_rwlock, 1); + psi->register_cond("test", all_cond, 1); + psi->register_file("test", all_file, 1); + psi->register_thread("test", all_thread, 1); + + PFS_mutex_class *mutex_class_A; + PFS_rwlock_class *rwlock_class_A; + PFS_cond_class *cond_class_A; + PFS_file_class *file_class_A; + PSI_mutex *mutex_A1; + PSI_rwlock *rwlock_A1; + PSI_cond *cond_A1; + PSI_file *file_A1; + PSI_thread *thread_1; + + /* Preparation */ + + thread_1= psi->new_thread(thread_key_1, NULL, 0); + ok(thread_1 != NULL, "T-1"); + psi->set_thread_id(thread_1, 1); + + mutex_class_A= find_mutex_class(mutex_key_A); + ok(mutex_class_A != NULL, "mutex info A"); + + rwlock_class_A= find_rwlock_class(rwlock_key_A); + ok(rwlock_class_A != NULL, "rwlock info A"); + + cond_class_A= find_cond_class(cond_key_A); + ok(cond_class_A != NULL, "cond info A"); + + file_class_A= find_file_class(file_key_A); + ok(file_class_A != NULL, "file info A"); + + /* Pretend thread T-1 is running, and enabled */ + /* ------------------------------------------ */ + + psi->set_thread(thread_1); + setup_thread(thread_1, true); + + /* Enable all instruments, instantiate objects */ + + mutex_class_A->m_enabled= true; + mutex_A1= psi->init_mutex(mutex_key_A, NULL); + ok(mutex_A1 != NULL, "instrumented"); + + rwlock_class_A->m_enabled= true; + rwlock_A1= psi->init_rwlock(rwlock_key_A, NULL); + ok(rwlock_A1 != NULL, "instrumented"); + + cond_class_A->m_enabled= true; + cond_A1= psi->init_cond(cond_key_A, NULL); + ok(cond_A1 != NULL, "instrumented"); + + file_class_A->m_enabled= true; + psi->create_file(file_key_A, "foo", (File) 12); + file_A1= (PSI_file*) lookup_file_by_name("foo"); + ok(file_A1 != NULL, "instrumented"); + + PSI_mutex_locker *mutex_locker; + PSI_rwlock_locker *rwlock_locker; + PSI_cond_locker *cond_locker; + PSI_file_locker *file_locker; + + /* Pretend thread T-1 is disabled */ + /* ------------------------------ */ + + setup_thread(thread_1, false); + flag_events_waits_current= true; + mutex_class_A->m_enabled= true; + rwlock_class_A->m_enabled= true; + cond_class_A->m_enabled= true; + file_class_A->m_enabled= true; + + mutex_locker= psi->get_thread_mutex_locker(mutex_A1, PSI_MUTEX_LOCK); + ok(mutex_locker == NULL, "no locker"); + rwlock_locker= psi->get_thread_rwlock_locker(rwlock_A1, PSI_RWLOCK_READLOCK); + ok(rwlock_locker == NULL, "no locker"); + cond_locker= psi->get_thread_cond_locker(cond_A1, mutex_A1, PSI_COND_WAIT); + ok(cond_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_name_locker(file_key_A, PSI_FILE_OPEN, "xxx", NULL); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_stream_locker(file_A1, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + + /* Pretend the consumer is disabled */ + /* -------------------------------- */ + + setup_thread(thread_1, true); + flag_events_waits_current= false; + mutex_class_A->m_enabled= true; + rwlock_class_A->m_enabled= true; + cond_class_A->m_enabled= true; + file_class_A->m_enabled= true; + + mutex_locker= psi->get_thread_mutex_locker(mutex_A1, PSI_MUTEX_LOCK); + ok(mutex_locker == NULL, "no locker"); + rwlock_locker= psi->get_thread_rwlock_locker(rwlock_A1, PSI_RWLOCK_READLOCK); + ok(rwlock_locker == NULL, "no locker"); + cond_locker= psi->get_thread_cond_locker(cond_A1, mutex_A1, PSI_COND_WAIT); + ok(cond_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_name_locker(file_key_A, PSI_FILE_OPEN, "xxx", NULL); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_stream_locker(file_A1, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + + /* Pretend the instrument is disabled */ + /* ---------------------------------- */ + + setup_thread(thread_1, true); + flag_events_waits_current= true; + mutex_class_A->m_enabled= false; + rwlock_class_A->m_enabled= false; + cond_class_A->m_enabled= false; + file_class_A->m_enabled= false; + + mutex_locker= psi->get_thread_mutex_locker(mutex_A1, PSI_MUTEX_LOCK); + ok(mutex_locker == NULL, "no locker"); + rwlock_locker= psi->get_thread_rwlock_locker(rwlock_A1, PSI_RWLOCK_READLOCK); + ok(rwlock_locker == NULL, "no locker"); + cond_locker= psi->get_thread_cond_locker(cond_A1, mutex_A1, PSI_COND_WAIT); + ok(cond_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_name_locker(file_key_A, PSI_FILE_OPEN, "xxx", NULL); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_stream_locker(file_A1, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + + /* Pretend everything is enabled */ + /* ----------------------------- */ + + setup_thread(thread_1, true); + flag_events_waits_current= true; + mutex_class_A->m_enabled= true; + rwlock_class_A->m_enabled= true; + cond_class_A->m_enabled= true; + file_class_A->m_enabled= true; + + mutex_locker= psi->get_thread_mutex_locker(mutex_A1, PSI_MUTEX_LOCK); + ok(mutex_locker != NULL, "locker"); + psi->start_mutex_wait(mutex_locker, __FILE__, __LINE__); + psi->end_mutex_wait(mutex_locker, 0); + rwlock_locker= psi->get_thread_rwlock_locker(rwlock_A1, PSI_RWLOCK_READLOCK); + ok(rwlock_locker != NULL, "locker"); + psi->start_rwlock_rdwait(rwlock_locker, __FILE__, __LINE__); + psi->end_rwlock_rdwait(rwlock_locker, 0); + cond_locker= psi->get_thread_cond_locker(cond_A1, mutex_A1, PSI_COND_WAIT); + ok(cond_locker != NULL, "locker"); + psi->start_cond_wait(cond_locker, __FILE__, __LINE__); + psi->end_cond_wait(cond_locker, 0); + file_locker= psi->get_thread_file_name_locker(file_key_A, PSI_FILE_OPEN, "xxx", NULL); + ok(file_locker != NULL, "locker"); + psi->start_file_open_wait(file_locker, __FILE__, __LINE__); + psi->end_file_open_wait(file_locker); + file_locker= psi->get_thread_file_stream_locker(file_A1, PSI_FILE_READ); + ok(file_locker != NULL, "locker"); + psi->start_file_wait(file_locker, 10, __FILE__, __LINE__); + psi->end_file_wait(file_locker, 10); + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_READ); + ok(file_locker != NULL, "locker"); + psi->start_file_wait(file_locker, 10, __FILE__, __LINE__); + psi->end_file_wait(file_locker, 10); + + /* Pretend the running thread is not instrumented */ + /* ---------------------------------------------- */ + + psi->delete_current_thread(); + flag_events_waits_current= true; + mutex_class_A->m_enabled= true; + rwlock_class_A->m_enabled= true; + cond_class_A->m_enabled= true; + file_class_A->m_enabled= true; + + mutex_locker= psi->get_thread_mutex_locker(mutex_A1, PSI_MUTEX_LOCK); + ok(mutex_locker == NULL, "no locker"); + rwlock_locker= psi->get_thread_rwlock_locker(rwlock_A1, PSI_RWLOCK_READLOCK); + ok(rwlock_locker == NULL, "no locker"); + cond_locker= psi->get_thread_cond_locker(cond_A1, mutex_A1, PSI_COND_WAIT); + ok(cond_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_name_locker(file_key_A, PSI_FILE_OPEN, "xxx", NULL); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_stream_locker(file_A1, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_READ); + ok(file_locker == NULL, "no locker"); + + shutdown_performance_schema(); +} + +void test_file_instrumentation_leak() +{ + PSI *psi; + + diag("test_file_instrumentation_leak"); + + psi= load_perfschema(); + + PSI_file_key file_key_A; + PSI_file_key file_key_B; + PSI_file_info all_file[]= + { + { & file_key_A, "F-A", 0}, + { & file_key_B, "F-B", 0} + }; + + PSI_thread_key thread_key_1; + PSI_thread_info all_thread[]= + { + { & thread_key_1, "T-1", 0} + }; + + psi->register_file("test", all_file, 2); + psi->register_thread("test", all_thread, 1); + + PFS_file_class *file_class_A; + PFS_file_class *file_class_B; + PSI_thread *thread_1; + + /* Preparation */ + + thread_1= psi->new_thread(thread_key_1, NULL, 0); + ok(thread_1 != NULL, "T-1"); + psi->set_thread_id(thread_1, 1); + + file_class_A= find_file_class(file_key_A); + ok(file_class_A != NULL, "file info A"); + + file_class_B= find_file_class(file_key_B); + ok(file_class_B != NULL, "file info B"); + + psi->set_thread(thread_1); + + /* Pretend everything is enabled */ + /* ----------------------------- */ + + setup_thread(thread_1, true); + flag_events_waits_current= true; + file_class_A->m_enabled= true; + file_class_B->m_enabled= true; + + PSI_file_locker *file_locker; + + /* Simulate OPEN + READ of 100 bytes + CLOSE on descriptor 12 */ + + file_locker= psi->get_thread_file_name_locker(file_key_A, PSI_FILE_OPEN, "AAA", NULL); + ok(file_locker != NULL, "locker"); + psi->start_file_open_wait(file_locker, __FILE__, __LINE__); + psi->end_file_open_wait_and_bind_to_descriptor(file_locker, 12); + + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_READ); + ok(file_locker != NULL, "locker"); + psi->start_file_wait(file_locker, 100, __FILE__, __LINE__); + psi->end_file_wait(file_locker, 100); + + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_CLOSE); + ok(file_locker != NULL, "locker"); + psi->start_file_wait(file_locker, 0, __FILE__, __LINE__); + psi->end_file_wait(file_locker, 0); + + /* Simulate uninstrumented-OPEN + WRITE on descriptor 24 */ + + file_locker= psi->get_thread_file_descriptor_locker((File) 24, PSI_FILE_WRITE); + ok(file_locker == NULL, "no locker, since the open was not instrumented"); + + /* + Simulate uninstrumented-OPEN + WRITE on descriptor 12 : + the instrumentation should not leak (don't charge the file io on unknown B to "AAA") + */ + + file_locker= psi->get_thread_file_descriptor_locker((File) 12, PSI_FILE_WRITE); + ok(file_locker == NULL, "no locker, no leak"); + + shutdown_performance_schema(); +} + +void test_enabled() +{ +#ifdef LATER + PSI *psi; + + diag("test_enabled"); + + psi= load_perfschema(); + + PSI_mutex_key mutex_key_A; + PSI_mutex_key mutex_key_B; + PSI_mutex_info all_mutex[]= + { + { & mutex_key_A, "M-A", 0}, + { & mutex_key_B, "M-B", 0} + }; + + PSI_rwlock_key rwlock_key_A; + PSI_rwlock_key rwlock_key_B; + PSI_rwlock_info all_rwlock[]= + { + { & rwlock_key_A, "RW-A", 0}, + { & rwlock_key_B, "RW-B", 0} + }; + + PSI_cond_key cond_key_A; + PSI_cond_key cond_key_B; + PSI_cond_info all_cond[]= + { + { & cond_key_A, "C-A", 0}, + { & cond_key_B, "C-B", 0} + }; + + shutdown_performance_schema(); +#endif +} + +void do_all_tests() +{ + test_bootstrap(); + test_bad_registration(); + test_init_disabled(); + test_locker_disabled(); + test_file_instrumentation_leak(); +} + +int main(int, char **) +{ + plan(153); + MY_INIT("pfs-t"); + do_all_tests(); + return 0; +} + diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc new file mode 100644 index 00000000000..d7810eedb04 --- /dev/null +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc @@ -0,0 +1,210 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include + +#include "stub_pfs_global.h" + +void test_oom() +{ + int rc; + PFS_global_param param; + + stub_alloc_always_fails= true; + + param.m_enabled= true; + param.m_mutex_class_sizing= 10; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 1000; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 1, "oom (mutex)"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 10; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 1000; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 1, "oom (rwlock)"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 10; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 1000; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 1, "oom (cond)"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 10; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 1000; + param.m_file_handle_sizing= 1000; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 1, "oom (file)"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 10; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 1000; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 1, "oom (table)"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 10; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 1000; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 1, "oom (thread)"); + + stub_alloc_always_fails= false; + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 10; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 1000; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 10; + param.m_events_waits_history_long_sizing= 0; + + stub_alloc_fails_after_count= 2; + rc= init_instruments(& param); + ok(rc == 1, "oom (thread history sizing)"); + + param.m_enabled= true; + param.m_mutex_class_sizing= 50; + param.m_rwlock_class_sizing= 50; + param.m_cond_class_sizing= 50; + param.m_thread_class_sizing= 10; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 50; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 1000; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + stub_alloc_fails_after_count= 2; + rc= init_instruments(& param); + ok(rc == 1, "oom (per thread wait)"); + + cleanup_instruments(); +} + +void do_all_tests() +{ + test_oom(); +} + +int main(int, char **) +{ + plan(8); + MY_INIT("pfs_instr-oom-t"); + do_all_tests(); + return 0; +} + diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc new file mode 100644 index 00000000000..f85de601579 --- /dev/null +++ b/storage/perfschema/unittest/pfs_instr-t.cc @@ -0,0 +1,411 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include + +void test_no_instruments() +{ + int rc; + PFS_global_param param; + + param.m_enabled= true; + param.m_mutex_class_sizing= 0; + param.m_rwlock_class_sizing= 0; + param.m_cond_class_sizing= 0; + param.m_thread_class_sizing= 0; + param.m_table_share_sizing= 0; + param.m_file_class_sizing= 0; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 0, "zero init"); + + cleanup_instruments(); +} + +void test_no_instances() +{ + int rc; + PFS_mutex_class dummy_mutex_class; + PFS_rwlock_class dummy_rwlock_class; + PFS_cond_class dummy_cond_class; + PFS_thread_class dummy_thread_class; + PFS_file_class dummy_file_class; + PFS_table_share dummy_table_share; + PFS_mutex *mutex; + PFS_rwlock *rwlock; + PFS_cond *cond; + PFS_thread *thread; + PFS_file *file; + PFS_table *table; + PFS_global_param param; + + param.m_enabled= true; + param.m_mutex_class_sizing= 1; + param.m_rwlock_class_sizing= 1; + param.m_cond_class_sizing= 1; + param.m_thread_class_sizing= 1; + param.m_table_share_sizing= 1; + param.m_file_class_sizing= 1; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 0; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 0; + param.m_events_waits_history_long_sizing= 0; + + rc= init_instruments(& param); + ok(rc == 0, "no instances init"); + + mutex= create_mutex(& dummy_mutex_class, NULL); + ok(mutex == NULL, "no mutex"); + ok(mutex_lost == 1, "lost 1"); + mutex= create_mutex(& dummy_mutex_class, NULL); + ok(mutex == NULL, "no mutex"); + ok(mutex_lost == 2, "lost 2"); + + rwlock= create_rwlock(& dummy_rwlock_class, NULL); + ok(rwlock == NULL, "no rwlock"); + ok(rwlock_lost == 1, "lost 1"); + rwlock= create_rwlock(& dummy_rwlock_class, NULL); + ok(rwlock == NULL, "no rwlock"); + ok(rwlock_lost == 2, "lost 2"); + + cond= create_cond(& dummy_cond_class, NULL); + ok(cond == NULL, "no cond"); + ok(cond_lost == 1, "lost 1"); + cond= create_cond(& dummy_cond_class, NULL); + ok(cond == NULL, "no cond"); + ok(cond_lost == 2, "lost 2"); + + thread= create_thread(& dummy_thread_class, NULL, 0); + ok(thread == NULL, "no thread"); + ok(thread_lost == 1, "lost 1"); + thread= create_thread(& dummy_thread_class, NULL, 0); + ok(thread == NULL, "no thread"); + ok(thread_lost == 2, "lost 2"); + + PFS_thread fake_thread; + fake_thread.m_filename_hash_pins= NULL; + + file= find_or_create_file(& fake_thread, & dummy_file_class, "dummy", 5); + ok(file == NULL, "no file"); + ok(file_lost == 1, "lost 1"); + file= find_or_create_file(& fake_thread, & dummy_file_class, "dummy", 5); + ok(file == NULL, "no file"); + ok(file_lost == 2, "lost 2"); + + init_file_hash(); + + file= find_or_create_file(& fake_thread, & dummy_file_class, "dummy", 5); + ok(file == NULL, "no file"); + ok(file_lost == 3, "lost 3"); + file= find_or_create_file(& fake_thread, & dummy_file_class, "dummy", 5); + ok(file == NULL, "no file"); + ok(file_lost == 4, "lost 4"); + + char long_file_name[10000]; + int size= sizeof(long_file_name); + memset(long_file_name, 'X', size); + + file= find_or_create_file(& fake_thread, & dummy_file_class, long_file_name, size); + ok(file == NULL, "no file"); + ok(file_lost == 5, "lost 5"); + + table= create_table(& dummy_table_share, NULL); + ok(table == NULL, "no table"); + ok(table_lost == 1, "lost 1"); + table= create_table(& dummy_table_share, NULL); + ok(table == NULL, "no table"); + ok(table_lost == 2, "lost 2"); + + /* No result to test, just make sure it does not crash */ + reset_events_waits_by_instance(); + reset_per_thread_wait_stat(); + + cleanup_file_hash(); + cleanup_instruments(); +} + +void test_with_instances() +{ + int rc; + PFS_mutex_class dummy_mutex_class; + PFS_rwlock_class dummy_rwlock_class; + PFS_cond_class dummy_cond_class; + PFS_thread_class dummy_thread_class; + PFS_file_class dummy_file_class; + PFS_table_share dummy_table_share; + PFS_mutex *mutex_1; + PFS_mutex *mutex_2; + PFS_rwlock *rwlock_1; + PFS_rwlock *rwlock_2; + PFS_cond *cond_1; + PFS_cond *cond_2; + PFS_thread *thread_1; + PFS_thread *thread_2; + PFS_file *file_1; + PFS_file *file_2; + PFS_table *table_1; + PFS_table *table_2; + PFS_global_param param; + + param.m_enabled= true; + param.m_mutex_class_sizing= 1; + param.m_rwlock_class_sizing= 1; + param.m_cond_class_sizing= 1; + param.m_thread_class_sizing= 1; + param.m_table_share_sizing= 1; + param.m_file_class_sizing= 1; + param.m_mutex_sizing= 2; + param.m_rwlock_sizing= 2; + param.m_cond_sizing= 2; + param.m_thread_sizing= 2; + param.m_table_sizing= 2; + param.m_file_sizing= 2; + param.m_file_handle_sizing= 100; + param.m_events_waits_history_sizing= 10; + param.m_events_waits_history_long_sizing= 10000; + + rc= init_instruments(& param); + ok(rc == 0, "instances init"); + + mutex_1= create_mutex(& dummy_mutex_class, NULL); + ok(mutex_1 != NULL, "mutex"); + ok(mutex_lost == 0, "not lost"); + mutex_2= create_mutex(& dummy_mutex_class, NULL); + ok(mutex_2 != NULL, "mutex"); + ok(mutex_lost == 0, "not lost"); + mutex_2= create_mutex(& dummy_mutex_class, NULL); + ok(mutex_2 == NULL, "no mutex"); + ok(mutex_lost == 1, "lost 1"); + destroy_mutex(mutex_1); + mutex_2= create_mutex(& dummy_mutex_class, NULL); + ok(mutex_2 != NULL, "mutex"); + ok(mutex_lost == 1, "no new loss"); + + rwlock_1= create_rwlock(& dummy_rwlock_class, NULL); + ok(rwlock_1 != NULL, "rwlock"); + ok(rwlock_lost == 0, "not lost"); + rwlock_2= create_rwlock(& dummy_rwlock_class, NULL); + ok(rwlock_2 != NULL, "rwlock"); + ok(rwlock_lost == 0, "not lost"); + rwlock_2= create_rwlock(& dummy_rwlock_class, NULL); + ok(rwlock_2 == NULL, "no rwlock"); + ok(rwlock_lost == 1, "lost 1"); + destroy_rwlock(rwlock_1); + rwlock_2= create_rwlock(& dummy_rwlock_class, NULL); + ok(rwlock_2 != NULL, "rwlock"); + ok(rwlock_lost == 1, "no new loss"); + + cond_1= create_cond(& dummy_cond_class, NULL); + ok(cond_1 != NULL, "cond"); + ok(cond_lost == 0, "not lost"); + cond_2= create_cond(& dummy_cond_class, NULL); + ok(cond_2 != NULL, "cond"); + ok(cond_lost == 0, "not lost"); + cond_2= create_cond(& dummy_cond_class, NULL); + ok(cond_2 == NULL, "no cond"); + ok(cond_lost == 1, "lost 1"); + destroy_cond(cond_1); + cond_2= create_cond(& dummy_cond_class, NULL); + ok(cond_2 != NULL, "cond"); + ok(cond_lost == 1, "no new loss"); + + thread_1= create_thread(& dummy_thread_class, NULL, 0); + ok(thread_1 != NULL, "thread"); + ok(thread_lost == 0, "not lost"); + thread_2= create_thread(& dummy_thread_class, NULL, 0); + ok(thread_2 != NULL, "thread"); + ok(thread_lost == 0, "not lost"); + thread_2= create_thread(& dummy_thread_class, NULL, 0); + ok(thread_2 == NULL, "no thread"); + ok(thread_lost == 1, "lost 1"); + destroy_thread(thread_1); + thread_2= create_thread(& dummy_thread_class, NULL, 0); + ok(thread_2 != NULL, "thread"); + ok(thread_lost == 1, "no new loss"); + + PFS_thread fake_thread; + fake_thread.m_filename_hash_pins= NULL; + + file_1= find_or_create_file(& fake_thread, & dummy_file_class, "dummy", 5); + ok(file_1 == NULL, "no file"); + ok(file_lost == 1, "lost 1"); + file_1= find_or_create_file(& fake_thread, & dummy_file_class, "dummy", 5); + ok(file_1 == NULL, "no file"); + ok(file_lost == 2, "lost 2"); + + init_file_hash(); + file_lost= 0; + + file_1= find_or_create_file(& fake_thread, & dummy_file_class, "dummy_A", 7); + ok(file_1 != NULL, "file"); + ok(file_1->m_file_stat.m_open_count == 1, "open count 1"); + ok(file_lost == 0, "not lost"); + file_2= find_or_create_file(& fake_thread, & dummy_file_class, "dummy_A", 7); + ok(file_1 == file_2, "same file"); + ok(file_1->m_file_stat.m_open_count == 2, "open count 2"); + ok(file_lost == 0, "not lost"); + release_file(file_2); + ok(file_1->m_file_stat.m_open_count == 1, "open count 1"); + file_2= find_or_create_file(& fake_thread, & dummy_file_class, "dummy_B", 7); + ok(file_2 != NULL, "file"); + ok(file_lost == 0, "not lost"); + file_2= find_or_create_file(& fake_thread, & dummy_file_class, "dummy_C", 7); + ok(file_2 == NULL, "no file"); + ok(file_lost == 1, "lost"); + release_file(file_1); + /* the file still exists, not destroyed */ + ok(file_1->m_file_stat.m_open_count == 0, "open count 0"); + file_2= find_or_create_file(& fake_thread, & dummy_file_class, "dummy_D", 7); + ok(file_2 == NULL, "no file"); + ok(file_lost == 2, "lost"); + + table_1= create_table(& dummy_table_share, NULL); + ok(table_1 != NULL, "table"); + ok(table_lost == 0, "not lost"); + table_2= create_table(& dummy_table_share, NULL); + ok(table_2 != NULL, "table"); + ok(table_lost == 0, "not lost"); + table_2= create_table(& dummy_table_share, NULL); + ok(table_2 == NULL, "no table"); + ok(table_lost == 1, "lost 1"); + destroy_table(table_1); + table_2= create_table(& dummy_table_share, NULL); + ok(table_2 != NULL, "table"); + ok(table_lost == 1, "no new loss"); + + //TODO: test that cleanup works + reset_events_waits_by_instance(); + reset_per_thread_wait_stat(); + + cleanup_file_hash(); + cleanup_instruments(); +} + +void test_per_thread_wait() +{ + int rc; + PFS_mutex_class dummy_mutex_class; + PFS_rwlock_class dummy_rwlock_class; + PFS_cond_class dummy_cond_class; + PFS_thread_class dummy_thread_class; + PFS_file_class dummy_file_class; + PFS_thread *thread; + PFS_single_stat_chain *base; + PFS_single_stat_chain *stat; + PFS_global_param param; + + + /* Per mutex info waits should be at [0..9] */ + mutex_class_max= 10; + /* Per rwlock info waits should be at [10..29] */ + rwlock_class_max= 20; + /* Per cond info waits should be at [30..69] */ + cond_class_max= 40; + /* Per file info waits should be at [70..149] */ + file_class_max= 80; + /* Per table info waits should be at [150..309] */ + table_share_max= 160; + + param.m_enabled= true; + param.m_mutex_class_sizing= mutex_class_max; + param.m_rwlock_class_sizing= rwlock_class_max; + param.m_cond_class_sizing= cond_class_max; + param.m_thread_class_sizing= 2; + param.m_table_share_sizing= table_share_max; + param.m_file_class_sizing= file_class_max; + param.m_mutex_sizing= 0; + param.m_rwlock_sizing= 0; + param.m_cond_sizing= 0; + param.m_thread_sizing= 2; + param.m_table_sizing= 0; + param.m_file_sizing= 0; + param.m_file_handle_sizing= 0; + param.m_events_waits_history_sizing= 10; + param.m_events_waits_history_long_sizing= 10000; + + rc= init_instruments(& param); + ok(rc == 0, "instances init"); + + thread= create_thread(& dummy_thread_class, NULL, 0); + ok(thread != NULL, "thread"); + ok(thread_lost == 0, "not lost"); + + base= & thread->m_instr_class_wait_stats[0]; + + dummy_mutex_class.m_index= 0; + stat= find_per_thread_mutex_class_wait_stat(thread, & dummy_mutex_class); + ok(base + 0 == stat, "fist mutex info slot at 0"); + dummy_mutex_class.m_index= mutex_class_max - 1; + stat= find_per_thread_mutex_class_wait_stat(thread, & dummy_mutex_class); + ok(base + 9 == stat, "last mutex info slot at 9"); + + dummy_rwlock_class.m_index= 0; + stat= find_per_thread_rwlock_class_wait_stat(thread, & dummy_rwlock_class); + ok(base + 10 == stat, "fist rwlock info slot at 10"); + dummy_rwlock_class.m_index= rwlock_class_max - 1; + stat= find_per_thread_rwlock_class_wait_stat(thread, & dummy_rwlock_class); + ok(base + 29 == stat, "last rwlock info slot at 29"); + + dummy_cond_class.m_index= 0; + stat= find_per_thread_cond_class_wait_stat(thread, & dummy_cond_class); + ok(base + 30 == stat, "fist cond info slot at 30"); + dummy_cond_class.m_index= cond_class_max - 1; + stat= find_per_thread_cond_class_wait_stat(thread, & dummy_cond_class); + ok(base + 69 == stat, "last cond info slot at 69"); + + dummy_file_class.m_index= 0; + stat= find_per_thread_file_class_wait_stat(thread, & dummy_file_class); + ok(base + 70 == stat, "fist file info slot at 70"); + dummy_file_class.m_index= file_class_max - 1; + stat= find_per_thread_file_class_wait_stat(thread, & dummy_file_class); + ok(base + 149 == stat, "last file info slot at 149"); + + cleanup_instruments(); +} + +void do_all_tests() +{ + test_no_instruments(); + test_no_instances(); + test_with_instances(); + test_per_thread_wait(); +} + +int main(int, char **) +{ + plan(102); + MY_INIT("pfs_instr-t"); + do_all_tests(); + return 0; +} + diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc new file mode 100644 index 00000000000..53100571323 --- /dev/null +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc @@ -0,0 +1,58 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include + +#include "stub_pfs_global.h" + +void test_oom() +{ + int rc; + + rc= init_sync_class(1000, 0, 0); + ok(rc == 1, "oom (mutex)"); + rc= init_sync_class(0, 1000, 0); + ok(rc == 1, "oom (rwlock)"); + rc= init_sync_class(0, 0, 1000); + ok(rc == 1, "oom (cond)"); + rc= init_thread_class(1000); + ok(rc == 1, "oom (thread)"); + rc= init_file_class(1000); + ok(rc == 1, "oom (file)"); + rc= init_table_share(1000); + ok(rc == 1, "oom (cond)"); + + cleanup_sync_class(); + cleanup_thread_class(); + cleanup_file_class(); + cleanup_table_share(); +} + +void do_all_tests() +{ + test_oom(); +} + +int main(int, char **) +{ + plan(6); + MY_INIT("pfs_instr_info-oom-t"); + do_all_tests(); + return 0; +} + diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc new file mode 100644 index 00000000000..0a1e0c2d0b1 --- /dev/null +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc @@ -0,0 +1,570 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include +#include +#include + +void test_no_registration() +{ + int rc; + PFS_sync_key key; + PFS_thread_key thread_key; + PFS_file_key file_key; + PFS_mutex_class *mutex; + PFS_rwlock_class *rwlock; + PFS_cond_class *cond; + PFS_thread_class *thread; + PFS_file_class *file; + PFS_table_share *table; + + rc= init_sync_class(0, 0, 0); + ok(rc == 0, "zero init (sync)"); + rc= init_thread_class(0); + ok(rc == 0, "zero init (thread)"); + rc= init_file_class(0); + ok(rc == 0, "zero init (file)"); + rc= init_table_share(0); + ok(rc == 0, "zero init (table)"); + + key= register_mutex_class("FOO", 3, 0); + ok(key == 0, "no mutex registered"); + key= register_mutex_class("BAR", 3, 0); + ok(key == 0, "no mutex registered"); + key= register_mutex_class("FOO", 3, 0); + ok(key == 0, "no mutex registered"); + + key= register_rwlock_class("FOO", 3, 0); + ok(key == 0, "no rwlock registered"); + key= register_rwlock_class("BAR", 3, 0); + ok(key == 0, "no rwlock registered"); + key= register_rwlock_class("FOO", 3, 0); + ok(key == 0, "no rwlock registered"); + + key= register_cond_class("FOO", 3, 0); + ok(key == 0, "no cond registered"); + key= register_cond_class("BAR", 3, 0); + ok(key == 0, "no cond registered"); + key= register_cond_class("FOO", 3, 0); + ok(key == 0, "no cond registered"); + + thread_key= register_thread_class("FOO", 3, 0); + ok(thread_key == 0, "no thread registered"); + thread_key= register_thread_class("BAR", 3, 0); + ok(thread_key == 0, "no thread registered"); + thread_key= register_thread_class("FOO", 3, 0); + ok(thread_key == 0, "no thread registered"); + + file_key= register_file_class("FOO", 3, 0); + ok(file_key == 0, "no file registered"); + file_key= register_file_class("BAR", 3, 0); + ok(file_key == 0, "no file registered"); + file_key= register_file_class("FOO", 3, 0); + ok(file_key == 0, "no file registered"); + + PFS_thread fake_thread; + fake_thread.m_table_share_hash_pins= NULL; + + table= find_or_create_table_share(& fake_thread, "foo_db", 6, "foo_table", 9); + ok(table == NULL, "not created"); + table= find_or_create_table_share(& fake_thread, "bar_db", 6, "bar_table", 9); + ok(table == NULL, "not created"); + table= find_or_create_table_share(& fake_thread, "foo_db", 6, "foo_table", 9); + ok(table == NULL, "not created"); + + mutex= find_mutex_class(0); + ok(mutex == NULL, "no mutex key 0"); + mutex= find_mutex_class(1); + ok(mutex == NULL, "no mutex key 1"); + mutex= find_mutex_class(9999); + ok(mutex == NULL, "no mutex key 9999"); + + rwlock= find_rwlock_class(0); + ok(rwlock == NULL, "no rwlock key 0"); + rwlock= find_rwlock_class(1); + ok(rwlock == NULL, "no rwlock key 1"); + rwlock= find_rwlock_class(9999); + ok(rwlock == NULL, "no rwlock key 9999"); + + cond= find_cond_class(0); + ok(cond == NULL, "no cond key 0"); + cond= find_cond_class(1); + ok(cond == NULL, "no cond key 1"); + cond= find_cond_class(9999); + ok(cond == NULL, "no cond key 9999"); + + thread= find_thread_class(0); + ok(thread == NULL, "no thread key 0"); + thread= find_thread_class(1); + ok(thread == NULL, "no thread key 1"); + thread= find_thread_class(9999); + ok(thread == NULL, "no thread key 9999"); + + file= find_file_class(0); + ok(file == NULL, "no file key 0"); + file= find_file_class(1); + ok(file == NULL, "no file key 1"); + file= find_file_class(9999); + ok(file == NULL, "no file key 9999"); + + cleanup_sync_class(); + cleanup_thread_class(); + cleanup_file_class(); + cleanup_table_share(); +} + +void test_mutex_registration() +{ + int rc; + PFS_sync_key key; + PFS_mutex_class *mutex; + + rc= init_sync_class(5, 0, 0); + ok(rc == 0, "room for 5 mutex"); + + key= register_mutex_class("FOO", 3, 0); + ok(key == 1, "foo registered"); + key= register_mutex_class("BAR", 3, 0); + ok(key == 2, "bar registered"); + key= register_mutex_class("FOO", 3, 0); + ok(key == 1, "foo re registered"); + key= register_mutex_class("M-3", 3, 0); + ok(key == 3, "M-3 registered"); + key= register_mutex_class("M-4", 3, 0); + ok(key == 4, "M-4 registered"); + key= register_mutex_class("M-5", 3, 0); + ok(key == 5, "M-5 registered"); + ok(mutex_class_lost == 0, "lost nothing"); + key= register_mutex_class("M-6", 3, 0); + ok(key == 0, "M-6 not registered"); + ok(mutex_class_lost == 1, "lost 1 mutex"); + key= register_mutex_class("M-7", 3, 0); + ok(key == 0, "M-7 not registered"); + ok(mutex_class_lost == 2, "lost 2 mutex"); + key= register_mutex_class("M-3", 3, 0); + ok(key == 3, "M-3 re registered"); + ok(mutex_class_lost == 2, "lost 2 mutex"); + key= register_mutex_class("M-5", 3, 0); + ok(key == 5, "M-5 re registered"); + ok(mutex_class_lost == 2, "lost 2 mutex"); + + mutex= find_mutex_class(0); + ok(mutex == NULL, "no key 0"); + mutex= find_mutex_class(3); + ok(mutex != NULL, "found key 3"); + ok(strncmp(mutex->m_name, "M-3", 3) == 0, "key 3 is M-3"); + ok(mutex->m_name_length == 3, "name length 3"); + mutex= find_mutex_class(9999); + ok(mutex == NULL, "no key 9999"); + + cleanup_sync_class(); +} + +void test_rwlock_registration() +{ + int rc; + PFS_sync_key key; + PFS_rwlock_class *rwlock; + + rc= init_sync_class(0, 5, 0); + ok(rc == 0, "room for 5 rwlock"); + + key= register_rwlock_class("FOO", 3, 0); + ok(key == 1, "foo registered"); + key= register_rwlock_class("BAR", 3, 0); + ok(key == 2, "bar registered"); + key= register_rwlock_class("FOO", 3, 0); + ok(key == 1, "foo re registered"); + key= register_rwlock_class("RW-3", 4, 0); + ok(key == 3, "RW-3 registered"); + key= register_rwlock_class("RW-4", 4, 0); + ok(key == 4, "RW-4 registered"); + key= register_rwlock_class("RW-5", 4, 0); + ok(key == 5, "RW-5 registered"); + key= register_rwlock_class("RW-6", 4, 0); + ok(key == 0, "RW-6 not registered"); + key= register_rwlock_class("RW-7", 4, 0); + ok(key == 0, "RW-7 not registered"); + key= register_rwlock_class("RW-3", 4, 0); + ok(key == 3, "RW-3 re registered"); + key= register_rwlock_class("RW-5", 4, 0); + ok(key == 5, "RW-5 re registered"); + + rwlock= find_rwlock_class(0); + ok(rwlock == NULL, "no key 0"); + rwlock= find_rwlock_class(3); + ok(rwlock != NULL, "found key 3"); + ok(strncmp(rwlock->m_name, "RW-3", 4) == 0, "key 3 is RW-3"); + ok(rwlock->m_name_length == 4, "name length 4"); + rwlock= find_rwlock_class(9999); + ok(rwlock == NULL, "no key 9999"); + + cleanup_sync_class(); +} + +void test_cond_registration() +{ + int rc; + PFS_sync_key key; + PFS_cond_class *cond; + + rc= init_sync_class(0, 0, 5); + ok(rc == 0, "room for 5 cond"); + + key= register_cond_class("FOO", 3, 0); + ok(key == 1, "foo registered"); + key= register_cond_class("BAR", 3, 0); + ok(key == 2, "bar registered"); + key= register_cond_class("FOO", 3, 0); + ok(key == 1, "foo re registered"); + key= register_cond_class("C-3", 3, 0); + ok(key == 3, "C-3 registered"); + key= register_cond_class("C-4", 3, 0); + ok(key == 4, "C-4 registered"); + key= register_cond_class("C-5", 3, 0); + ok(key == 5, "C-5 registered"); + key= register_cond_class("C-6", 3, 0); + ok(key == 0, "C-6 not registered"); + key= register_cond_class("C-7", 3, 0); + ok(key == 0, "C-7 not registered"); + key= register_cond_class("C-3", 3, 0); + ok(key == 3, "C-3 re registered"); + key= register_cond_class("C-5", 3, 0); + ok(key == 5, "C-5 re registered"); + + cond= find_cond_class(0); + ok(cond == NULL, "no key 0"); + cond= find_cond_class(3); + ok(cond != NULL, "found key 3"); + ok(strncmp(cond->m_name, "C-3", 3) == 0, "key 3 is C-3"); + ok(cond->m_name_length == 3, "name length 3"); + cond= find_cond_class(9999); + ok(cond == NULL, "no key 9999"); + + cleanup_sync_class(); +} + +void test_thread_registration() +{ + int rc; + PFS_thread_key key; + PFS_thread_class *thread; + + rc= init_thread_class(5); + ok(rc == 0, "room for 5 thread"); + + key= register_thread_class("FOO", 3, 0); + ok(key == 1, "foo registered"); + key= register_thread_class("BAR", 3, 0); + ok(key == 2, "bar registered"); + key= register_thread_class("FOO", 3, 0); + ok(key == 1, "foo re registered"); + key= register_thread_class("Thread-3", 8, 0); + ok(key == 3, "Thread-3 registered"); + key= register_thread_class("Thread-4", 8, 0); + ok(key == 4, "Thread-4 registered"); + key= register_thread_class("Thread-5", 8, 0); + ok(key == 5, "Thread-5 registered"); + key= register_thread_class("Thread-6", 8, 0); + ok(key == 0, "Thread-6 not registered"); + key= register_thread_class("Thread-7", 8, 0); + ok(key == 0, "Thread-7 not registered"); + key= register_thread_class("Thread-3", 8, 0); + ok(key == 3, "Thread-3 re registered"); + key= register_thread_class("Thread-5", 8, 0); + ok(key == 5, "Thread-5 re registered"); + + thread= find_thread_class(0); + ok(thread == NULL, "no key 0"); + thread= find_thread_class(3); + ok(thread != NULL, "found key 3"); + ok(strncmp(thread->m_name, "Thread-3", 8) == 0, "key 3 is Thread-3"); + ok(thread->m_name_length == 8, "name length 8"); + thread= find_thread_class(9999); + ok(thread == NULL, "no key 9999"); + + cleanup_thread_class(); +} + +void test_file_registration() +{ + int rc; + PFS_file_key key; + PFS_file_class *file; + + rc= init_file_class(5); + ok(rc == 0, "room for 5 file"); + + key= register_file_class("FOO", 3, 0); + ok(key == 1, "foo registered"); + key= register_file_class("BAR", 3, 0); + ok(key == 2, "bar registered"); + key= register_file_class("FOO", 3, 0); + ok(key == 1, "foo re registered"); + key= register_file_class("File-3", 6, 0); + ok(key == 3, "File-3 registered"); + key= register_file_class("File-4", 6, 0); + ok(key == 4, "File-4 registered"); + key= register_file_class("File-5", 6, 0); + ok(key == 5, "File-5 registered"); + key= register_file_class("File-6", 6, 0); + ok(key == 0, "File-6 not registered"); + key= register_file_class("File-7", 6, 0); + ok(key == 0, "File-7 not registered"); + key= register_file_class("File-3", 6, 0); + ok(key == 3, "File-3 re registered"); + key= register_file_class("File-5", 6, 0); + ok(key == 5, "File-5 re registered"); + + file= find_file_class(0); + ok(file == NULL, "no key 0"); + file= find_file_class(3); + ok(file != NULL, "found key 3"); + ok(strncmp(file->m_name, "File-3", 6) == 0, "key 3 is File-3"); + ok(file->m_name_length == 6, "name length 6"); + file= find_file_class(9999); + ok(file == NULL, "no key 9999"); + + cleanup_file_class(); +} + +void test_table_registration() +{ + PFS_table_share *table_share; + PFS_table_share *table_share_2; + + PFS_thread fake_thread; + fake_thread.m_table_share_hash_pins= NULL; + + table_share_lost= 0; + table_share= find_or_create_table_share(& fake_thread, "db1", 3, "t1", 2); + ok(table_share == NULL, "not created"); + ok(table_share_lost == 1, "lost the table"); + + table_share_lost= 0; + init_table_share(5); + init_table_share_hash(); + + table_share= find_or_create_table_share(& fake_thread, "db1", 3, "t1", 2); + ok(table_share != NULL, "created db1.t1"); + ok(table_share_lost == 0, "not lost"); + + table_share_2= find_or_create_table_share(& fake_thread, "db1", 3, "t1", 2); + ok(table_share_2 != NULL, "found db1.t1"); + ok(table_share_lost == 0, "not lost"); + ok(table_share == table_share_2, "same table"); + + table_share_2= find_or_create_table_share(& fake_thread, "db1", 3, "t2", 2); + ok(table_share_2 != NULL, "created db1.t2"); + ok(table_share_lost == 0, "not lost"); + + table_share_2= find_or_create_table_share(& fake_thread, "db2", 3, "t1", 2); + ok(table_share_2 != NULL, "created db2.t1"); + ok(table_share_lost == 0, "not lost"); + + table_share_2= find_or_create_table_share(& fake_thread, "db2", 3, "t2", 2); + ok(table_share_2 != NULL, "created db2.t2"); + ok(table_share_lost == 0, "not lost"); + + table_share_2= find_or_create_table_share(& fake_thread, "db3", 3, "t3", 2); + ok(table_share_2 != NULL, "created db3.t3"); + ok(table_share_lost == 0, "not lost"); + + table_share_2= find_or_create_table_share(& fake_thread, "db4", 3, "t4", 2); + ok(table_share_2 == NULL, "lost db4.t4"); + ok(table_share_lost == 1, "lost"); + + table_share_lost= 0; + table_share_2= find_or_create_table_share(& fake_thread, "db1", 3, "t2", 2); + ok(table_share_2 != NULL, "found db1.t2"); + ok(table_share_lost == 0, "not lost"); + ok(strncmp(table_share_2->m_schema_name, "db1", 3) == 0 , "schema db1"); + ok(table_share_2->m_schema_name_length == 3, "length 3"); + ok(strncmp(table_share_2->m_table_name, "t2", 2) == 0 , "table t2"); + ok(table_share_2->m_table_name_length == 2, "length 2"); + + cleanup_table_share_hash(); + cleanup_table_share(); +} + +void set_wait_stat(PFS_single_stat_chain *stat) +{ + stat->m_count= 12; + stat->m_min= 5; + stat->m_max= 120; + stat->m_sum= 999; +} + +bool is_empty_stat(PFS_single_stat_chain *stat) +{ + if (stat->m_count != 0) + return false; + if (stat->m_min != (ulonglong) -1) + return false; + if (stat->m_max != 0) + return false; + if (stat->m_sum != 0) + return false; + return true; +} + +void test_instruments_reset() +{ + int rc; + PFS_sync_key key; + PFS_file_key file_key; + PFS_mutex_class *mutex_1; + PFS_mutex_class *mutex_2; + PFS_mutex_class *mutex_3; + PFS_rwlock_class *rwlock_1; + PFS_rwlock_class *rwlock_2; + PFS_rwlock_class *rwlock_3; + PFS_cond_class *cond_1; + PFS_cond_class *cond_2; + PFS_cond_class *cond_3; + PFS_file_class *file_1; + PFS_file_class *file_2; + PFS_file_class *file_3; + + rc= init_sync_class(3, 3, 3); + ok(rc == 0, "init (sync)"); + rc= init_thread_class(3); + ok(rc == 0, "init (thread)"); + rc= init_file_class(3); + ok(rc == 0, "init (file)"); + + key= register_mutex_class("M-1", 3, 0); + ok(key == 1, "mutex registered"); + key= register_mutex_class("M-2", 3, 0); + ok(key == 2, "mutex registered"); + key= register_mutex_class("M-3", 3, 0); + ok(key == 3, "mutex registered"); + + key= register_rwlock_class("RW-1", 4, 0); + ok(key == 1, "rwlock registered"); + key= register_rwlock_class("RW-2", 4, 0); + ok(key == 2, "rwlock registered"); + key= register_rwlock_class("RW-3", 4, 0); + ok(key == 3, "rwlock registered"); + + key= register_cond_class("C-1", 3, 0); + ok(key == 1, "cond registered"); + key= register_cond_class("C-2", 3, 0); + ok(key == 2, "cond registered"); + key= register_cond_class("C-3", 3, 0); + ok(key == 3, "cond registered"); + + file_key= register_file_class("F-1", 3, 0); + ok(file_key == 1, "file registered"); + file_key= register_file_class("F-2", 3, 0); + ok(file_key == 2, "file registered"); + file_key= register_file_class("F-3", 3, 0); + ok(file_key == 3, "file registered"); + + mutex_1= find_mutex_class(1); + ok(mutex_1 != NULL, "mutex key 1"); + mutex_2= find_mutex_class(2); + ok(mutex_2 != NULL, "mutex key 2"); + mutex_3= find_mutex_class(3); + ok(mutex_3 != NULL, "mutex key 3"); + + rwlock_1= find_rwlock_class(1); + ok(rwlock_1 != NULL, "rwlock key 1"); + rwlock_2= find_rwlock_class(2); + ok(rwlock_2 != NULL, "rwlock key 2"); + rwlock_3= find_rwlock_class(3); + ok(rwlock_3 != NULL, "rwlock key 3"); + + cond_1= find_cond_class(1); + ok(cond_1 != NULL, "cond key 1"); + cond_2= find_cond_class(2); + ok(cond_2 != NULL, "cond key 2"); + cond_3= find_cond_class(3); + ok(cond_3 != NULL, "cond key 3"); + + file_1= find_file_class(1); + ok(file_1 != NULL, "file key 1"); + file_2= find_file_class(2); + ok(file_2 != NULL, "file key 2"); + file_3= find_file_class(3); + ok(file_3 != NULL, "file key 3"); + + set_wait_stat(& mutex_1->m_wait_stat); + set_wait_stat(& mutex_2->m_wait_stat); + set_wait_stat(& mutex_3->m_wait_stat); + set_wait_stat(& rwlock_1->m_wait_stat); + set_wait_stat(& rwlock_2->m_wait_stat); + set_wait_stat(& rwlock_3->m_wait_stat); + set_wait_stat(& cond_1->m_wait_stat); + set_wait_stat(& cond_2->m_wait_stat); + set_wait_stat(& cond_3->m_wait_stat); + set_wait_stat(& file_1->m_wait_stat); + set_wait_stat(& file_2->m_wait_stat); + set_wait_stat(& file_3->m_wait_stat); + + ok(! is_empty_stat(& mutex_1->m_wait_stat), "mutex_1 stat is populated"); + ok(! is_empty_stat(& mutex_2->m_wait_stat), "mutex_2 stat is populated"); + ok(! is_empty_stat(& mutex_3->m_wait_stat), "mutex_3 stat is populated"); + ok(! is_empty_stat(& rwlock_1->m_wait_stat), "rwlock_1 stat is populated"); + ok(! is_empty_stat(& rwlock_2->m_wait_stat), "rwlock_2 stat is populated"); + ok(! is_empty_stat(& rwlock_3->m_wait_stat), "rwlock_3 stat is populated"); + ok(! is_empty_stat(& cond_1->m_wait_stat), "cond_1 stat is populated"); + ok(! is_empty_stat(& cond_2->m_wait_stat), "cond_2 stat is populated"); + ok(! is_empty_stat(& cond_3->m_wait_stat), "cond_3 stat is populated"); + ok(! is_empty_stat(& file_1->m_wait_stat), "file_1 stat is populated"); + ok(! is_empty_stat(& file_2->m_wait_stat), "file_2 stat is populated"); + ok(! is_empty_stat(& file_3->m_wait_stat), "file_3 stat is populated"); + + reset_instrument_class_waits(); + + ok(is_empty_stat(& mutex_1->m_wait_stat), "mutex_1 stat is cleared"); + ok(is_empty_stat(& mutex_2->m_wait_stat), "mutex_2 stat is cleared"); + ok(is_empty_stat(& mutex_3->m_wait_stat), "mutex_3 stat is cleared"); + ok(is_empty_stat(& rwlock_1->m_wait_stat), "rwlock_1 stat is cleared"); + ok(is_empty_stat(& rwlock_2->m_wait_stat), "rwlock_2 stat is cleared"); + ok(is_empty_stat(& rwlock_3->m_wait_stat), "rwlock_3 stat is cleared"); + ok(is_empty_stat(& cond_1->m_wait_stat), "cond_1 stat is cleared"); + ok(is_empty_stat(& cond_2->m_wait_stat), "cond_2 stat is cleared"); + ok(is_empty_stat(& cond_3->m_wait_stat), "cond_3 stat is cleared"); + ok(is_empty_stat(& file_1->m_wait_stat), "file_1 stat is cleared"); + ok(is_empty_stat(& file_2->m_wait_stat), "file_2 stat is cleared"); + ok(is_empty_stat(& file_3->m_wait_stat), "file_3 stat is cleared"); + + cleanup_sync_class(); + cleanup_file_class(); +} + +void do_all_tests() +{ + test_no_registration(); + test_mutex_registration(); + test_rwlock_registration(); + test_cond_registration(); + test_thread_registration(); + test_file_registration(); + test_table_registration(); + test_instruments_reset(); +} + +int main(int, char **) +{ + plan(196); + MY_INIT("pfs_instr_info-t"); + do_all_tests(); + return 0; +} + diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc new file mode 100644 index 00000000000..8fa29306982 --- /dev/null +++ b/storage/perfschema/unittest/pfs_timer-t.cc @@ -0,0 +1,116 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include + +void test_timers() +{ + ulonglong t1_a; + ulonglong t2_a; + ulonglong t3_a; + ulonglong t4_a; + ulonglong t5_a; + ulonglong t1_b; + ulonglong t2_b; + ulonglong t3_b; + ulonglong t4_b; + ulonglong t5_b; + + init_timers(); + + t1_a= get_timer_value(TIMER_NAME_CYCLE); + /* Wait 5 seconds */ + my_sleep(5000000); + t1_b= get_timer_value(TIMER_NAME_CYCLE); + + t2_a= get_timer_value(TIMER_NAME_NANOSEC); + my_sleep(5000000); + t2_b= get_timer_value(TIMER_NAME_NANOSEC); + + t3_a= get_timer_value(TIMER_NAME_MICROSEC); + my_sleep(5000000); + t3_b= get_timer_value(TIMER_NAME_MICROSEC); + + t4_a= get_timer_value(TIMER_NAME_MILLISEC); + my_sleep(5000000); + t4_b= get_timer_value(TIMER_NAME_MILLISEC); + + t5_a= get_timer_value(TIMER_NAME_TICK); + my_sleep(5000000); + t5_b= get_timer_value(TIMER_NAME_TICK); + + /* + Print the timer values, for manual inspection by a human. + Tests involving low level timers can not be automated. + */ + diag("cycle a: %13llu", t1_a); + diag("nano a: %13llu", t2_a); + diag("micro a: %13llu", t3_a); + diag("milli a: %13llu", t4_a); + diag("tick a: %13llu", t5_a); + + diag("cycle b: %13llu", t1_b); + diag("nano b: %13llu", t2_b); + diag("micro b: %13llu", t3_b); + diag("milli b: %13llu", t4_b); + diag("tick b: %13llu", t5_b); + + diag("cycle b-a: %13llu", t1_b-t1_a); + diag("nano b-a: %13llu", t2_b-t2_a); + diag("micro b-a: %13llu", t3_b-t3_a); + diag("milli b-a: %13llu", t4_b-t4_a); + diag("tick b-a: %13llu", t5_b-t5_a); + + if ((t1_a == 0) && (t1_b == 0)) + skip(1, "cycle timer not implemented"); + else + ok(t1_b > t1_a, "cycle timer ascending"); + + if ((t2_a == 0) && (t2_b == 0)) + skip(1, "nano timer not implemented"); + else + ok(t2_b > t2_a, "nano timer ascending"); + + if ((t3_a == 0) && (t3_b == 0)) + skip(1, "micro timer not implemented"); + else + ok(t3_b > t3_a, "micro timer ascending"); + + if ((t4_a == 0) && (t4_b == 0)) + skip(1, "milli timer not implemented"); + else + ok(t4_b > t4_a, "milli timer ascending"); + + if ((t5_a == 0) && (t5_b == 0)) + skip(1, "tick timer not implemented"); + else + ok(t5_b > t5_a, "tick timer ascending"); +} + +void do_all_tests() +{ + test_timers(); +} + +int main(int, char **) +{ + plan(5); + MY_INIT("pfs_timer-t"); + do_all_tests(); + return 0; +} + diff --git a/storage/perfschema/unittest/stub_pfs_global.h b/storage/perfschema/unittest/stub_pfs_global.h new file mode 100644 index 00000000000..85088061d3f --- /dev/null +++ b/storage/perfschema/unittest/stub_pfs_global.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include + +bool pfs_initialized= false; + +bool stub_alloc_always_fails= true; +int stub_alloc_fails_after_count= 0; + +void *pfs_malloc(size_t, myf) +{ + static char garbage[100]; + + if (stub_alloc_always_fails) + return NULL; + + if (--stub_alloc_fails_after_count <= 0) + return NULL; + + return garbage; +} + +void pfs_free(void *) +{ +} + diff --git a/storage/perfschema/unittest/stub_print_error.h b/storage/perfschema/unittest/stub_print_error.h new file mode 100644 index 00000000000..12dabb46ceb --- /dev/null +++ b/storage/perfschema/unittest/stub_print_error.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2008-2009 Sun Microsystems, Inc + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include +#include +#include + +bool pfs_initialized= false; + +void *pfs_malloc(size_t size, myf flags) +{ + void *ptr= malloc(size); + if (ptr && (flags & MY_ZEROFILL)) + memset(ptr, 0, size); + return ptr; +} + +void pfs_free(void *ptr) +{ + if (ptr != NULL) + free(ptr); +} + +void pfs_print_error(const char *format, ...) +{ + /* Do not pollute the unit test output with annoying messages. */ +} + From 50561ab0108dcb427ba0975f11dcab3e20b05612 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Tue, 12 Jan 2010 19:48:28 +0300 Subject: [PATCH 58/69] Enable WL#4435. --- libmysql/client_settings.h | 3 ++- tests/mysql_client_test.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libmysql/client_settings.h b/libmysql/client_settings.h index fa92dfb2687..aaec08d1b1e 100644 --- a/libmysql/client_settings.h +++ b/libmysql/client_settings.h @@ -27,7 +27,8 @@ extern char * mysql_unix_port; CLIENT_TRANSACTIONS | \ CLIENT_PROTOCOL_41 | \ CLIENT_SECURE_CONNECTION | \ - CLIENT_MULTI_RESULTS) + CLIENT_MULTI_RESULTS | \ + CLIENT_PS_MULTI_RESULTS) sig_handler my_pipe_sig_handler(int sig); void read_user_name(char *name); diff --git a/tests/mysql_client_test.c b/tests/mysql_client_test.c index 1b7fc76c300..e9c70257e01 100644 --- a/tests/mysql_client_test.c +++ b/tests/mysql_client_test.c @@ -19197,7 +19197,7 @@ static struct my_tests_st my_tests[]= { { "test_wl4166_3", test_wl4166_3 }, { "test_wl4166_4", test_wl4166_4 }, { "test_bug36004", test_bug36004 }, -/* { "test_wl4435", test_wl4435 }, */ + { "test_wl4435", test_wl4435 }, { "test_wl4435_2", test_wl4435_2 }, { "test_bug38486", test_bug38486 }, { "test_bug33831", test_bug33831 }, From ca15e2779f0f40d64b72f61c4fc33f7305b3bcd2 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 12 Jan 2010 17:52:02 +0000 Subject: [PATCH 59/69] Fixes for three test failures: - sys_vars.all_vars: Added test case for slave_type_conversions variable - rpl_row_idempotency Removed ER_SLAVE_AMBIGOUS_EXEC_MODE (which was removed by WL 4738) from the test case. Using ER_WRONG_VALUE_FOR_VAR instead. - mysqld--help-win Added missing help for --slave-type-conversions from the result file. --- mysql-test/r/mysqld--help-win.result | 6 +++++ .../suite/rpl/r/rpl_row_idempotency.result | 2 +- .../suite/rpl/t/rpl_row_idempotency.test | 2 +- .../r/slave_type_conversions_basic.result | 26 +++++++++++++++++++ .../t/slave_type_conversions_basic.test | 22 ++++++++++++++++ 5 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 mysql-test/suite/sys_vars/r/slave_type_conversions_basic.result create mode 100644 mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index 5627716f6ec..abe391c8ce8 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -622,6 +622,12 @@ The following options may be given as the first argument: Number of times the slave SQL thread will retry a transaction in case it failed with a deadlock or elapsed lock wait timeout, before giving up and stopping + --slave-type-conversions=name + Set of slave type conversions that are enabled. Legal + values are: ALL_LOSSY to enable lossy conversions and + ALL_NON_LOSSY to enable non-lossy conversions. If the + variable is assigned the empty set, no conversions are + allowed and it is expected that the types match exactly. --slow-launch-time=# If creating the thread takes longer than this value (in seconds), the Slow_launch_threads counter will be diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result index ccb7ce774e5..fcc68cd4712 100644 --- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result @@ -46,7 +46,7 @@ a b set global slave_exec_mode='IDEMPOTENT'; set global slave_exec_mode='STRICT'; set global slave_exec_mode='IDEMPOTENT,STRICT'; -ERROR HY000: Ambiguous slave modes combination. +ERROR 42000: Variable 'slave_exec_mode' can't be set to the value of 'IDEMPOTENT,STRICT' select @@global.slave_exec_mode /* must be STRICT */; @@global.slave_exec_mode STRICT diff --git a/mysql-test/suite/rpl/t/rpl_row_idempotency.test b/mysql-test/suite/rpl/t/rpl_row_idempotency.test index ef8853dc50f..cd62280f1d4 100644 --- a/mysql-test/suite/rpl/t/rpl_row_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_row_idempotency.test @@ -90,7 +90,7 @@ set global slave_exec_mode='IDEMPOTENT'; set global slave_exec_mode='STRICT'; # checking mutual exclusion for the options ---error ER_SLAVE_AMBIGOUS_EXEC_MODE +--error ER_WRONG_VALUE_FOR_VAR set global slave_exec_mode='IDEMPOTENT,STRICT'; select @@global.slave_exec_mode /* must be STRICT */; diff --git a/mysql-test/suite/sys_vars/r/slave_type_conversions_basic.result b/mysql-test/suite/sys_vars/r/slave_type_conversions_basic.result new file mode 100644 index 00000000000..722d1b39e4f --- /dev/null +++ b/mysql-test/suite/sys_vars/r/slave_type_conversions_basic.result @@ -0,0 +1,26 @@ +set @saved_slave_type_conversions = @@global.slave_type_conversions; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions + +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions + +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_NON_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_LOSSY,ALL_NON_LOSSY +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT'; +ERROR 42000: Variable 'slave_type_conversions' can't be set to the value of 'NONEXISTING_BIT' +SELECT @@global.slave_type_conversions; +@@global.slave_type_conversions +ALL_LOSSY,ALL_NON_LOSSY +set global slave_type_conversions = @saved_slave_type_conversions; diff --git a/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test b/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test new file mode 100644 index 00000000000..c46045b35f7 --- /dev/null +++ b/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test @@ -0,0 +1,22 @@ + +set @saved_slave_type_conversions = @@global.slave_type_conversions; + +SELECT @@global.slave_type_conversions; +SET GLOBAL SLAVE_TYPE_CONVERSIONS=''; +SELECT @@global.slave_type_conversions; + +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; + +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY'; +SELECT @@global.slave_type_conversions; + +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY'; +SELECT @@global.slave_type_conversions; + +# checking that setting variable to a non existing value raises error +--error ER_WRONG_VALUE_FOR_VAR +SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY,NONEXISTING_BIT'; +SELECT @@global.slave_type_conversions; + +set global slave_type_conversions = @saved_slave_type_conversions; From 9d89069d6437d6112104725fc704128a4f907eed Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 12 Jan 2010 23:22:34 +0000 Subject: [PATCH 60/69] Fixes one more failure in gcov run: - sys_vars.rpl_init_slave_func Added suppression for the unsafe warning. --- mysql-test/suite/sys_vars/t/rpl_init_slave_func.test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test index 2a241b58807..1f5cfe795bf 100644 --- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test +++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test @@ -31,6 +31,9 @@ source include/master-slave.inc; --echo connection slave connection slave; +--disable_query_log +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); +--enable_query_log # # save the current values From 5f42365a93dee0a1ca719f3b8d4b2253567c4195 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 13 Jan 2010 00:23:07 +0000 Subject: [PATCH 61/69] Fixes two remaining test failures: - mysqld--help-win Updated result so that it contains missing value for slave-type-conversions - rpl_idempotency This seems a bad merge. In BUG#39934, the contents of this file had been split into rpl_row_idempontency and rpl_idempotency. The patch was pushed to 5.1-rep+3 which was later merged in rep+2-delivery1 which in turn was merged in 5.1-rpl-merge. Now while merging next-mr in 5.1-rpl-merge, the file got back it's old content (which is in rpl_row_idempotency now because of BUG#39934). This cset reverts the bad merge: bzr merge -r revid:dao-gang.qu@sun.com-20100112120709-ioxp11yl9bvquaqd..\ before:revid:dao-gang.qu@sun.com-20100112120709-ioxp11yl9bvquaqd\ suite/rpl/t/rpl_idempotency.test --- mysql-test/r/mysqld--help-win.result | 1 + mysql-test/suite/rpl/r/rpl_idempotency.result | 151 --------- mysql-test/suite/rpl/t/rpl_idempotency.test | 303 ------------------ 3 files changed, 1 insertion(+), 454 deletions(-) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index abe391c8ce8..6faeea94717 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -912,6 +912,7 @@ slave-load-tmpdir MYSQLTEST_VARDIR/tmp/ slave-net-timeout 3600 slave-skip-errors (No default value) slave-transaction-retries 10 +slave-type-conversions slow-launch-time 2 slow-query-log FALSE socket MySQL diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result index 0f171ad05cb..5e37e7a1f5e 100644 --- a/mysql-test/suite/rpl/r/rpl_idempotency.result +++ b/mysql-test/suite/rpl/r/rpl_idempotency.result @@ -74,155 +74,4 @@ a Last_SQL_Error 0 DROP TABLE t1, t2; -select @@global.slave_exec_mode /* must be IDEMPOTENT */; -@@global.slave_exec_mode -IDEMPOTENT -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) -engine = innodb; -set foreign_key_checks=1 /* ensure the check */; -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; -select * from ti1 order by b /* must be (1),(2),(3) */; -b -1 -2 -3 -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; -a b -1 1 -2 2 -set @save_binlog_format= @@session.binlog_format; -set @@session.binlog_format= row; -delete from ti1 where b=1; -select * from ti1 order by b /* must be (2),(3) */; -b -2 -3 -select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; -b -1 -2 -3 -delete from ti1 where b=3; -insert into ti2 set a=3, b=3; -select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; -a b -1 1 -2 2 -set global slave_exec_mode='IDEMPOTENT'; -set global slave_exec_mode='STRICT'; -set global slave_exec_mode='IDEMPOTENT,STRICT'; -ERROR 42000: Variable 'slave_exec_mode' can't be set to the value of 'IDEMPOTENT,STRICT' -select @@global.slave_exec_mode /* must be STRICT */; -@@global.slave_exec_mode -STRICT -*** foreign keys errors as above now forces to stop -set foreign_key_checks=0; -drop table ti2, ti1; -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) -engine = innodb; -set foreign_key_checks=1 /* ensure the check */; -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; -select * from ti1 order by b /* must be (1),(2),(3) */; -b -1 -2 -3 -*** conspire future problem -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; -a b -1 1 -2 2 -delete from ti1 where b=1 /* offending delete event */; -select * from ti1 order by b /* must be (2),(3) */; -b -2 -3 -*** slave must stop (Trying to delete a referenced foreing key) -Last_SQL_Error -1451 -select * from ti1 order by b /* must be (1),(2),(3) - not deleted */; -b -1 -2 -3 -set foreign_key_checks= 0; -delete from ti2 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -*** conspire the following insert failure -*** conspire future problem -delete from ti1 where b=3; -insert into ti2 set a=3, b=3 /* offending write event */; -*** slave must stop (Trying to insert an invalid foreign key) -Last_SQL_Error -1452 -select * from ti2 order by b /* must be (2,2) */; -a b -2 2 -set foreign_key_checks= 0; -insert into ti1 set b=3; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -select * from ti2 order by b /* must be (2,2),(3,3) */; -a b -2 2 -3 3 -*** other errors -*** conspiring query -insert into ti1 set b=1; -insert into ti1 set b=1 /* offending write event */; -*** slave must stop (Trying to insert a dupliacte key) -Last_SQL_Error -1062 -set foreign_key_checks= 0; -delete from ti1 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -CREATE TABLE t1 (a INT PRIMARY KEY); -CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (-1),(-2),(-3); -INSERT INTO t2 VALUES (-1),(-2),(-3); -DELETE FROM t1 WHERE a = -2; -DELETE FROM t2 WHERE a = -2; -DELETE FROM t1 WHERE a = -2; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -DELETE FROM t2 WHERE a = -2; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -UPDATE t1 SET a = 1 WHERE a = -1; -UPDATE t2 SET a = 1 WHERE a = -1; -UPDATE t1 SET a = 1 WHERE a = -1; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -set global slave_exec_mode='STRICT'; -UPDATE t2 SET a = 1 WHERE a = -1; -*** slave must stop (Key was not found) -Last_SQL_Error -1032 -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; SET @@global.slave_exec_mode= @old_slave_exec_mode; diff --git a/mysql-test/suite/rpl/t/rpl_idempotency.test b/mysql-test/suite/rpl/t/rpl_idempotency.test index 04c7836e854..a1931ce9b60 100644 --- a/mysql-test/suite/rpl/t/rpl_idempotency.test +++ b/mysql-test/suite/rpl/t/rpl_idempotency.test @@ -2,7 +2,6 @@ # work the same way under statement based as under row based. source include/master-slave.inc; -source include/have_innodb.inc; # Add suppression for expected warning(s) in slaves error log call mtr.add_suppression("Slave: Can't find record in 't.' Error_code: 1032"); @@ -88,306 +87,4 @@ connection master; DROP TABLE t1, t2; sync_slave_with_master; -# bug#31609 Not all RBR slave errors reported as errors -# bug#31552 Replication breaks when deleting rows from out-of-sync table -# without PK - -# -# Idempotent applying is not default any longer. -# The default for slave-exec-mode option and server -# variable slave_exec_mode is 'STRICT'. -# When 'STRICT' mode is set, the slave SQL thread will stop whenever -# the row to change is not found. In 'IDEMPOTENT' mode, the SQL thread -# will continue running and apply the row - replace if it's Write_rows event - -# or skip to the next event. - -# the previous part of the tests was with IDEMPOTENT slave's mode. - - -# -# Other than above idempotent errors dealing with foreign keys constraint -# - -select @@global.slave_exec_mode /* must be IDEMPOTENT */; - -connection master; - -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) - engine = innodb; -set foreign_key_checks=1 /* ensure the check */; - -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; - -sync_slave_with_master; - -#connection slave; -select * from ti1 order by b /* must be (1),(2),(3) */; -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; - -connection master; - -# from now on checking rbr specific idempotent errors -set @save_binlog_format= @@session.binlog_format; -set @@session.binlog_format= row; -delete from ti1 where b=1; - -select * from ti1 order by b /* must be (2),(3) */; - -# slave must catch up (expect some warnings in error.log) -sync_slave_with_master; - -#connection slave; -select * from ti1 order by b /* must stays as were on master (1),(2),(3) */; - -delete from ti1 where b=3; - -connection master; -insert into ti2 set a=3, b=3; - -# slave must catch up (expect some warnings in error.log) -sync_slave_with_master; - -#connection slave; -select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */; - - -# -# Checking the new global sys variable -# - -connection slave; - -set global slave_exec_mode='IDEMPOTENT'; -set global slave_exec_mode='STRICT'; - -# checking mutual exclusion for the options ---error ER_WRONG_VALUE_FOR_VAR -set global slave_exec_mode='IDEMPOTENT,STRICT'; - -select @@global.slave_exec_mode /* must be STRICT */; - -# -# Checking stops. -# In the following sections strict slave sql thread is going to -# stop when faces an idempotent error. In order to proceed -# the mode is temporarily switched to indempotent. -# - -# ---echo *** foreign keys errors as above now forces to stop -# - -connection master; - -set foreign_key_checks=0; -drop table ti2, ti1; - -create table ti1 (b int primary key) engine = innodb; -create table ti2 (a int primary key, b int, foreign key (b) references ti1(b)) - engine = innodb; -set foreign_key_checks=1 /* ensure the check */; - -insert into ti1 values (1),(2),(3); -insert into ti2 set a=2, b=2; - -sync_slave_with_master; - -#connection slave; -select * from ti1 order by b /* must be (1),(2),(3) */; ---echo *** conspire future problem -insert into ti2 set a=1, b=1; -select * from ti2 order by b /* must be (1,1) (2,2) */; - -connection master; - -delete from ti1 where b=1 /* offending delete event */; -select * from ti1 order by b /* must be (2),(3) */; - -# foreign key: row is referenced - ---echo *** slave must stop (Trying to delete a referenced foreing key) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -select * from ti1 order by b /* must be (1),(2),(3) - not deleted */; -set foreign_key_checks= 0; -delete from ti2 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -connection master; - -sync_slave_with_master; - -#connection slave; ---echo *** conspire the following insert failure -# foreign key: no referenced row - ---echo *** conspire future problem -delete from ti1 where b=3; - -connection master; -insert into ti2 set a=3, b=3 /* offending write event */; - ---echo *** slave must stop (Trying to insert an invalid foreign key) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -select * from ti2 order by b /* must be (2,2) */; -set foreign_key_checks= 0; -insert into ti1 set b=3; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -connection master; - -sync_slave_with_master; - -select * from ti2 order by b /* must be (2,2),(3,3) */; - -# ---echo *** other errors -# - -# dup key insert - -#connection slave; ---echo *** conspiring query -insert into ti1 set b=1; - -connection master; -insert into ti1 set b=1 /* offending write event */; - ---echo *** slave must stop (Trying to insert a dupliacte key) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set foreign_key_checks= 0; -delete from ti1 where b=1; -set foreign_key_checks= 1; -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -# key not found - -connection master; - -CREATE TABLE t1 (a INT PRIMARY KEY); -CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (-1),(-2),(-3); -INSERT INTO t2 VALUES (-1),(-2),(-3); -sync_slave_with_master; - -#connection slave; -DELETE FROM t1 WHERE a = -2; -DELETE FROM t2 WHERE a = -2; -connection master; -DELETE FROM t1 WHERE a = -2; - ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -connection master; -DELETE FROM t2 WHERE a = -2; ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - -UPDATE t1 SET a = 1 WHERE a = -1; -UPDATE t2 SET a = 1 WHERE a = -1; - -connection master; -UPDATE t1 SET a = 1 WHERE a = -1; - ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; -set global slave_exec_mode='STRICT'; - - -connection master; -UPDATE t2 SET a = 1 WHERE a = -1; - ---echo *** slave must stop (Key was not found) -connection slave; -source include/wait_for_slave_sql_to_stop.inc; - -let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Errno, 1); -disable_query_log; -eval SELECT "$last_error" AS Last_SQL_Error; -enable_query_log; - -set global slave_exec_mode='IDEMPOTENT'; -start slave sql_thread; -connection master; -sync_slave_with_master; -#connection slave; SET @@global.slave_exec_mode= @old_slave_exec_mode; From 26b12adb5d19fea7308edd0c2b49e1c972ea79c3 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 13 Jan 2010 08:29:23 +0000 Subject: [PATCH 62/69] Makes slave_type_conversions_basic to be skipped in embedded run in PB2 as it ought to be. Otherwise test will fail because variable is no recognized: 1193: Unknown system variable 'slave_type_conversions' --- mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test b/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test index c46045b35f7..c6debb076db 100644 --- a/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test +++ b/mysql-test/suite/sys_vars/t/slave_type_conversions_basic.test @@ -1,4 +1,6 @@ +--source include/not_embedded.inc + set @saved_slave_type_conversions = @@global.slave_type_conversions; SELECT @@global.slave_type_conversions; From a561e539434ec9b92f39b248329b1c5ac9d5ce94 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 13 Jan 2010 12:58:42 +0100 Subject: [PATCH 63/69] WL#5151: Conversion between different types when replicating Replace c_ptr() calls with c_ptr_safe() calls to avoid valgrind warnings. Adding code to to handle the case that no metadata was present in the table map for the column. Allow first parameter to unpack_row() to be NULL, in which case no source tables is used and hence no checks nor conversions are done. Clarifying some comments and fixing documentation for unpack_row(). --- sql/rpl_record.cc | 46 +++++++++++++++++++++++++++++----------------- sql/rpl_utility.cc | 21 +++++++++++++++++---- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index ab9b21b11a8..ea9b116b8d8 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -150,13 +150,20 @@ pack_row(TABLE *table, MY_BITMAP const* cols, the various member functions of Field and subclasses expect to write. - The row is assumed to only consist of the fields for which the corresponding - bit in bitset @c cols is set; the other parts of the record are left alone. + The row is assumed to only consist of the fields for which the + corresponding bit in bitset @c cols is set; the other parts of the + record are left alone. At most @c colcnt columns are read: if the table is larger than that, the remaining fields are not filled in. - @param rli Relay log info + @note The relay log information can be NULL, which means that no + checking or comparison with the source table is done, simply + because it is not used. This feature is used by MySQL Backup to + unpack a row from from the backup image, but can be used for other + purposes as well. + + @param rli Relay log info, which can be NULL @param table Table to unpack into @param colcnt Number of columns to read from record @param row_data @@ -170,10 +177,8 @@ pack_row(TABLE *table, MY_BITMAP const* cols, @retval 0 No error - @retval ER_NO_DEFAULT_FOR_FIELD - Returned if one of the fields existing on the slave but not on the - master does not have a default value (and isn't nullable) - + @retval HA_ERR_GENERIC + A generic, internal, error caused the unpacking to fail. */ #if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) int @@ -184,8 +189,8 @@ unpack_row(Relay_log_info const *rli, { DBUG_ENTER("unpack_row"); DBUG_ASSERT(row_data); + DBUG_ASSERT(table); size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8; - int error= 0; uchar const *null_ptr= row_data; uchar const *pack_ptr= row_data + master_null_byte_count; @@ -201,14 +206,21 @@ unpack_row(Relay_log_info const *rli, // The "current" null bits unsigned int null_bits= *null_ptr++; uint i= 0; - table_def *tabledef; - TABLE *conv_table; - bool table_found= rli->get_table_data(table, &tabledef, &conv_table); + table_def *tabledef= NULL; + TABLE *conv_table= NULL; + bool table_found= rli && rli->get_table_data(table, &tabledef, &conv_table); DBUG_PRINT("debug", ("Table data: table_found: %d, tabldef: %p, conv_table: %p", table_found, tabledef, conv_table)); DBUG_ASSERT(table_found); - if (!table_found) - return HA_ERR_GENERIC; + + /* + If rli is NULL it means that there is no source table and that the + row shall just be unpacked without doing any checks. This feature + is used by MySQL Backup, but can be used for other purposes as + well. + */ + if (rli && !table_found) + DBUG_RETURN(HA_ERR_GENERIC); for (field_ptr= begin_ptr ; field_ptr < end_ptr && *field_ptr ; ++field_ptr) { @@ -221,7 +233,7 @@ unpack_row(Relay_log_info const *rli, conv_table ? conv_table->field[field_ptr - begin_ptr] : NULL; Field *const f= conv_field ? conv_field : *field_ptr; - DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%d)", + DBUG_PRINT("debug", ("Conversion %srequired for field '%s' (#%ld)", conv_field ? "" : "not ", (*field_ptr)->field_name, field_ptr - begin_ptr)); DBUG_ASSERT(f != NULL); @@ -285,7 +297,7 @@ unpack_row(Relay_log_info const *rli, conv_field->val_str(&value_string); DBUG_PRINT("debug", ("Copying field '%s' of type '%s' with value '%s'", (*field_ptr)->field_name, - source_type.c_ptr(), value_string.c_ptr())); + source_type.c_ptr_safe(), value_string.c_ptr_safe())); #endif copy.set(*field_ptr, f, TRUE); (*copy.do_copy)(©); @@ -296,7 +308,7 @@ unpack_row(Relay_log_info const *rli, (*field_ptr)->val_str(&value_string); DBUG_PRINT("debug", ("Value of field '%s' of type '%s' is now '%s'", (*field_ptr)->field_name, - target_type.c_ptr(), value_string.c_ptr())); + target_type.c_ptr_safe(), value_string.c_ptr_safe())); #endif } @@ -344,7 +356,7 @@ unpack_row(Relay_log_info const *rli, *master_reclength = table->s->reclength; } - DBUG_RETURN(error); + DBUG_RETURN(0); } /** diff --git a/sql/rpl_utility.cc b/sql/rpl_utility.cc index 3a69c71b34c..c1d6ae03679 100644 --- a/sql/rpl_utility.cc +++ b/sql/rpl_utility.cc @@ -582,7 +582,7 @@ can_convert_field_to(Field *field, String field_type(field_type_buf, sizeof(field_type_buf), field->charset()); field->sql_type(field_type); DBUG_PRINT("enter", ("field_type: %s, target_type: %d, source_type: %d, source_metadata: 0x%x", - field_type.c_ptr(), field->real_type(), source_type, metadata)); + field_type.c_ptr_safe(), field->real_type(), source_type, metadata)); #endif /* If the real type is the same, we need to check the metadata to @@ -590,6 +590,19 @@ can_convert_field_to(Field *field, */ if (field->real_type() == source_type) { + if (metadata == 0) // Metadata can only be zero if no metadata was provided + { + /* + If there is no metadata, we either have an old event where no + metadata were supplied, or a type that does not require any + metadata. In either case, conversion can be done but no + conversion table is necessary. + */ + DBUG_PRINT("debug", ("Base types are identical, but there is no metadata")); + *order_var= 0; + DBUG_RETURN(true); + } + DBUG_PRINT("debug", ("Base types are identical, doing field size comparison")); if (field->compatible_field_size(metadata, rli, mflags, order_var)) DBUG_RETURN(is_conversion_ok(*order_var, rli)); @@ -816,7 +829,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, rli->report(ERROR_LEVEL, ER_SLAVE_CONVERSION_FAILED, ER(ER_SLAVE_CONVERSION_FAILED), col, db_name, tbl_name, - source_type.c_ptr(), target_type.c_ptr()); + source_type.c_ptr_safe(), target_type.c_ptr_safe()); return false; } } @@ -836,7 +849,7 @@ table_def::compatible_with(THD *thd, Relay_log_info *rli, DBUG_PRINT("debug", ("Field %s - conversion required." " Source type: '%s', Target type: '%s'", tmp_table->field[col]->field_name, - source_type.c_ptr(), target_type.c_ptr())); + source_type.c_ptr_safe(), target_type.c_ptr_safe())); } } #endif @@ -920,7 +933,7 @@ TABLE *table_def::create_conversion_table(THD *thd, Relay_log_info *rli, TABLE * field_def->init_for_tmp_table(type(col), max_length, decimals, - maybe_null(col), // maybe_null + TRUE, // maybe_null FALSE, // unsigned_flag pack_length); field_def->charset= target_table->field[col]->charset(); From cf40bc3f56859a73001deb03502f6cdb72ea0f61 Mon Sep 17 00:00:00 2001 From: Mats Kindahl Date: Wed, 13 Jan 2010 13:59:58 +0100 Subject: [PATCH 64/69] Replacing error variable that was lost. --- sql/rpl_record.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/rpl_record.cc b/sql/rpl_record.cc index ea9b116b8d8..37d10d36bd7 100644 --- a/sql/rpl_record.cc +++ b/sql/rpl_record.cc @@ -191,6 +191,7 @@ unpack_row(Relay_log_info const *rli, DBUG_ASSERT(row_data); DBUG_ASSERT(table); size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8; + int error= 0; uchar const *null_ptr= row_data; uchar const *pack_ptr= row_data + master_null_byte_count; @@ -356,7 +357,7 @@ unpack_row(Relay_log_info const *rli, *master_reclength = table->s->reclength; } - DBUG_RETURN(0); + DBUG_RETURN(error); } /** From 18a8f3c8cc00f8bfa59f982fcf39edb89d941ef0 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Wed, 13 Jan 2010 23:27:22 +0000 Subject: [PATCH 65/69] Disabled binlog_unsafe due to BUG#50312. --- mysql-test/suite/binlog/t/disabled.def | 1 + 1 file changed, 1 insertion(+) diff --git a/mysql-test/suite/binlog/t/disabled.def b/mysql-test/suite/binlog/t/disabled.def index 0018387de94..a86136fec69 100644 --- a/mysql-test/suite/binlog/t/disabled.def +++ b/mysql-test/suite/binlog/t/disabled.def @@ -10,4 +10,5 @@ # ############################################################################## binlog_truncate_innodb : BUG#42643 2009-02-06 mats Changes to InnoDB requires to complete fix for BUG#36763 +binlog_unsafe : BUG#50312 2010-01-13 lsoares Warnings for unsafe sub-statement not returned to client From eef6ea03d20767f4b56ca07d20d9686a6c83c29f Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Thu, 14 Jan 2010 12:52:28 +0000 Subject: [PATCH 66/69] Augmented the rpl_ndb_binlog_format_errors to verify if a slave running in the STMT mode aborts the SQL Thread if it receives changes in ROW mode and such changes are not processed. --- .../r/rpl_ndb_binlog_format_errors.result | 42 +++++++++++++++++-- .../t/rpl_ndb_binlog_format_errors.test | 28 +++++++++++-- 2 files changed, 63 insertions(+), 7 deletions(-) diff --git a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result index f15cb7775ca..35f54455179 100644 --- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result @@ -37,14 +37,22 @@ CREATE TRIGGER trig_1 AFTER INSERT ON t_self_logging FOR EACH ROW BEGIN INSERT I INSERT INTO t_self_logging VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since more than one engine is involved and at least one engine is self-logging. DROP trigger trig_1; +SELECT * FROM t_self_logging /* Should be empty */; +a +SELECT * FROM t /* Should be empty */; +a * Modify both row-only and stmt-only table CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END; INSERT INTO t_stmt VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since both row-incapable engines and statement-incapable engines are involved. +SELECT * FROM t_stmt /* should be empty */; +a DROP TRIGGER trig_2; * Stmt-only table and binlog_format=row INSERT INTO t_stmt VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = ROW and at least one table uses a storage engine limited to statement-logging. +SELECT * FROM t_stmt /* should be empty */; +a * Row injection and stmt-only table: in slave sql thread INSERT INTO t_slave_stmt VALUES (1); [on slave] @@ -52,12 +60,17 @@ INSERT INTO t_slave_stmt VALUES (1); Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging.' on opening tables set global sql_slave_skip_counter=1; include/start_slave.inc +SELECT * FROM t_slave_stmt /* should be empty */; +a +[on master] * Row injection and stmt-only table: use BINLOG statement BINLOG ' 1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= 1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= '; ERROR HY000: Cannot execute row injection: binlogging impossible since at least one table uses a storage engine limited to statement-logging. +SELECT * FROM t_stmt /* should be empty */; +a ---- binlog_format=mixed ---- [on slave] include/stop_slave.inc @@ -83,21 +96,30 @@ SET @@session.binlog_format = STATEMENT; * Row-only engine and binlog_format=statement: innodb-specific message INSERT INTO t_row VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED. +SELECT * FROM t_row /* should be empty */; +a * Row-only engine and binlog_format=statement: generic message SET @@session.debug= '+d,no_innodb_binlog_errors'; INSERT INTO t_row VALUES (1); ERROR HY000: Cannot execute statement: binlogging impossible since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-logging. +SELECT * FROM t_row /* should be empty */; +a * Same statement, but db filtered out - no error USE other; INSERT INTO test.t_row VALUES (1); USE test; SET @@session.debug= ''; +SELECT * FROM t_row /* should contain the value 1 */; +a +1 * Row injection and binlog_format=statement: BINLOG statement BINLOG ' cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= '; ERROR HY000: Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT. +SELECT * FROM t /* should be empty */; +a * Same statement, but db filtered out - no error USE other; BINLOG ' @@ -105,24 +127,38 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= '; USE test; +SELECT * FROM t /* should contain the value 1 */; +a +1 +DELETE FROM t; * Unsafe statement and binlog_format=statement -INSERT INTO t VALUES (UUID()); +INSERT INTO t VALUES (COALESCE(1, UUID())); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. +SELECT * FROM t /* should contain the value 1 */; +a +1 +DELETE FROM t; * Same statement, but db filtered out - no message USE other; -INSERT INTO test.t VALUES (UUID()); +INSERT INTO test.t VALUES (COALESCE(1, UUID())); USE test; +SELECT * FROM t /* should contain the value 1 */; +a +1 +DELETE FROM t; ---- master: binlog_format=mixed, slave: binlog_format=statement ---- SET @@global.binlog_format = MIXED; SET @@session.binlog_format = MIXED; * Row injection and binlog_format=statement: in slave sql thread -INSERT INTO t VALUES (UUID()); +INSERT INTO t VALUES (COALESCE(1, UUID())); [on slave] --source include/wait_for_slave_sql_error_and_skip.inc Last_SQL_Error = Error 'Cannot execute row injection: binlogging impossible since BINLOG_FORMAT = STATEMENT.' on opening tables set global sql_slave_skip_counter=1; include/start_slave.inc +SELECT * FROM t /* should be empty */; +a [on master] ==== Clean up ==== DROP TRIGGER trig_autoinc; diff --git a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test index 4daacb10a0a..8153b60e324 100644 --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_binlog_format_errors.test @@ -93,16 +93,20 @@ AAAAAAAAAAAAAAAAAADWBFVKEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC --error ER_BINLOG_MULTIPLE_ENGINES_AND_SELF_LOGGING_ENGINE INSERT INTO t_self_logging VALUES (1); DROP trigger trig_1; +SELECT * FROM t_self_logging /* Should be empty */; +SELECT * FROM t /* Should be empty */; --echo * Modify both row-only and stmt-only table --eval CREATE TRIGGER trig_2 AFTER INSERT ON t_stmt FOR EACH ROW BEGIN INSERT INTO t_row VALUES(1); END --error ER_BINLOG_ROW_ENGINE_AND_STMT_ENGINE INSERT INTO t_stmt VALUES (1); +SELECT * FROM t_stmt /* should be empty */; DROP TRIGGER trig_2; --echo * Stmt-only table and binlog_format=row --error ER_BINLOG_ROW_MODE_AND_STMT_ENGINE INSERT INTO t_stmt VALUES (1); +SELECT * FROM t_stmt /* should be empty */; --echo * Row injection and stmt-only table: in slave sql thread INSERT INTO t_slave_stmt VALUES (1); @@ -112,7 +116,11 @@ INSERT INTO t_slave_stmt VALUES (1); --let $slave_sql_errno= 1642 --let $show_sql_error= 1 --source include/wait_for_slave_sql_error_and_skip.inc +--connection slave +SELECT * FROM t_slave_stmt /* should be empty */; +--echo [on master] +--connection master --echo * Row injection and stmt-only table: use BINLOG statement # This is a Table_map_event and a Write_rows_event. Together, they are # equivalent to 'INSERT INTO t_stmt VALUES (1)' @@ -121,6 +129,7 @@ BINLOG ' 1gRVShMBAAAALwAAAEABAAAAABcAAAAAAAAABHRlc3QABnRfc3RtdAABDwJkAAE= 1gRVShcBAAAAIAAAAGABAAAQABcAAAAAAAEAAf/+ATE= '; +SELECT * FROM t_stmt /* should be empty */; --echo ---- binlog_format=mixed ---- @@ -161,6 +170,7 @@ SET @@session.binlog_format = STATEMENT; --echo * Row-only engine and binlog_format=statement: innodb-specific message --error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE INSERT INTO t_row VALUES (1); +SELECT * FROM t_row /* should be empty */; # Commented out since innodb gives an error (this is a bug) #--echo * Same statement, but db filtered out - no error @@ -172,12 +182,14 @@ INSERT INTO t_row VALUES (1); SET @@session.debug= '+d,no_innodb_binlog_errors'; --error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE INSERT INTO t_row VALUES (1); +SELECT * FROM t_row /* should be empty */; --echo * Same statement, but db filtered out - no error USE other; INSERT INTO test.t_row VALUES (1); USE test; SET @@session.debug= ''; +SELECT * FROM t_row /* should contain the value 1 */; --echo * Row injection and binlog_format=statement: BINLOG statement # This is a Table_map_event and a Write_rows_event. Together, they are @@ -187,6 +199,7 @@ BINLOG ' cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= '; +SELECT * FROM t /* should be empty */; --echo * Same statement, but db filtered out - no error # This is a Table_map_event and a Write_rows_event. Together, they are @@ -197,15 +210,21 @@ cNpVShMBAAAAKgAAADYBAAAAABcAAAAAAAAABHRlc3QAAXQAAQ8CZAAB cNpVShcBAAAAIAAAAFYBAAAQABcAAAAAAAEAAf/+ATE= '; USE test; +SELECT * FROM t /* should contain the value 1 */; +DELETE FROM t; --echo * Unsafe statement and binlog_format=statement # This will give a warning. -INSERT INTO t VALUES (UUID()); +INSERT INTO t VALUES (COALESCE(1, UUID())); +SELECT * FROM t /* should contain the value 1 */; +DELETE FROM t; --echo * Same statement, but db filtered out - no message USE other; -INSERT INTO test.t VALUES (UUID()); +INSERT INTO test.t VALUES (COALESCE(1, UUID())); USE test; +SELECT * FROM t /* should contain the value 1 */; +DELETE FROM t; --echo ---- master: binlog_format=mixed, slave: binlog_format=statement ---- @@ -214,14 +233,15 @@ SET @@global.binlog_format = MIXED; SET @@session.binlog_format = MIXED; --echo * Row injection and binlog_format=statement: in slave sql thread -INSERT INTO t VALUES (UUID()); +INSERT INTO t VALUES (COALESCE(1, UUID())); --echo [on slave] --connection slave # 1644 = ER_BINLOG_ROW_INJECTION_AND_STMT_MODE --let $slave_sql_errno= 1644 --let $show_sql_error= 1 --source include/wait_for_slave_sql_error_and_skip.inc - +--connection slave +SELECT * FROM t /* should be empty */; --echo [on master] --connection master From 3f1899e858fd00bb5edcfedf5b9305e5467a366f Mon Sep 17 00:00:00 2001 From: Alfranio Correia Date: Thu, 14 Jan 2010 16:50:45 +0000 Subject: [PATCH 67/69] Removed garbage from the mysqld--help-win --- mysql-test/r/mysqld--help-win.result | 1 - 1 file changed, 1 deletion(-) diff --git a/mysql-test/r/mysqld--help-win.result b/mysql-test/r/mysqld--help-win.result index ff882e4459c..7e261fc203c 100644 --- a/mysql-test/r/mysqld--help-win.result +++ b/mysql-test/r/mysqld--help-win.result @@ -993,7 +993,6 @@ use-symbolic-links FALSE verbose TRUE wait-timeout 28800 warnings 1 ->>>>>>> MERGE-SOURCE To see what values a running MySQL server is using, type 'mysqladmin variables' instead of 'mysqld --verbose --help'. From 5d279205146aa1e1c6eb6fcd31933d569fb4484a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jan 2010 13:06:33 +0800 Subject: [PATCH 68/69] Fix for perfschema.binlog_stmt failure: Problem: The test case failed because: (i) warning text in result file differed from the warning output by the server, and (ii) binlog contents in result file did not show the statements logged wrapped in BEGIN/COMMIT as it is the case after WL 2687. Solution: We update the result file, but first we change the unsafe warning text to also refer to performance_schema table(s). This required changing the result files for existing test cases that provide output for warnings related to ER_BINLOG_UNSAFE_SYSTEM_TABLE. "Grepping" in result files, shows that only binlog_unsafe contained reference to such a warning. We also update the result file with the missing BEGIN/COMMIT statements. --- .../suite/binlog/r/binlog_unsafe.result | 92 +++++++++---------- .../suite/perfschema/r/binlog_stmt.result | 17 +++- .../suite/perfschema/t/binlog_stmt.test | 1 + sql/share/errmsg-utf8.txt | 2 +- sql/share/errmsg.txt | 2 +- 5 files changed, 62 insertions(+), 52 deletions(-) diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index 7845ec93b44..219b7495507 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -1912,7 +1912,7 @@ CREATE FUNCTION func_sidef_1() RETURNS VARCHAR(100) BEGIN INSERT INTO ta1 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -1921,7 +1921,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -1931,7 +1931,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. ******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** @@ -1955,7 +1955,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -1963,11 +1963,11 @@ DROP TRIGGER trig_2; Invoking view view_sidef_2 invoking function func_sidef_1 invoking unsafe use of mysql.general_log. CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP VIEW view_sidef_2; @@ -1977,7 +1977,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT func_sidef_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -1988,7 +1988,7 @@ CREATE PROCEDURE proc_1() BEGIN INSERT INTO ta1 VALUES (47); INSERT INTO t0 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_1(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. ******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** @@ -2007,7 +2007,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2017,7 +2017,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); CALL proc_1(); END; * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. ******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** @@ -2040,7 +2040,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2050,7 +2050,7 @@ PREPARE prep_2 FROM "CALL proc_1()"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. ******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** @@ -2071,7 +2071,7 @@ CREATE TRIGGER trig_1 BEFORE INSERT ON trigger_table_1 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_1 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2080,7 +2080,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2090,7 +2090,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO trigger * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. ******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** @@ -2114,7 +2114,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2124,7 +2124,7 @@ PREPARE prep_2 FROM "INSERT INTO trigger_table_1 VALUES (1)"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2133,11 +2133,11 @@ DROP TRIGGER trig_1; Invoking view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE VIEW view_retval_1 AS SELECT COUNT(*) FROM mysql.general_log; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t1 SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2148,7 +2148,7 @@ CREATE FUNCTION func_sidef_2() RETURNS VARCHAR(100) BEGIN INSERT INTO ta2 VALUES * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT func_sidef_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP FUNCTION func_sidef_2; @@ -2158,7 +2158,7 @@ CREATE PROCEDURE proc_2() BEGIN INSERT INTO ta2 VALUES (47); INSERT INTO t1 SELE * binlog_format = STATEMENT: expect 1 warnings. CALL proc_2(); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. ******** Failure! Event number 3 was a 'Query', not a 'Table_map'. ******** @@ -2178,7 +2178,7 @@ CREATE TRIGGER trig_2 BEFORE INSERT ON trigger_table_2 FOR EACH ROW BEGIN INSERT * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO trigger_table_2 VALUES (1); Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP TRIGGER trig_2; @@ -2186,11 +2186,11 @@ DROP TRIGGER trig_2; Invoking view view_retval_2 returning value from view view_retval_1 returning value from unsafe use of mysql.general_log. CREATE VIEW view_retval_2 AS SELECT * FROM view_retval_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t2 SELECT * FROM view_retval_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2202,7 +2202,7 @@ PREPARE prep_2 FROM "INSERT INTO t1 SELECT * FROM view_retval_1"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_2; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_2; @@ -2213,7 +2213,7 @@ PREPARE prep_1 FROM "INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log"; * binlog_format = STATEMENT: expect 1 warnings. EXECUTE prep_1; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. DROP PREPARE prep_1; @@ -2222,7 +2222,7 @@ Invoking unsafe use of mysql.general_log. * binlog_format = STATEMENT: expect 1 warnings. INSERT INTO t0 SELECT COUNT(*) FROM mysql.general_log; Warnings: -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. * Invoke statement so that return value is dicarded: expect no warning. @@ -2237,7 +2237,7 @@ INSERT INTO t1 SELECT func_sidef_1(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2252,7 +2252,7 @@ INSERT INTO t2 SELECT func_sidef_2(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2268,7 +2268,7 @@ CALL proc_2(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2300,7 +2300,7 @@ INSERT INTO trigger_table_2 VALUES (1); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2314,7 +2314,7 @@ CREATE VIEW view_sidef_2 AS SELECT func_sidef_1(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2324,7 +2324,7 @@ INSERT INTO t2 SELECT * FROM view_sidef_2; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2340,7 +2340,7 @@ EXECUTE prep_2; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2360,7 +2360,7 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2372,7 +2372,7 @@ INSERT INTO t2 SELECT func_sidef_2(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2391,7 +2391,7 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2420,7 +2420,7 @@ INSERT INTO trigger_table_2 VALUES (1); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2439,7 +2439,7 @@ Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = S Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system function whose value may differ on slave. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. * SQL_LOG_BIN = 0: expect nothing logged and no warning. * binlog_format = MIXED: expect row events in binlog and no warning. @@ -2453,7 +2453,7 @@ INSERT INTO trigger_table_1 VALUES (1); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2468,7 +2468,7 @@ INSERT INTO t2 SELECT func_sidef_2(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2484,7 +2484,7 @@ CALL proc_2(); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2516,7 +2516,7 @@ INSERT INTO trigger_table_2 VALUES (1); Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2532,7 +2532,7 @@ EXECUTE prep_2; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2549,7 +2549,7 @@ EXECUTE prep_1; Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. @@ -2564,7 +2564,7 @@ INSERT DELAYED INTO double_autoinc_table SELECT CONCAT(UUID(), @@hostname, myfun Warnings: Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted. -Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a UDF. It cannot be determined if the UDF will return the same value on slave. Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses a system variable whose value may differ on slave. diff --git a/mysql-test/suite/perfschema/r/binlog_stmt.result b/mysql-test/suite/perfschema/r/binlog_stmt.result index cec46b20670..b03b9a1f5af 100644 --- a/mysql-test/suite/perfschema/r/binlog_stmt.result +++ b/mysql-test/suite/perfschema/r/binlog_stmt.result @@ -1,4 +1,5 @@ set binlog_format=statement; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); RESET MASTER; select count(*) > 0 from performance_schema.SETUP_INSTRUMENTS; count(*) > 0 @@ -6,7 +7,7 @@ count(*) > 0 update performance_schema.SETUP_INSTRUMENTS set enabled='NO' where name like "wait/synch/rwlock/%"; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. select count(*) > 0 from performance_schema.EVENTS_WAITS_CURRENT; count(*) > 0 1 @@ -17,32 +18,40 @@ create table test.t2 (name varchar(128)); insert into test.t1 select thread_id from performance_schema.EVENTS_WAITS_CURRENT; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. insert into test.t2 select name from performance_schema.SETUP_INSTRUMENTS where name like "wait/synch/rwlock/%"; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. drop table test.t1; drop table test.t2; update performance_schema.SETUP_INSTRUMENTS set enabled='YES' where name like "wait/synch/rwlock/%"; Warnings: -Note 1592 Statement may not be safe to log in statement format. +Note 1592 Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT. Reason for unsafeness: Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave. show binlog events from ; Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='NO' where name like "wait/synch/rwlock/%" +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table if exists test.t1 master-bin.000001 # Query # # use `test`; drop table if exists test.t2 master-bin.000001 # Query # # use `test`; create table test.t1 (thread_id integer) master-bin.000001 # Query # # use `test`; create table test.t2 (name varchar(128)) +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into test.t1 select thread_id from performance_schema.EVENTS_WAITS_CURRENT +master-bin.000001 # Query # # COMMIT +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; insert into test.t2 select name from performance_schema.SETUP_INSTRUMENTS where name like "wait/synch/rwlock/%" +master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # use `test`; drop table test.t1 master-bin.000001 # Query # # use `test`; drop table test.t2 +master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # use `test`; update performance_schema.SETUP_INSTRUMENTS set enabled='YES' where name like "wait/synch/rwlock/%" +master-bin.000001 # Query # # COMMIT diff --git a/mysql-test/suite/perfschema/t/binlog_stmt.test b/mysql-test/suite/perfschema/t/binlog_stmt.test index 759c34634c8..28e118a36f8 100644 --- a/mysql-test/suite/perfschema/t/binlog_stmt.test +++ b/mysql-test/suite/perfschema/t/binlog_stmt.test @@ -20,6 +20,7 @@ --source include/have_perfschema.inc set binlog_format=statement; +call mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT"); --source ../include/binlog_common.inc diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt index ae8adcbb646..dc07fb563e6 100644 --- a/sql/share/errmsg-utf8.txt +++ b/sql/share/errmsg-utf8.txt @@ -6279,7 +6279,7 @@ ER_BINLOG_UNSAFE_LIMIT ER_BINLOG_UNSAFE_INSERT_DELAYED eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted." ER_BINLOG_UNSAFE_SYSTEM_TABLE - eng "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave." + eng "Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave." ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave." ER_BINLOG_UNSAFE_UDF diff --git a/sql/share/errmsg.txt b/sql/share/errmsg.txt index 821aed1f255..0d108fc019f 100644 --- a/sql/share/errmsg.txt +++ b/sql/share/errmsg.txt @@ -6220,7 +6220,7 @@ ER_BINLOG_UNSAFE_LIMIT ER_BINLOG_UNSAFE_INSERT_DELAYED eng "Statement uses INSERT DELAYED. This is unsafe because the time when rows are inserted cannot be predicted." ER_BINLOG_UNSAFE_SYSTEM_TABLE - eng "Statement uses the general_log or slow_log table. This is unsafe because system tables may differ on slave." + eng "Statement uses the general_log, slow_log or performance_schema table(s). This is unsafe because system tables may differ on slave." ER_BINLOG_UNSAFE_TWO_AUTOINC_COLUMNS eng "Statement updates two AUTO_INCREMENT columns. This is unsafe because the generated value cannot be predicted by slave." ER_BINLOG_UNSAFE_UDF From 33c075e842324cfdf0aab055c2db8d0d50bcbc68 Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Mon, 18 Jan 2010 15:01:11 +0300 Subject: [PATCH 69/69] Enable sys_vars and perfschema test suites for regular PB builds. --- mysql-test/collections/mysql-next-mr.push | 6 +++--- mysql-test/collections/mysql-trunk.push | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mysql-test/collections/mysql-next-mr.push b/mysql-test/collections/mysql-next-mr.push index 7699e2532c3..b84f43eea7c 100644 --- a/mysql-test/collections/mysql-next-mr.push +++ b/mysql-test/collections/mysql-next-mr.push @@ -1,5 +1,5 @@ -perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl,sys_vars -perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl -perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1 diff --git a/mysql-test/collections/mysql-trunk.push b/mysql-test/collections/mysql-trunk.push index 97101d5994c..b84f43eea7c 100644 --- a/mysql-test/collections/mysql-trunk.push +++ b/mysql-test/collections/mysql-trunk.push @@ -1,5 +1,5 @@ -perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl -perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl -perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=n_mix --vardir=var-n_mix --mysqld=--binlog-format=mixed --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=ps_row --vardir=var-ps_row --ps-protocol --mysqld=--binlog-format=row --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema +perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=embedded --vardir=var-emebbed --embedded --suite=main,binlog,innodb,federated,rpl,sys_vars,perfschema perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=rpl_binlog_row --vardir=var-rpl_binlog_row --mysqld=--binlog-format=row --suite=rpl,binlog perl mysql-test-run.pl --timer --force --parallel=auto --experimental=collections/default.experimental --comment=funcs_1 --vardir=var-funcs_1 --suite=funcs_1